1

I have a simplified version of a private network I need to build. This is done with parity v1.6.8

There is one mining node that is used as a bootstrap node, let's call it B. Then first not-mining node N1 joins the network by connecting to B via bootnodes parameter. I see that blocks are imported and that each one of them have 1 peer now. That is as expected.

Now add another not-mining node N2, it also connects to B. B now has 2 peers, however N1 and N2 still only have 1 peer each. If I stop B, N1 and N2 will lose connection and have 0 peers. This seems to be incorrect. I can use json-rpc and manually call addReservedPeer to add N2 to N1 and it works - each node has 2 peers now.

If later a third node N3 joins the network it again gets only 1 peer, B has 2+1=3 peers, N1 and N2 still have 2 peers each. Now if I add N2 to N3 via rpc call, they will connect to each other, however N1 still won't be connected to N3, although N2 and N1 were explicitly connected on the previous step.

Each node is run from docker container on Azure VM. Ports are forwarded by docker run -p. I specify the actual public IP address of a node in network.nat.

Here is config.toml from B:

[parity]
chain = "spec.json"
base_path = "parity"
[network]
nat="extip:<B-public-IP>"
port = 30300
discovery=true
[rpc]
cors = "all"
interface = "0.0.0.0"
hosts = ["all"]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[account]
password = ["node.pwd"]
[mining]
force_sealing = true
engine_signer = "0xabcdef..."
reseal_on_txs = "none"

N1, N2, N3 share the same config.toml except for public IP in network.nat

[parity]
chain = "spec.json"
base_path = "parity"
[network]
nat="extip:<N-public-ip>"
bootnodes=["enode://012345...@<B-public-ip>:30300"]
port = 30300
discovery=true
[rpc]
cors = "all"
interface = "all"
hosts = ["all"]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]

seems like I've enabled everything...

Since I can remotely call rpc, say from N1 and add peer to N2 it seems like all necessary ports are open and accessible, although if I call netPeers to get a list of peers of a node, they are returned with both public and private ips:

{
    "jsonrpc": "2.0",
    "result": {
        "active": 0,
        "connected": 1,
        "max": 25,
        "peers": [{
            "caps": ["eth/62", "eth/63", "par/1", "par/2"],
            "id": "<enode id here>",
            "name": "Parity/v1.6.8-beta-c396229-20170608/x86_64-linux-gnu/rustc1.18.0",
            "network": {
                "localAddress": "172.17.0.2:40286",
                "remoteAddress": "<public IP>:30300"
            },
            "protocols": {
                "eth": {
                    "difficulty": null,
                    "head": "81054935d40ed7ffd94a7f4915f52c96fe0ebfe42ee715df0fa0decb76d70c45",
                    "version": 2
                },
                "les": null
            }
        }]
    },
    "id": 1
}

Please advise, am I missing something in config files or how can I double check network configuration?

1

Should have also forwarded udp port 30300: docker run -p 30300:30300 -p 30300:30300/udp ...

  • Are you answering your own question? Or do you mean to Edit your question? – eth Jun 25 '17 at 21:49
  • i'm answering my own question. I can't accept it in 22 hours... – xaxa Jun 25 '17 at 22:43

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.