Suggestion: Number of assets per node - Part 2

+1 vote
Hi,

After I have received your answer on my previous question "Suggestion: Number of assets per node", I have tryed to follow your instructions.
I ran getinfo on the first and the last node in my blockchain and after getting the value of the "blocks",
I used that value as "height" in getblockhash call.
I have received completely differen hash values between nodes.
I also got the number of assets on all of my nodes, 8 of them and all of them have same number of assets 25844.
In your previous response you said "...Once the blockchain is synchronized and up-to-date, the number of assets will be synchronized as well. So just use getinfo and look at the blocks value, then you can use getblockhash with the latest height on both nodes to verify they're identical."
So, if I understand you correctly, since all my nodes have the same number of assets it means that the blockchain is synchronized and up-to-date. And I assumed that the hash values returned by getblockhash wouold also be identical, but they are not.
What am I missing here...?
related to an answer for: Suggestion: Number of assets per node
asked Feb 29, 2016 by nprnic
Are all the nodes connected to each other, if you run getpeerinfo?
On two servers this is the node layout:
server1: node1 - node4
server2: node5 - node8
The way they are connected is as follows:
on server1 node3 is connected to node2 which is connected to node1
on server2 node8 is connected to node5 which is connected to node4 (on server1) which is connected to node6 which is connected to node5 which is connected to node3 (on server1).
node8 is solely connected to node5
getpeerinfo on node1 shows only that node
getpeerinfo on node2 shows node1 and node2
getpeerinfo on node3 shows only node2
getpeerinfo on node4 shows only node6
getpeerinfo on node5 shows itself - node5 twice
getpeerinfo on node6 shows node5 and node6
getpeerinfo on node7 shows only node4
getpeerinfo on node8 shows only node5

1 Answer

0 votes
Based on your comment, I think the problem is that you have two separate disconnected blockchains.

You need to create a single node (it doesn't matter on which server), then connect a second node to that first or second one, and to keep connecting new nodes to one of the nodes which is already on the network, rather than creating a new chain.

If you did this right, the nodes may have got disconnected from each other, because of some problem communicating between the nodes that are sitting on the same server. Let me know and I'll send instructions on which logs we'll need in order to understand why the peer-to-peer connections were broken.
answered Mar 2, 2016 by MultiChain
I guess I should have mentioned that all of these nodes belong to the SAME blockchain "nchain1", there are no two blockchains just one.
The chains may have the same name, but they do not appear to be connected together, so for all purposes they are two separate blockchains. This conclusion is based on the output you reported from getpeerinfo, which shows two distinct islands of connectivity.
Ok, I am not sure there are 2 chains with the same name, but anyway I will remove all the nodes and blockchains from both servers and recreate them from scratch. Any particular way to remove blockchians and the nodes to be sure the environment is clean for new installation (removing directories, killing processes...)
Stop each node using:

multichain-cli [chain-name] stop

Then remove the directory using:

rm -fr ~/.multichain/[chain-name]

Then you'll be starting from a clean slate.
Thanks, will let you know what getpeerinfo returns once I am done...
Please, let me know if this is the right way to create and connect blockchian nodes:

On blockchain1 server (192.168.1.81) - creating 2 nodes: node1 and node2

--- Create an initial node directory, e.g. node1:
[nprnic@blockchain1 ~]$ mkdir /home/nprnic/node1

--- Create new blockchain nchain1 in newly created directory using “–datadir” parametar:
[nprnic@blockchain1 ~]$ multichain-util create nchain1 -datadir=/home/nprnic/node1 -rpcport=8360 -port=8361
MultiChain utilities build 1.0 alpha 15 protocol 10003

Blockchain parameter set was successfully generated.
You can edit it in /home/nprnic/node1/nchain1/params.dat before running multichaind for the first time.

To generate blockchain please run "multichaind nchain1".

--- Start nchain1 blockchain in node1:
[nprnic@blockchain1 ~]$ multichaind nchain1 -datadir=/home/nprnic/node1 -rpcport=8360 -port=8361 -daemon

MultiChain Core Daemon build 1.0 alpha 15 protocol 10003

Multichain server starting
[nprnic@blockchain1 ~]$ Looking for genesis block...
Genesis block found
New users can connect to this node using
multichaindnchain1@192.168.1.81:8361

Node started

--- Create second node directory, e.g. node2:
[nprnic@blockchain1 ~]$ mkdir /home/nprnic/node2

--- Connect to the nchain1 blockchain that was created in node1 using its addrerss:
[nprnic@blockchain1 ~]$ multichaind nchain1@192.168.1.81:8361 -datadir=/home/nprnic/node2 -rpcport=8362 -port=8363

MultiChain Core Daemon build 1.0 alpha 15 protocol 10003

Retrieving blockchain parameters from the seed node 192.168.1.81:8361 ...
Blockchain successfully initialized.

Please ask blockchain admin or user having activate permission to let you connect and/or transact:
multichain-cli nchain1 grant 1HLb4PYLv4cvdAdkK7CQkE8H1vrXrx8MF9m4Vg connect
multichain-cli nchain1 grant 1HLb4PYLv4cvdAdkK7CQkE8H1vrXrx8MF9m4Vg connect,send,receive

--- We tell nchain1 in node1 to grant node2 several permissions, based on node2’s address:
[nprnic@blockchain1 ~]$ multichain-cli nchain1 -datadir=/home/nprnic/node1 -rpcport=8360 -port=8361 grant 1HLb4PYLv4cvdAdkK7CQkE8H1vrXrx8MF9m4Vg connect,send,receive
{"method":"grant","params":["1HLb4PYLv4cvdAdkK7CQkE8H1vrXrx8MF9m4Vg","connect,send,receive"],"id":1,"chain_name":"nchain1"}

d03ab345a720f0eb8f25c491af56a17948bb75a08ae8b2770b64479ebbd63eb8

--- Start nchain1 blockchain on node2
[nprnic@blockchain1 ~]$ multichaind nchain1 -datadir=/home/nprnic/node2 -rpcport=8362 -port=8363 -daemon

MultiChain Core Daemon build 1.0 alpha 15 protocol 10003

Multichain server starting
[nprnic@blockchain1 ~]$ Retrieving blockchain parameters from the seed node 192.168.1.81:8361 ...
New users can connect to this node using
multichaindnchain1@192.168.1.81:8363

Node started

[nprnic@blockchain1 ~]$

On blockchain2 server (192.168.1.82) - creating one node5 connecting to node2 from blockchain1

--- We create a new node “node5” on blockchain2 server
[nprnic@blockchain2 ~]$ mkdir /home/nprnic/node5

--- Connect to the nchain1 blockchain using node2 address:
[nprnic@blockchain2 ~]$ multichaind nchain1@192.168.1.81:8363 -datadir=/home/nprnic/node5 -rpcport=8366–port=8367
MultiChain Core Daemon build 1.0 alpha 15 protocol 10003

Retrieving blockchain parameters from the seed node 192.168.1.81:8365 ...
Blockchain successfully initialized.

Please ask blockchain admin or user having activate permission to let you connect and/or transact:
multichain-cli nchain1 grant 1MHiTV86HTTfamr4jyoQ2HSqjdjGpyu5uvJMTX connect
multichain-cli nchain1 grant 1MHiTV86HTTfamr4jyoQ2HSqjdjGpyu5uvJMTXconnect,send,receive

[nprnic@blockchain2 ~]$

Going back to blockchain1 server:

--- Ask nchain1 blockchain on node1 (initial node in this blockchian) to give several permissions to node5, based on its address:
[nprnic@blockchain1 ~]$ multichain-cli nchain1 -datadir=/home/nprnic/node1 -rpcport=8360 -port=8361 grant 1MHiTV86HTTfamr4jyoQ2HSqjdjGpyu5uvJMTX connect,send,receive
{"method":"grant","params":["1MHiTV86HTTfamr4jyoQ2HSqjdjGpyu5uvJMTX","connect,send,receive"],"id":1,"chain_name":"nchain1"}

04efce52a80d92690ca7f9a94173033057f65bacbdf1efb2944dd2438950b08a
[nprnic@blockchain1 ~]$

Back on blockchain2 server,

--- Start the nchain1 blockchain on node5:
[nprnic@blockchain2 ~]$ multichaind nchain1 -datadir=/home/nprnic/node5 -rpcport=8366 -port=8367 -daemon

MultiChain Core Daemon build 1.0 alpha 15 protocol 10003

Multichain server starting
[nprnic@blockchain2 ~]$ Retrieving blockchain parameters from the seed node 192.168.1.81:8363 ...
New users can connect to this node using
multichaind nchain1@192.168.1.82:8367

Node started

[nprnic@blockchain2 ~]$
That looks right to me. Always connect a new node to one of the existing nodes.

If this is not creating a fully connected network, it could be an issue with MultiChain being used in this unusual configuration. If you could zip up the debug.log files from each node's blockchain directory, and send them to us, we can take a look to see what might be causing the connection problems.
Where do i attach log files, I do not see any way to attach it to this comment.
To which address should I send the logs so.
I've emailed you the address - sorry - I had thought we'd already corresponded by email.
...