Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection refused to Geth websocket / RPC ports #16353

Closed
mascom8 opened this issue Mar 20, 2018 · 5 comments
Closed

connection refused to Geth websocket / RPC ports #16353

mascom8 opened this issue Mar 20, 2018 · 5 comments

Comments

@mascom8
Copy link

mascom8 commented Mar 20, 2018

Hi there,
I have installed Geth v.1.8.3-unstable on CentOS 7 / 64-bit with go version go1.8.3.

When trying to start geth with

$ nohup geth --datadir /home/bchain/Private_Chain/chaindata --mine --nodiscover --nat any --identity private chain --networkid 1900 --port 30301 --verbosity 5 --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpccorsdomain '*' --rpcapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --ipcpath /home/bchain/Private_Chain/get.ipc --ipcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3 --ws --wsaddr 0.0.0.0 --wsport 8546 --wsorigins '*' --wsapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --maxpeers 25 --etherbase 0 --gasprice 0 --targetgaslimit 9999999

Geth seems to be running successfully without error messages.

then..

$ geth attach ws://127.0.0.1:8546
Fatal: Unable to attach to remote geth: dial tcp :80: getsockopt: connection refused

$ geth attach ws:localhost:8546
Fatal: Unable to attach to remote geth: dial tcp :80: getsockopt: connection refused

or .. when connecting to RPC:
$ geth attach http://127.0.0.1:8545_
Fatal: Failed to start the JavaScript console: api modules: Post http://127.0.0.1:8545: dial tcp 127.0.0.1:8545: getsockopt: connection refused

I try $ ncat --listen 127.0.0.1 8546 and $ ncat 127.0.0.1 8546 and it catches all messages
(I think I have no problem of firewall)

Any idea ?

@karalabe
Copy link
Member

A few issues:

  • --identity private chain is wrong, it should be --identitiy "private chain", otherwise it considers only private to be the value of the flag, and then chain is not a flag any more (doesn't start with --), so it stops interpreting flags (and never reaches the RPC ones).
  • ws:localhost:8546 is not a valid url, it should be ws://127.0.0.1:8546
  • http://127.0.0.1:8545_ is invalid, the port ends in an underscore

All in all make sure the flags are correct, you're main issue is there.

@mascom8
Copy link
Author

mascom8 commented Mar 21, 2018

Still have the same problem and messages after modifications with WS but ok for RPC.

@mascom8
Copy link
Author

mascom8 commented Mar 22, 2018

Thank you. This solves my problems and here is for others the working command line:

nohup geth --datadir /home/bchain/Private_Chain/chaindata --mine --nodiscover --nat any --identity private_chain --networkid 1900 --port 30301 --verbosity 5 --ipcpath /home/bchain/Private_Chain/geth.ipc --rpc --rpcaddr 0.0.0.0 --rpcport 8545 --rpccorsdomain '*' --rpcapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --ws --wsaddr 0.0.0.0 --wsport 8546 --wsorigins '*' --wsapi personal,admin,db,eth,net,web3,miner,shh,txpool,debug --maxpeers 25 --etherbase 0 --gasprice 0 --targetgaslimit 9999999

@mascom8 mascom8 closed this as completed Mar 22, 2018
@motafa1320
Copy link

hi
how i can connect to the localhost 8545 at the wallet metamask ?
thanks

@motafa1320
Copy link

hi
how i can connect myself token by node track of way localhost 8545 to the myself wallet at the matamask?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants