Token doesn't want to deploy to a blockchain - ethereum

I have created and compiled a smart contract and created my deploy token file as well. When I run ganache-cli on one terminal it gives me '''eth_getTransactionByHash''' and while the brownie run scripts is running on the other terminal it says '''awaiting transaction from mempool'''
I logged into my MetaMask account as well and created a new Account with the RPC and chain ID provided.
Please help.

I had the same issue when running ganache-cli. I fixed it by passing some parameters
ganache-cli --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie

Related

How to reference LINK token on (forked) development network without "invalid opcode"?

I like to run a number of local tests. Everything works well on rinkeby and other test chains. However, the local development chain disagrees with my configuration.
When I run a forked development network:
brownie console --network mainnet-fork
The ganache-cli initiates as expected:
Brownie v1.18.1 - Python development framework for Ethereum
BlockchainProject is the active project.
Launching 'ganache-cli --accounts 10 --hardfork istanbul --fork https://mainnet.infura.io/v3/6a633a4ecae8449abbc69974cdd3a9b9 --gasLimit 12000000 --mnemonic brownie --port 8545 --chainId 1'...
Brownie environment is ready.
However, even the most simple contract interaction fails:
>>> link_token = Contract.from_explorer("0x514910771AF9Ca656af840dff83E8264EcF986CA")
Fetching source of 0x514910771AF9Ca656af840dff83E8264EcF986CA from api.etherscan.io...
>>> accounts[0].balance()
100000000000000000000
>>> accounts[1].balance()
100000000000000000000
>>> link_token.transfer(accounts[0].address, 100, {'from': accounts[0].address})
Transaction sent: 0x1542b679e4d09b2f4523427c7f5048ed01ee0d194c34cd27b82bbd177e1b3f23
Gas price: 0.0 gwei Gas limit: 12000000 Nonce: 2
LinkToken.transfer confirmed (invalid opcode) Block: 14604608 Gas used: 12000000 (100.00%)
<Transaction '0x1542b679e4d09b2f4523427c7f5048ed01ee0d194c34cd27b82bbd177e1b3f23'>
Since the Link token is compiled with an unsupported compiler I do not get any further information on why this results in LinkToken.transfer confirmed (invalid opcode).
How do I (correctly) run chainlink code against a forked development network using brownie - am I missing a step such as funding??
My networks: configuration in brownie-config.yaml:
networks:
mainnet-fork:
vrf_coordinator: '0xf0d54349aDdcf704F77AE15b96510dEA15cb7952'
link_token: '0x514910771AF9Ca656af840dff83E8264EcF986CA'
keyhash: '0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445'
I did try to rm -rf build but that does not change anything.
System environment:
Brownie v1.18.1
Node 8.5.5
Ganache v7.0.4
21.3.0 Darwin Kernel Version (macOS 12.2.1)
Python 3.9.7
In this instance, the account used for Link token funding does not have any Link. For some reason, the transaction does not get reverted but the unlock: option of brownie provides assistance.
First adjusting the networks:settings to include an arbitrary account with a large Link balance:
mainnet-fork:
cmd_settings:
unlock:
- 0xf37c348b7d19b17b29cd5cfa64cfa48e2d6eb8db
vrf_coordinator: '0xf0d54349aDdcf704F77AE15b96510dEA15cb7952'
link_token: '0x514910771AF9Ca656af840dff83E8264EcF986CA'
keyhash: '0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445'
Second, run a mainnet-fork as before:
brownie console --network mainnet-fork
Third, confirm that the unlocked account is available and funded:
>>> accounts[10]
<Account '0xF37C348B7d19b17B29CD5CfA64cfA48E2d6eb8Db'>
>>> accounts[10].balance()
426496436000000000
Fourth, instantiate the contract of the token, Link in this instance:
link_token = Contract.from_explorer("0x514910771AF9Ca656af840dff83E8264EcF986CA")
Finally, transfer Link from the unlocked account to some other account (or contract):
link_token.transfer(accounts[0], 20, {"from": accounts[10]})
Alternatively, funding the mainnet address with Link, or even unlocking the Link owner and minting new Link would work too...

How to connect to Livepeer to Rinkeby network?

I want to run livepeer and for that I need it to get connected to an Ethereum network. There are two options as mentioned here:
Hosted API services
Self hosted Ethereum node
If I want to opt for the latter, how would I mention rinkeby?
Because I only want to use for the test purposes.
The tutorial uses geth as example of the self-hosted Ethereum node.
In the geth manual, you can find the --rinkeby option to connect your node to the Rinkeby network.
Example:
geth --rinkeby --rpc --rpcapi "eth,net,web3"
It seems that the Livepeer doc only shows 1 hyphen (-) for the geth options, but it really should be 2 (--).
Don't forget to change the network option to -network rinkeby on Livepeer start as well.
Example:
livepeer -network rinkeby -ethUrl "http://localhost:8545"

Ethereum : Am I mining to my correct wallet address?

I'm trying to start Ethereum, so I created my wallet first using metamask and I added to geth using private key with this command.
geth account import private_key.txt
After that I run the mining command using geth --mine, so my question is : am I really mining to my correct wallet ?
OPTION 1:
You can set the account your Ethereum miner mines to by running the following in the geth console:
miner.setEtherbase('yourethaddress')
You can also set a local address to mine to using:
miner.setEtherbase(eth.accounts[2])
Replace '2' with the number of your account.
OPTION 2: When starting your geth node you can use the --etherbase flag.
geth --rpc --etherbase 0xC95767AC46EA2A9162F0734651d6cF17e5BfcF10
Using your ETH public address.
More information here: https://geth.ethereum.org/docs/interface/mining

Error with prysm beacon-chain with testnet pyrmont

I am trying to run a beacon-chain for Ethereum2.0 in the pyrmont testnet with Prysm and Besu.
I run the ETH1 node with the command :
besu --network=goerli --data-path=/root/goerliData --rpc-http-enabled
This command is working and download the entire blockchain, then run properly.
But when I launch :
./prysm.sh beacon-chain --http-web3provider=localhost:8545 --pyrmont
I get :
Verified /root/prysm/dist/beacon-chain-v1.0.0-beta.3-linux-amd64 has been signed by Prysmatic Labs.
Starting Prysm beacon-chain --http-web3provider=localhost:8545 --pyrmont
[2020-11-18 14:03:06] WARN flags: Running on Pyrmont Testnet
[2020-11-18 14:03:06] INFO flags: Using "max_cover" strategy on attestation aggregation
[2020-11-18 14:03:06] INFO node: Checking DB database-path=/root/.eth2/beaconchaindata
[2020-11-18 14:03:08] ERROR main: database contract is xxxxxxxxxxxx3fdc but tried to run with xxxxxxxxxxxx6a8c
I tried to delete the previous data folder /root/goerliData and re-download the blockchain but nothing changed...
Why does the database contract didn't change and what should I do ?
Thanks :)
The error means that you have an existing database for another network, probably medalla.
Try starting your beacon node with the flag --clear-db next time, and you'll see it the error disappear and start syncing Pyrmont.

Ethereum deployed contract not defined in Geth Javascript console

I cannot access a deployed and mined Ethereum contract on a private network from the Geth Javascript console. Not sure where the issue is, any help is appreciated.
Thank you in advance for your time.
Scenario
I launched my Geth as below
geth --datadir ~/.ethereum/myProject --networkid 1234 --rpc --rpcport 8546 --rpcapi "eth,net,web3" --unlock 0 console
I've deployed and mined an Ethereum contract (to simplify things, I've used the default MetaCoin contract provided by Truffle), and I got the trx and contract address back.
I can access it from the Truffle console but if I try from the Geth Javascript console I get an error.
Please refer to the pictures below:
Truffle console
Geth javascript console
Software used
Geth (v1.7.3-stable)
NodeJS (v6.12.3)
TestRPC (v6.0.3 (ganache-core:2.0.2))
Truffle (v4.0.5)
Geth does not know about MetaCoin. In Geth console, you need to do:
var MetaCoin = web3.eth.Contract(metaCoinJsonAbi, itsAddress);
// or web3.eth.contract depending on the version of Web3
Then you can use it. Refer to this.