2

My private Ethereum network is still connecting outside to look for nodes, even when I have explicitly removed bootstrap information from the sources.

This is what I did:

Edit the file ethereum/go-ethereum/params/bootnodes.go and comment out initial values in these variables:

var MainnetBootnodes
var TestnetBootnodes
var RinkebyBootnodes
var RinkebyV5Bootnodes
var DiscoveryV5Bootnodes

I make clean and make install the source code.

I run with the Delve debugger a geth instance with following parameters:

  [niko@localhost go-ethereum]$ dlv exec build/bin/geth -- --verbosity 9 --ipcdisable --port 40401 --rpc --rpcport 9101 --pprof
--datadir=/home/niko/saved-niko-home/myeth/ --networkid=15 
    Type 'help' for list of commands.
    (dlv) break main
    Breakpoint 1 set at 0x461040 for main() /usr/local/go/src/runtime/rt0_linux_amd64.s:73
    (dlv) continue
    > main() /usr/local/go/src/runtime/rt0_linux_amd64.s:73 (hits total:1) (PC: 0x461040)
        68: GLOBL _rt0_amd64_linux_lib_argc<>(SB),NOPTR, $8
        69: DATA _rt0_amd64_linux_lib_argv<>(SB)/8, $0
        70: GLOBL _rt0_amd64_linux_lib_argv<>(SB),NOPTR, $8
        71: 
        72: TEXT main(SB),NOSPLIT,$-8
    =>  73:     MOVQ    $runtime·rt0_go(SB), AX
        74:     JMP AX
    (dlv) print params.MainnetBootnodes
    []string len: 0, cap: 0, []
    (dlv) print params.TestnetBootnodes 
    []string len: 0, cap: 0, []
    (dlv) print params.RinkebyBootnodes 
    []string len: 0, cap: 0, []
    (dlv) print params.DiscoveryV5Bootnodes
    []string len: 0, cap: 0, []
    (dlv) print params.RinkebyV5Bootnodes
    []string len: 0, cap: 0, []
    (dlv) continue
    INFO [10-08|13:55:42] Starting pprof server                    addr=http://127.0.0.1:6060/debug/pprof
    DEBUG[10-08|13:55:42] Reloaded keystore contents               accounts=0
    TRACE[10-08|13:55:42] Started watching keystore folder         path=/home/niko/saved-niko-home/myeth/keystore
    DEBUG[10-08|13:55:42] Reloaded keystore contents               accounts=0
    WARN [10-08|13:55:42] No etherbase set and no accounts found as default 
    INFO [10-08|13:55:42] Starting peer-to-peer node               instance=Geth/v1.7.0-unstable-c8e70186/linux-amd64/go1.8.3
    INFO [10-08|13:55:42] Allocated cache and file handles         database=/home/niko/saved-niko-home/myeth/geth/chaindata cache=128 handles=1024
    INFO [10-08|13:55:42] Initialised chain configuration          config="{ChainID: 15 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: 0 EIP158: 0 Metropolis: <nil> Engine: unknown}"
    INFO [10-08|13:55:42] Disk storage enabled for ethash caches   dir=/home/niko/saved-niko-home/myeth/geth/ethash count=3
    INFO [10-08|13:55:42] Disk storage enabled for ethash DAGs     dir=/home/niko/.ethash                           count=2
    INFO [10-08|13:55:42] Initialising Ethereum protocol           versions="[63 62]" network=15
    INFO [10-08|13:55:42] Loaded most recent local header          number=0 hash=bb5c6e…aa9798 td=16384
    INFO [10-08|13:55:42] Loaded most recent local full block      number=0 hash=bb5c6e…aa9798 td=16384
    INFO [10-08|13:55:42] Loaded most recent local fast block      number=0 hash=bb5c6e…aa9798 td=16384
    DEBUG[10-08|13:55:42] Reinjecting stale transactions           count=0
    INFO [10-08|13:55:42] Loaded local transaction journal         transactions=0 dropped=0
    INFO [10-08|13:55:42] Regenerated local transaction journal    transactions=0 accounts=0
    DEBUG[10-08|13:55:42] Recalculated downloader QoS values       rtt=20s confidence=1.000 ttl=1m0s
    INFO [10-08|13:55:42] Starting P2P networking 
    INFO [10-08|13:55:44] Mapped network port                      proto=udp extport=40401 intport=40401 interface="UPNP IGDv1-PPP1"
    INFO [10-08|13:55:44] UDP listener up                          self=enode://d3ee3e39a3a8d3972941d3a30e2802103dfdbbe4394ac2e1e0f0fafbf8d14b80f5186a7dfae9291e54ddc1244469bee15ec2139c021cb225f618158dbea762a2@95.190.164.60:40401
    INFO [10-08|13:55:44] RLPx listener up                         self=enode://d3ee3e39a3a8d3972941d3a30e2802103dfdbbe4394ac2e1e0f0fafbf8d14b80f5186a7dfae9291e54ddc1244469bee15ec2139c021cb225f618158dbea762a2@95.190.164.60:40401
    DEBUG[10-08|13:55:44] InProc registered *node.PrivateAdminAPI under 'admin' 
    DEBUG[10-08|13:55:44] InProc registered *node.PublicAdminAPI under 'admin' 
    DEBUG[10-08|13:55:44] InProc registered *debug.HandlerT under 'debug' 
    DEBUG[10-08|13:55:44] InProc registered *node.PublicDebugAPI under 'debug' 
    DEBUG[10-08|13:55:44] InProc registered *node.PublicWeb3API under 'web3' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicEthereumAPI under 'eth' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicBlockChainAPI under 'eth' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicTransactionPoolAPI under 'eth' 
    TRACE[10-08|13:55:44] New dial task                            task="discovery lookup"
    TRACE[10-08|13:55:44] >> PONG/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:44] << PING/v4                               addr=34.227.225.109:30303              err=nil
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicTxPoolAPI under 'txpool' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicDebugAPI under 'debug' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PrivateDebugAPI under 'debug' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicAccountAPI under 'eth' 
    DEBUG[10-08|13:55:44] Executing EVM call finished              runtime=201.379µs
    DEBUG[10-08|13:55:44] Release oracle not found                 contract=0xFA7B9770Ca4cb04296Cac84F37736d4041251CDF
    TRACE[10-08|13:55:44] Starting bonding ping/pong               id=f985f943e36e4a91 known=false failcount=0 age=418734h55m44.711000756s
    TRACE[10-08|13:55:44] >> PONG/v4                               addr=95.102.134.151:30303              err=nil
    TRACE[10-08|13:55:44] << PING/v4                               addr=95.102.134.151:30303              err=nil
    TRACE[10-08|13:55:44] Starting bonding ping/pong               id=f89e6571e3be46ad known=false failcount=0 age=418734h55m44.711238975s
    TRACE[10-08|13:55:44] >> PING/v4                               addr=95.102.134.151:30303              err=nil
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PrivateAccountAPI under 'personal' 
    TRACE[10-08|13:55:44] >> PONG/v4                               addr=54.205.75.176:28568               err=nil
    TRACE[10-08|13:55:44] << PING/v4                               addr=54.205.75.176:28568               err=nil
    DEBUG[10-08|13:55:44] InProc registered *eth.PublicEthereumAPI under 'eth' 
    DEBUG[10-08|13:55:44] InProc registered *eth.PublicMinerAPI under 'eth' 
    TRACE[10-08|13:55:44] >> PING/v4                               addr=34.227.225.109:30303              err=nil
    DEBUG[10-08|13:55:44] InProc registered *downloader.PublicDownloaderAPI under 'eth' 
    DEBUG[10-08|13:55:44] InProc registered *eth.PrivateMinerAPI under 'miner' 
    DEBUG[10-08|13:55:44] InProc registered *filters.PublicFilterAPI under 'eth' 
    DEBUG[10-08|13:55:44] InProc registered *eth.PrivateAdminAPI under 'admin' 
    DEBUG[10-08|13:55:44] InProc registered *eth.PublicDebugAPI under 'debug' 
    TRACE[10-08|13:55:44] Starting bonding ping/pong               id=2f38b9679575ed73 known=false failcount=0 age=418734h55m44.711884164s
    DEBUG[10-08|13:55:44] InProc registered *eth.PrivateDebugAPI under 'debug' 
    DEBUG[10-08|13:55:44] InProc registered *ethapi.PublicNetAPI under 'net' 
    DEBUG[10-08|13:55:44] HTTP registered *node.PublicWeb3API under 'web3' 
    DEBUG[10-08|13:55:44] HTTP registered *ethapi.PublicEthereumAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *ethapi.PublicBlockChainAPI under 'eth' 
    TRACE[10-08|13:55:44] >> PING/v4                               addr=54.205.75.176:28568               err=nil
    DEBUG[10-08|13:55:44] HTTP registered *ethapi.PublicTransactionPoolAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *ethapi.PublicAccountAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *eth.PublicEthereumAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *eth.PublicMinerAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *downloader.PublicDownloaderAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *filters.PublicFilterAPI under 'eth' 
    DEBUG[10-08|13:55:44] HTTP registered *ethapi.PublicNetAPI under 'net' 
    INFO [10-08|13:55:44] HTTP endpoint opened: http://127.0.0.1:9101 
    TRACE[10-08|13:55:44] Found seed node in database              id=ecaed3212da6c3ea addr=109.177.181.199:57955             age=1m21.713152422s
    TRACE[10-08|13:55:44] >> FINDNODE/v4                           addr=109.177.181.199:57955             err=nil
    INFO [10-08|13:55:44] Mapped network port                      proto=tcp extport=40401 intport=40401 interface="UPNP IGDv1-PPP1"
    TRACE[10-08|13:55:44] << PONG/v4                               addr=95.102.134.151:30303              err=nil
    TRACE[10-08|13:55:44] >> PONG/v4                               addr=95.102.134.151:30303              err=nil
    TRACE[10-08|13:55:44] << PING/v4                               addr=95.102.134.151:30303              err=nil
    TRACE[10-08|13:55:44] << PONG/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:44] >> PONG/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:44] << PING/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:44] << NEIGHBORS/v4                          addr=109.177.181.199:57955             err=nil
    TRACE[10-08|13:55:45] Bumping findnode failure counter         id=ecaed3212da6c3ea failcount=1
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=5eb5f9aceaa65c4d known=false failcount=0 age=418734h55m45.21378013s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=60d63fc569fe0765 known=false failcount=0 age=418734h55m45.213899266s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=be1e3c2aafbc719f known=false failcount=0 age=418734h55m45.21413248s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=58f67621c1ccb8fc known=false failcount=0 age=418734h55m45.214215546s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=0a6c1e23d6e6790b known=false failcount=0 age=418734h55m45.21430845s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=322e6e4a96633636 known=false failcount=0 age=418734h55m45.214439609s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=2ce590fbf8fe36b5 known=false failcount=0 age=418734h55m45.213862211s
    TRACE[10-08|13:55:45] >> PING/v4                               addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=8dcbf3a082549d57 known=false failcount=0 age=418734h55m45.213932793s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=ba64dd01810cb970 known=false failcount=0 age=418734h55m45.214412257s
    TRACE[10-08|13:55:45] >> PING/v4                               addr=147.135.171.122:30303             err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=40.76.55.204:30401                err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=52.175.236.211:30303              err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=178.79.168.48:30303               err=nil
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=19e43923fc27f895 known=false failcount=0 age=418734h55m45.213823085s
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=2d618c42e49ba7c7 known=false failcount=0 age=418734h55m45.213792296s
    TRACE[10-08|13:55:45] >> PING/v4                               addr=35.188.76.87:30303                err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=194.67.208.71:30303               err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=45.55.14.91:30303                 err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=18.220.49.202:30303               err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=88.99.214.243:30303               err=nil
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=1284dd57ef06704b known=false failcount=0 age=418734h55m45.217496281s
    TRACE[10-08|13:55:45] >> PING/v4                               addr=34.249.139.253:30303              err=nil
    TRACE[10-08|13:55:45] >> PING/v4                               addr=51.255.82.156:30303               err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=194.67.208.71:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=194.67.208.71:30303               err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=194.67.208.71:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=34.227.225.109:30303              err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=88.99.214.243:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=88.99.214.243:30303               err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=88.99.214.243:30303               err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=147.135.171.122:30303             err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=178.79.168.48:30303               err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=51.255.82.156:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=51.255.82.156:30303               err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=51.255.82.156:30303               err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=34.249.139.253:30303              err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=34.249.139.253:30303              err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=34.249.139.253:30303              err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=40.76.55.204:30401                err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=40.76.55.204:30401                err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=40.76.55.204:30401                err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=18.220.49.202:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=18.220.49.202:30303               err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=18.220.49.202:30303               err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=35.188.76.87:30303                err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=35.188.76.87:30303                err=nil
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=2ce590fbf8fe36b5 known=false failcount=0 age=418734h55m45.432697862s
    TRACE[10-08|13:55:45] << PONG/v4                               addr=35.188.76.87:30303                err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=52.175.236.211:30303              err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=52.175.236.211:30303              err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=52.175.236.211:30303              err=nil
    TRACE[10-08|13:55:45] << PONG/v4                               addr=45.55.14.91:30303                 err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=45.55.14.91:30303                 err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=45.55.14.91:30303                 err=nil
    TRACE[10-08|13:55:45] >> FINDNODE/v4                           addr=52.175.236.211:30303              err=nil
    TRACE[10-08|13:55:45] >> FINDNODE/v4                           addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:45] >> FINDNODE/v4                           addr=35.188.76.87:30303                err=nil
    TRACE[10-08|13:55:45] >> PONG/v4                               addr=54.205.75.176:28568               err=nil
    TRACE[10-08|13:55:45] << PING/v4                               addr=54.205.75.176:28568               err=nil
    TRACE[10-08|13:55:45] Starting bonding ping/pong               id=2f38b9679575ed73 known=false failcount=0 age=418734h55m45.945558254s
    TRACE[10-08|13:55:45] >> PING/v4                               addr=54.205.75.176:28568               err=nil
    TRACE[10-08|13:55:46] << NEIGHBORS/v4                          addr=83.169.4.63:30303                 err=nil
    TRACE[10-08|13:55:46] << NEIGHBORS/v4                          addr=83.169.4.63:30303                 err=nil

As you can see, even without bootnodes, geth is trying to discover. Now the question is, I am not understanding something in the protocol or are there some undocumented features in geth in the sources? Because, if there are no bootnodes , it shouldn't be able to find anything, right? Or does it starts to scan the internet randomly expecting to find some Ethereum node?

3

Geth by default will try to discover new nodes, if you want to prevent that you can pass the --nodiscover flag to prevent that.

There are other flags --maxpeers 0 to disable networking and --nat none to prevent your node from communicating outside of your network.

  • I know about nodiscover flag, but with bootnodes disabled the algorithm for discovery shouldn't work. This is what I am not understanding, how does it run discovery algorithm without bootnodes. – Nulik Oct 8 '17 at 23:39
  • I'd look into p2p/server.go, my guess is it that either geth has a database with previous session nodes, or an external node has your ip, and it is trying to communicate using the p2p protocol. – Ismael Oct 9 '17 at 3:13
  • I just moved into a hotel right now (so my ip address is different), removed all in the datadir, started geth process and my tcpdump console goes like crazy with requests to 30303. I don't know what it does but the traffic looks pretty heavy. My bet is that it is scanning the whole internet. – Nulik Oct 9 '17 at 11:41
1

I've had the same issue. It appears that --nodiscover is just disabling your node from running node-discovering algorithm to find peers to connect, but it doesn't prevent others from discovering and attempting to connect to your node. If you'd like to limit the inbound connection attempts, you could specify --netrestrict. e.g. --netrestrict="127.0.0.1/8"

0

iptables can help, but need to be enabled on all nodes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.