Unable To Connect First Node After Restarting Chain

0 votes

I initially created a Blockchain on one terminal (seed node) and connected another node to it on the same server in another terminal window (using Ubuntu). Everything seemed to work just fine. I stopped and closed each node using the following command:

>sudo multichain-cli [chain-name] stop

I restarted the seed node, old node and connected another (new) node to it. I was able to see the list of peers connected to each other using the getpeerinfo command in the interactive console for the seed node and the new node I created. 

This was the result in the new node terminal:

TestChain: getpeerinfo
{"method":"getpeerinfo","params":[],"id":1,"chain_name":"TestChain"}

[
    {
        "id" : 3,
        "addr" : "196.42.85.144:38782",
        "addrlocal" : "172.17.0.1:10120",
        "services" : "0000000000000001",
        "lastsend" : 1522756542,
        "lastrecv" : 1522756542,
        "bytessent" : 31078,
        "bytesrecv" : 34426,
        "conntime" : 1522753298,
        "pingtime" : 0.02890800,
        "version" : 70002,
        "subver" : "/MultiChain:0.1.0.10/",
        "handshakelocal" : "197HTjFcMBvVMhcr5438PirwDrsA8QvNwMWL8n",
        "handshake" : "1NH8Z36CMtmsi6M4H9adJNLQbfuwdd3Y8rB8Hw",
        "inbound" : true,
        "startingheight" : 77,
        "banscore" : 0,
        "synced_headers" : 84,
        "synced_blocks" : 84,
        "inflight" : [
        ],
        "whitelisted" : false
    },
    {
        "id" : 4,
        "addr" : "196.42.85.144:39066",
        "addrlocal" : "196.42.85.144:10120",
        "services" : "0000000000000001",
        "lastsend" : 1522756542,
        "lastrecv" : 1522756542,
        "bytessent" : 28523,
        "bytesrecv" : 24282,
        "conntime" : 1522753302,
        "pingtime" : 0.02883600,
        "version" : 70002,
        "subver" : "/MultiChain:0.1.0.10/",
        "handshakelocal" : "197HTjFcMBvVMhcr5438PirwDrsA8QvNwMWL8n",
        "handshake" : "1NH8Z36CMtmsi6M4H9adJNLQbfuwdd3Y8rB8Hw",
        "inbound" : true,
        "startingheight" : 77,
        "banscore" : 0,
        "synced_headers" : 84,
        "synced_blocks" : 84,
        "inflight" : [
        ],
        "whitelisted" : false
    }
]

And this was the result in the seed node terminal:

TestChain: getpeerinfo
{"method":"getpeerinfo","params":[],"id":1,"chain_name":"TestChain"}

[
    {
        "id" : 4,
        "addr" : "172.17.0.1:10120",
        "addrlocal" : "196.42.85.144:38782",
        "services" : "0000000000000001",
        "lastsend" : 1522756532,
        "lastrecv" : 1522756532,
        "bytessent" : 34362,
        "bytesrecv" : 31014,
        "conntime" : 1522753298,
        "pingtime" : 0.07478500,
        "version" : 70002,
        "subver" : "/MultiChain:0.1.0.10/",
        "handshakelocal" : "1NH8Z36CMtmsi6M4H9adJNLQbfuwdd3Y8rB8Hw",
        "handshake" : "197HTjFcMBvVMhcr5438PirwDrsA8QvNwMWL8n",
        "inbound" : false,
        "startingheight" : 10,
        "banscore" : 0,
        "synced_headers" : 77,
        "synced_blocks" : -1,
        "inflight" : [
        ],
        "whitelisted" : false
    },
    {
        "id" : 5,
        "addr" : "196.42.85.144:10120",
        "addrlocal" : "196.42.85.144:39066",
        "services" : "0000000000000001",
        "lastsend" : 1522756532,
        "lastrecv" : 1522756532,
        "bytessent" : 24218,
        "bytesrecv" : 28459,
        "conntime" : 1522753302,
        "pingtime" : 0.07474200,
        "version" : 70002,
        "subver" : "/MultiChain:0.1.0.10/",
        "handshakelocal" : "1NH8Z36CMtmsi6M4H9adJNLQbfuwdd3Y8rB8Hw",
        "handshake" : "197HTjFcMBvVMhcr5438PirwDrsA8QvNwMWL8n",
        "inbound" : false,
        "startingheight" : 20,
        "banscore" : 0,
        "synced_headers" : 74,
        "synced_blocks" : -1,
        "inflight" : [
        ],
        "whitelisted" : false
    }
]

However, the old node I created previously didn't seem to be able to connect. There was no information output for the getpeerinfo command. This was the result for the old node terminal:

TestChain: getpeerinfo
{"method":"getpeerinfo","params":[],"id":1,"chain_name":"UCTEnergyChain"}

[
]

I did notice that the seed node address had changed after restarting it. When I created the seed node the address was TestChain@196.42.87.128:6825 and when I restarted the the Blockchain the seed node's address had changed to TestChain@196.42.85.144:6825, which is what I used when connecting the new node. But the old node had been initialized using the previous seed address. Could that be the reason? If so, how can I fix it and prevent it from happening again?

asked Apr 3, 2018 by JGDNIR001
Are you using a static or dynamic ip? that could be an issue on your host machine/local host.

1 Answer

+1 vote
Could you please check if your network settings are static or dynamic, I suspect that they are dynamic, You could type on the linux termial:

 nano /etc/network/interfaces

 to see. Perhaps you can set a static IP. If that is not the issue then it could be something else.
answered Apr 3, 2018 by makoya
@makoya I wasn't able to check the network settings but I restarted all the nodes and everything self-corrected. I'm not sure what happened before but I haven't experienced the same thing since. Weird. Thanks though.
...