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"
Related
I just installed geth and
I start an instance of geth with this command: geth --rinkeby --syncmode=light --http
then I attach to that instance with this command: geth attach http://127.0.0.1:8545
and it seems to work well...
personal command return me that:
but on command personal.newAccount() I get this error:
From what I found in a old post: https://ethereum.stackexchange.com/questions/51772/account-created-using-web3-is-not-showing-in-geth-console I should allow personal api on starting command, but right now --rpcapi personal option is not available.
Do you have any idea what I did wrong?
I setup an Ethereum light node on a VPS using Geth, and i'm running it using:
nohup geth --syncmode "light" --rpc --rpcapi "eth,net,web3" --ws --rpccorsdomain '*' --rpcaddr 0.0.0.0 --rpcport 8080 &
Now from my local laptop i would like to use this node to perform web3 queries to the Etherum blockchain. I'm using python but i tried to do the same using Web3js too and the output is the same:
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('http://MY-VPS-IP:8080'))
print(w3.isConnected())
Which gives me the following output:
False
Which means, i'm assuming, that the node is not accessible from outside the vps where i hosted it. How can i access it from outside? In theory the command i used should work, and i also made sure to have port 80 open. Any advice is appreciated
The command you write is old and not fully correct use this:
geth --syncmode "light" --ws --ws.addr "specific IP" --http --http.addr "specific IP"
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
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.
I'm getting this error:
CONNECTION ERROR: Couldn't connect to node http://localhost:8545, is it running?
I'm currently trying to use a Meteor app with a node on a private test network. I've also tried running it on a real node on the real network as well. I am able to access the web3.eth objects, but I can't seem to connect to my node! It's so frustrating!
My app runs on http://localhost:3000
I've tried the following in launching my nodes, neither of them work (they launch okay, but I cannot connect to them through my browser):
geth --networkid 8545 --genesis ~/genesis_block.json --datadir ~/.ethereum_experiment console
geth --rpccorsdomain "*" --rpc --networkid 8545 --minerthreads "1" --datadir ~/.ethereum_experiment --mine
This is what I use to set the provider in the browser console:
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
I think I was getting the same error, when was trying to run geth in a VM. And in that case the issue was with RPC listening to localhost only. Binding it to all addresses with --rpcaddr "0.0.0.0" solved the problem:
geth --rpc --rpcaddr "0.0.0.0" --rpcport 8545 --nodiscover --networkid "$NETWORKID" --datadir ~/.ethereum_experiment --genesis ~/genesis_block.json
Important thing to note here is that with a such configuration the port will be open to connections from the outside world, if it's not on a private network or not protected with a firewall.
You can also check if the RPC port is open by trying to connect to it with telnet:
telnet localhost 8545
A simple solution is to use a node provider like Alchemy or Infura!
https://docs.alchemy.com/alchemy/introduction/getting-started
Make an Alchemy key by signing up for an account and creating an app
Replace your web3 setup with something like this:
const { createAlchemyWeb3 } = require("#alch/alchemy-web3"); // Using HTTPS const web3 = createAlchemyWeb3("https://eth-mainnet.alchemyapi.io/<api-key>");
You can use free nodes from one of these node providers and avoid the hassle of maintaining your nodes yourself.