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

"--bootnodes" option doesn't work (private network) #2708

Closed
wawrzek opened this issue Jun 16, 2016 · 23 comments
Closed

"--bootnodes" option doesn't work (private network) #2708

wawrzek opened this issue Jun 16, 2016 · 23 comments

Comments

@wawrzek
Copy link

wawrzek commented Jun 16, 2016

System information

Geth version: Geth/v1.3.6/linux/go1.5.1
OS & Version: Linux (Ubuntu 14.04)

Expected behaviour

Nodes specify in 'bootnodes' are added during geth start

Actual behaviour

Nodes are not added.

Steps to reproduce the behaviour

I have following command with 2 bootnodes provided, however they are not added to during boot up:

geth --genesis /geth/seed.json --bootnodes enode://[email protected]:30303 enode:/[email protected]:30303 --rpc --rpcaddr 0.0.0.0 --rpcport 8080 --rpccorsdomain * --ipcpath /geth/geth.ipc --datadir /geth/chain --port 30303 --autodag --networkid 12121212 --metrics --verbosity 5

@wawrzek wawrzek changed the title geth with bootnodes doesn't make connections to specify machines geth with bootnodes doesn't make connections to specify machines (private network) Jun 16, 2016
@wawrzek wawrzek changed the title geth with bootnodes doesn't make connections to specify machines (private network) "--bootnodes" option doesn't work (private network) Jun 23, 2016
@wawrzek
Copy link
Author

wawrzek commented Jun 23, 2016

I've done further investigation. Updated version to latest available in Ubuntu (instance: Geth/v1.4.7-stable/linux/go1.5.1) and bootnodes doesn't understand proper bootnode definition.

I start geth with:

geth --genesis seed.json --bootnodes enode://3ac93fcb61bab53e35b0319800e23e0b1708856ccf6142f01784e5d13310887dfec2f95f7bb6b50b1fb2cc5bff1b0ebd0ee187c6ca7e8ac2f868b28b95008610@10.0.1.4:30303 enode://b1401f1fa9f0e10bffb59e7632c637827a036707731803a577fb60d45d320bcc0f1077d7043ed90b7ac168ee69a1aa9fbf46a1737bad5786d67260a119be1fa1@10.0.1.5:30303

grep for Bootstrap shows:

I0623 10:12:09.024329 cmd/utils/flags.go:486] Bootstrap URL enode://3ac93fcb61bab53e35b0319800e23e0b1708856ccf6142f01784e5d13310887dfec2f95f7bb6b50b1fb2cc5bff1b0ebd0ee187c6ca7e8ac2f868b28b95008610@10.0.1.4:30303 enode://b1401f1fa9f0e10bffb59e7632c637827a036707731803a577fb60d45d320bcc0f1077d7043ed90b7ac168ee69a1aa9fbf46a1737bad5786d67260a119be1fa1@10.0.1.5:30303: invalid host: too many colons in address 10.0.1.4:30303 enode:

Seems that geth doesn't understand spaces. In case of one bootnodes I got another error

I0623 10:23:26.194967 p2p/discover/database.go:183] failed to retrieve node 3ac93fcb61bab53e35b0319800e23e0b1708856ccf6142f01784e5d13310887dfec2f95f7bb6b50b1fb2cc5bff1b0ebd0ee187c6ca7e8ac2f868b28b95008610: leveldb: not found

and there is no nodes.

@karalabe
Copy link
Member

karalabe commented Jun 23, 2016

$ geth --help | grep bootnodes

  --bootnodes value Comma separated enode URLs for P2P discovery bootstrap

;)

Edit:

Comma separated enode URLs for P2P discovery bootstrap

@wawrzek
Copy link
Author

wawrzek commented Jun 23, 2016

@karalabe thanks for the response.

a) That means that documentation is wrong. There is nothing about ',' in here:
https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network

b) doesn't explain why bootnets doesn't work when only one node is specify. Second error message about leveldb.

c) adding ',' works only if there is not spaces - that very silly
enode://XXX@YYY:ZZZ, enode:/AAA@BBB:CCC
doesn't work but
enode://XXX@YYY:ZZZ,enode:/AAA@BBB:CCC
doesn't work in other way.

There is no peers (so the result is the same as with one node):
> admin.peers []

@karalabe
Copy link
Member

a) Thanks, fixed.
b) That's just a debug log that the specific discovery node has never been encountered before.
c) The whole point is to not have space which evaluate to separate arguments/flags and are extremely brittle in scripts with variable expansions.

@wawrzek
Copy link
Author

wawrzek commented Jun 23, 2016

Thanks for update. Now, why my node doesn't see any peers? Anything I can find in debug?

@karalabe
Copy link
Member

@fjl Could you please jump in with a debug log level argument to display logs pertaining to these connectivity issues?

@wawrzek
Copy link
Author

wawrzek commented Jun 23, 2016

BTW. I bump verbosity up to 6.

@wawrzek
Copy link
Author

wawrzek commented Jun 24, 2016

I wonder if there any relation to issue 2727.

@wawrzek
Copy link
Author

wawrzek commented Jun 27, 2016

@karalabe there is another place with not update documentation: https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options

@wawrzek
Copy link
Author

wawrzek commented Jul 6, 2016

@karalabe Could you add 'Private Network' label please.
@fjl any chance to point what to debug?

@wawrzek
Copy link
Author

wawrzek commented Aug 23, 2016

I see '--bootnodes' works in 1.4.11.

@wawrzek wawrzek closed this as completed Aug 23, 2016
@andrefernandes
Copy link

I know this is closed, but I get the same problem using the ethereum/client-do Docker image. Looks like "--bootnodes" is ignored, and geth version is 1.4.11-stable.

@tcsekhar
Copy link

tcsekhar commented Oct 3, 2017

Wow, its over a year and I'm having the same issue..

@xuxiao415
Copy link

today, Geth/v1.7.3-unstable/linux-amd64/go1.9.1 has the same issue.

@karalabe
Copy link
Member

What doesn't work? We re constantly using this on the Rinkeby testnet and other private network too. It works. Unless you provide any details, there's no way for us to help you.

@xuxiao415
Copy link

  1. first, use geth --datadir /chaindata/ --nodiscover console to start one node in a docker container
  2. then, use geth --datadir /chaindata/ --nodiscover --bootnodes "enode://***@172.17.0.2:30303?discport=0" console to start another node in another container, where enode://***@172.17.0.2:30303?discport=0 is the identity of the above node, and 172.17.0.2 is the ip of the container
    when I type admin.peers on one node's console, I got nothing. Is the above steps wrong?

@ahester57
Copy link

Maybe each node needs its own unique datadir? I'm not 100% on that but mine have separate datadirs and a proper static-nodes.json in each datadir and they connect to each other fine.

@holiman
Copy link
Contributor

holiman commented Dec 3, 2017

There are a lot of things that can go wrong here. Some things to look into are

  • Are the ports correctly opened between the docker containers? Can you (e.g. via wireshark) ensure that they can reach eachother?
  • Can you increase the verbosity-level on the second machine? The debug loglevel contains a lot of information on the p2p layer.

@Twanaar
Copy link

Twanaar commented Jun 14, 2018

Same issue here, --bootnodes not work, but adding the node with admin.addPeer(enodeurl) working, with the excat same enode url infos.

the command line:
geth --identity "MyTestNodePc2" --nodiscover --bootnodes "enode://8966b7a85496bd37e61fceb49ca03c1527291d0c21dbf9a3ab68226174704e6c2a18929e748cd802f80bb0a67136950dc1fdc89c2825b4c6e7dcc35c36c51826@[::]:30303" --datadir e:/geth/node_data_testnet2 --port 30304 --rpc --rpcport 8102 --ipcdisable -verbosity 6 --mine --minerthreads 1 console

ouput in verbose 6

E:\Geth>geth --identity "MyTestNodePc2" --nodiscover --bootnodes "enode://8966b7a85496bd37e61fceb49ca03c1527291d0c21dbf9a3ab68226174704e6c2a18929e748cd802f80bb0a67136950dc1fdc89c2825b4c6e7dcc35c36c51826@[::]:30303" --datadir e:/geth/node_data_testnet2 --port 30304 --rpc --rpcport 8102 --ipcdisable -verbosity 6 --mine --minerthreads 1 console
INFO [06-13|23:24:21] Maximum peer count ETH=25 LES=0 total=25
DEBUG[06-13|23:24:21] FS scan times list=0s set=0s diff=0s
TRACE[06-13|23:24:21] Handled keystore changes time=0s
INFO [06-13|23:24:21] Starting peer-to-peer node instance=Geth/MyTestNodePc2/v1.8.8-stable-2688dab4/windows-amd64/go1.10.1
INFO [06-13|23:24:21] Allocated cache and file handles database=e:\geth\node_data_testnet2\geth\chaindata cache=768 handles=1024
INFO [06-13|23:24:21] Initialised chain configuration config="{ChainID: 6699 Homestead: 0 DAO: DAOSupport: false EIP150: EIP155: 0 EIP158: 0 Byzantium: Constantinople: Engine: unknown}"
INFO [06-13|23:24:21] Disk storage enabled for ethash caches dir=e:\geth\node_data_testnet2\geth\ethash count=3
INFO [06-13|23:24:21] Disk storage enabled for ethash DAGs dir=C:\Users\asaff\AppData\Ethash count=2
INFO [06-13|23:24:21] Initialising Ethereum protocol versions="[63 62]" network=1
WARN [06-13|23:24:21] Head state missing, repairing chain number=3011 hash=ca6c2a…4c0122
INFO [06-13|23:24:21] Rewound blockchain to past state number=3006 hash=08670f…8a3cfa
INFO [06-13|23:24:21] Loaded most recent local header number=3011 hash=ca6c2a…4c0122 td=805392110
INFO [06-13|23:24:21] Loaded most recent local full block number=3006 hash=08670f…8a3cfa td=803243630
INFO [06-13|23:24:21] Loaded most recent local fast block number=3011 hash=ca6c2a…4c0122 td=805392110
DEBUG[06-13|23:24:21] Reinjecting stale transactions count=0
INFO [06-13|23:24:21] Loaded local transaction journal transactions=0 dropped=0
INFO [06-13|23:24:21] Regenerated local transaction journal transactions=0 accounts=0
WARN [06-13|23:24:21] Blockchain not empty, fast sync disabled
DEBUG[06-13|23:24:21] Recalculated downloader QoS values rtt=20s confidence=1.000 ttl=1m0s
INFO [06-13|23:24:21] Starting P2P networking
INFO [06-13|23:24:21] RLPx listener up self="enode://bd6b14fd30b6c74c594365886fbbec9548efbfc6f16b2d6c45256316b93bb94dba4fd55103789eff896aeb61694f0935b0314ac97c9d85bec3929c215685a77f@[::]:30304?discport=0"
DEBUG[06-13|23:24:21] InProc registered service=&{node:0xc042317400} namespace=admin
DEBUG[06-13|23:24:21] InProc registered service=&{node:0xc042317400} namespace=admin
DEBUG[06-13|23:24:21] InProc registered service="&{mu:{state:0 sema:0} cpuW: cpuFile: traceW: traceFile:}" namespace=debug
DEBUG[06-13|23:24:21] InProc registered service=&{node:0xc042317400} namespace=debug
DEBUG[06-13|23:24:21] InProc registered service=&{stack:0xc042317400} namespace=web3
DEBUG[06-13|23:24:21] InProc registered service=&{b:0xc042179c00} namespace=eth
DEBUG[06-13|23:24:21] InProc registered service=&{b:0xc042179c00} namespace=eth
DEBUG[06-13|23:24:21] InProc registered service="&{b:0xc042179c00 nonceLock:0xc042078b20}" namespace=eth
DEBUG[06-13|23:24:21] InProc registered service=&{b:0xc042179c00} namespace=txpool
DEBUG[06-13|23:24:21] InProc registered service=&{b:0xc042179c00} namespace=debug
DEBUG[06-13|23:24:21] InProc registered service=&{b:0xc042179c00} namespace=debug
DEBUG[06-13|23:24:21] InProc registered service=&{am:0xc042089ee0} namespace=eth
DEBUG[06-13|23:24:21] InProc registered service="&{am:0xc042089ee0 nonceLock:0xc042078b20 b:0xc042179c00}" namespace=personal
DEBUG[06-13|23:24:21] InProc registered service=&{e:0xc0422ca460} namespace=eth
DEBUG[06-13|23:24:21] InProc registered service="&{e:0xc0422ca460 agent:0xc0421ca000}" namespace=eth
DEBUG[06-13|23:24:21] InProc registered service="&{d:0xc0420cc820 mux:0xc0421766c0 installSyncSubscription:0xc04218e420 uninstallSyncSubscription:0xc04218e480}" namespace=eth
DEBUG[06-13|23:24:21] InProc registered service=&{e:0xc0422ca460} namespace=miner
DEBUG[06-13|23:24:21] InProc registered service="&{backend:0xc042179c00 mux:0xc0421766c0 quit: chainDb:0xc0420e11e0 events:0xc04228a280 filtersMu:{state:0 sema:0} filters:map[]}" namespace=eth
DEBUG[06-13|23:24:21] InProc registered service=&{eth:0xc0422ca460} namespace=admin
DEBUG[06-13|23:24:21] InProc registered service=&{eth:0xc0422ca460} namespace=debug
DEBUG[06-13|23:24:21] InProc registered service="&{config:0xc0421e0100 eth:0xc0422ca460}" namespace=debug
DEBUG[06-13|23:24:21] InProc registered service="&{net:0xc042317900 networkVersion:1}" namespace=net
DEBUG[06-13|23:24:21] HTTP registered namespace=web3
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=eth
DEBUG[06-13|23:24:21] HTTP registered namespace=net
INFO [06-13|23:24:21] HTTP endpoint opened url=http://127.0.0.1:8102 cors= vhosts=localhost
INFO [06-13|23:24:21] Transaction pool price threshold updated price=18000000000
INFO [06-13|23:24:21] Etherbase automatically configured address=0x3e747d49be38CC69573a6aEd7631430547b1BDDA
INFO [06-13|23:24:21] Starting mining operation
INFO [06-13|23:24:21] Commit new mining work number=3007 txs=0 uncles=0 elapsed=1.000ms
TRACE[06-13|23:24:21] Requiring new ethash dataset epoch=0
TRACE[06-13|23:24:21] Requiring new future ethash dataset epoch=1
DEBUG[06-13|23:24:21] Loaded old ethash dataset from disk epoch=0
TRACE[06-13|23:24:21] Started ethash search for new nonces miner=0 seed=7038418853576829939
DEBUG[06-13|23:24:21] Loaded old ethash dataset from disk epoch=1
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":1,"method":"rpc_modules","params":null}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":1,"result":{"admin":"1.0","debug":"1.0","eth":"1.0","miner":"1.0","net":"1.0","personal":"1.0","rpc":"1.0","txpool":"1.0","web3":"1.0"}}"
Welcome to the Geth JavaScript console!

TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":2,"method":"web3_clientVersion","params":[]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":2,"result":"Geth/MyTestNodePc2/v1.8.8-stable-2688dab4/windows-amd64/go1.10.1"}"
instance: Geth/MyTestNodePc2/v1.8.8-stable-2688dab4/windows-amd64/go1.10.1
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":3,"method":"eth_coinbase","params":[]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":3,"result":"0x3e747d49be38cc69573a6aed7631430547b1bdda"}"
coinbase: 0x3e747d49be38cc69573a6aed7631430547b1bdda
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":4,"method":"eth_blockNumber","params":[]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":4,"result":"0xbbe"}"
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":5,"method":"eth_blockNumber","params":[]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":5,"result":"0xbbe"}"
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":6,"method":"eth_getBlockByNumber","params":["0xbbe",false]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":6,"result":{"difficulty":"0x6aad2","extraData":"0xda83010808846765746888676f312e31302e318777696e646f7773","gasLimit":"0x47e7c4","gasUsed":"0x0","hash":"0x08670f17590cae522dc0127461561336b07ced7529b794f65db1f7d7b08a3cfa","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x3e747d49be38cc69573a6aed7631430547b1bdda","mixHash":"0xd3def595c8fa656f74bd83d1ef277824019ab72fd075e8fa542fb7e294db8b39","nonce":"0x5292fd02d8208a85","number":"0xbbe","parentHash":"0x3a45bfc9289babaa3048688828adc765087ad8c2b8bd3c3f805590c85f6e1292","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x21c","stateRoot":"0x7a8acbc0258c02234d9bc222b0d2734a6d9309a7aaa06d3ded6299905d27e625","timestamp":"0x5b21de3a","totalDifficulty":"0x2fe0866e","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]}}"
at block: 3006 (Wed, 13 Jun 2018 23:17:14 -04)
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":7,"method":"admin_datadir","params":[]}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":7,"result":"e:\\geth\\node_data_testnet2"}"
datadir: e:\geth\node_data_testnet2
TRACE[06-13|23:24:21] msg="sending {"jsonrpc":"2.0","id":8,"method":"rpc_modules","params":null}"
TRACE[06-13|23:24:21] msg="<-readResp: response {"jsonrpc":"2.0","id":8,"result":{"admin":"1.0","debug":"1.0","eth":"1.0","miner":"1.0","net":"1.0","personal":"1.0","rpc":"1.0","txpool":"1.0","web3":"1.0"}}"
modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

DEBUG[06-13|23:24:23] Couldn't add port mapping proto=tcp extport=30304 intport=30304 interface="UPnP or NAT-PMP" err="no UPnP or NAT-PMP router discovered"
TRACE[06-13|23:24:23] Ethash nonce found and reported miner=0 attempts=134258 nonce=7038418853576964197
INFO [06-13|23:24:23] Successfully sealed new block number=3007 hash=a29fc2…ca07da
DEBUG[06-13|23:24:23] Trie cache stats after commit misses=0 unloads=0
INFO [06-13|23:24:23] 🔨 mined potential block number=3007 hash=a29fc2…ca07da
TRACE[06-13|23:24:23] Propagated block hash=a29fc2…ca07da recipients=0 duration=2562047h47m16.854s
DEBUG[06-13|23:24:23] Reinjecting stale transactions count=0
TRACE[06-13|23:24:23] Announced block hash=a29fc2…ca07da recipients=0 duration=2562047h47m16.854s
INFO [06-13|23:24:23] Commit new mining work number=3008 txs=0 uncles=0 elapsed=15.001ms
TRACE[06-13|23:24:23] Started ethash search for new nonces miner=0 seed=766848748592413182
DEBUG[06-13|23:24:24] FS scan times list=0s set=0s diff=0s

no node added.

after adding node manulay by command:

admin.addPeer("enode://8966b7a85496bd37e61fceb49ca03c1527291d0c21dbf9a3ab68226174704e6c2a18929e748cd802f80bb0a67136950dc1fdc89c2825b4c6e7dcc35c36c51826@[::]:30303")

it's working, so it's not an port or other things issue, --bootnodes not work !

@skitzofrenicdev
Copy link

Skitzo

@Twanaar
Copy link

Twanaar commented Jun 14, 2018

For info, using static nodes works,
You can configure permanent static nodes by putting something like the following into /geth/static-nodes.json

[
"enode://f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0@33.4.2.1:30303",
"enode://pubkey@ip:port"
]

@ahester57
Copy link

Here is a collection of scripts for running a private network using go-ethereum. For adding bootnodes, check out the scripts get_enodes.sh and copy_static_nodes.sh.

They will essentially start and stop each node, grabbing the enode of each and writing them to a file, enode/new_static_nodes.json.

@Bitmaudit
Copy link

I've this error:
Fatal: Error starting protocol stack: bad bootstrap node "enode://c7c7c4905b29c81a36907937261c2b2523b48e60dbef489ac329aedbc5d19910921f84603d3255621b0928d8262327dff0855ce95f66bb88a2a401d0884d1c80@[::]:30301": invalid IP (multicast/unspecified)

the file Dockerfile was specific another (different enode, the right!):

enode://0df98758a40a58db0ec6c4db14f9241dcf3fec37b0bdb08720de369da0ea1631a3f55717135518a9dea25c8854554f4ccddb33c8d5402130fcbca76fe8d74249@5.189.165.78:30301

the error report an enode used in yhe past! how do fix?

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