Local testing

Technical discussions related to CryptoNote repository and the forking process

Local testing

Postby chris » Thu Dec 31, 2015 1:54 am

I've customised and built a client successfully. I also managed to run a daemon, run simplewallet and mine some blocks.

I'm now trying to get multiple nodes communicating locally on a single machine.

I set up 2 data-dir folders - seed1 and seed2 - and executed the following commands in separate terminal sessions after successfully mining in the seed2 data dir:

from seed1 folder: ../../cryptonote/build/release/src/mycoind --log-level=4 --data-dir=./ --p2p-bind-port=17902 --rpc-bind-port=18902 --seed-node=10.1.1.3:17902 --seed-node=10.1.1.3:17903

from seed2 folder: ../../cryptonote/build/release/src/mycoind --log-level=4 --data-dir=./ --p2p-bind-port=17903 --rpc-bind-port=18903 --seed-node=10.1.1.3:17902 --seed-node=10.1.1.3:17903

In the following output from the seed1 node, the seed2 blocks (height 6) are discovered but the sync does not complete and this repeats indefinitely (observed height reverts to 1). Any idea what I can do to get the 2 seeds to sync successfully? In the code I have commented out the seed node ip's - so these are only supplied at the command line.

---
11:30:12.598854 DEBUG [10.1.1.3:17902 OUT] CONNECTION HANDSHAKED OK AND CLOSED.
11:30:12.598966 DEBUG [10.1.1.3:56604 INC] Interrupt connection
11:30:12.599029 DEBUG [10.1.1.3:56604 INC] writeHandler finished
11:30:12.599078 TRACE [10.1.1.3:56604 INC] CLOSE CONNECTION
11:30:14.030230 TRACE [10.1.1.3:56605 INC] NEW CONNECTION
11:30:14.030341 DEBUG [10.1.1.3:56605 INC] writeHandler started
11:30:14.036518 INFO [10.1.1.3:56605 INC] Sync data returned unknown top block: 0 -> 6 [6 blocks (0 days) behind]
11:30:14.036518 INFO SYNCHRONIZATION started
11:30:14.036662 DEBUG Remote top block height: 6, id: <d9217d282a18a9ffb650e01157a64ed85c7fdf878d45fe5eea98c9deaea8b0e2>
11:30:14.036726 TRACE [10.1.1.3:56605 INC] requesting synchronization
11:30:14.036781 TRACE Observed height updated: 6
11:30:14.036833 DEBUG COMMAND_HANDSHAKE
11:30:14.036894 TRACE [10.1.1.3:56605 INC] Starting synchronization
11:30:14.036951 TRACE [10.1.1.3:56605 INC] -->>NOTIFY_REQUEST_CHAIN: m_block_ids.size()=1
11:30:14.037022 DEBUG [10.1.1.3:56605 INC] msg 1:1001
11:30:14.037095 DEBUG [10.1.1.3:56605 INC] msg 2:2006
11:30:14.037509 DEBUG [10.1.1.3:56605 INC] Interrupt connection
11:30:14.037650 DEBUG [10.1.1.3:56605 INC] writeHandler finished
11:30:14.037725 TRACE [10.1.1.3:56605 INC] CLOSE CONNECTION
11:30:14.037781 TRACE Observed height updated: 1
11:30:14.600591 DEBUG Connecting to 10.1.1.3:17902 (white=1, last_seen: never)...
11:30:14.613576 TRACE [10.1.1.3:56606 INC] NEW CONNECTION
11:30:14.613694 DEBUG COMMAND_HANDSHAKE
11:30:14.613760 DEBUG [10.1.1.3:56606 INC] writeHandler started
11:30:14.613810 DEBUG [10.1.1.3:56606 INC] msg 1:1001
---
chris
 
Posts: 4
Joined: Thu Dec 31, 2015 1:37 am

Re: Local testing

Postby *tech_star* » Sat Jan 02, 2016 9:22 pm

1. Both of your daemons use the same data directory, this is wrong, so you better use for the first --data-dir=./data1, and for the second --data-dir=./data2
2. Don't use your address for seed node. Delete paremeters --seed-node=10.1.1.3:17902 from the first, and --seed-node=10.1.1.3:17903 from the second.
3. Also you could delete parameter --seed-node=10.1.1.3:17902 from the second daemon.

So it supposed to look like this:
../../cryptonote/build/release/src/mycoind --log-level=4 --data-dir=./data1 --p2p-bind-port=17902 --rpc-bind-port=18902 --seed-node=10.1.1.3:17903

../../cryptonote/build/release/src/mycoind --log-level=4 --data-dir=./data2 --p2p-bind-port=17903 --rpc-bind-port=18903
*tech_star*
 
Posts: 35
Joined: Fri Mar 28, 2014 9:51 am

Re: Local testing

Postby chris » Sun Jan 03, 2016 4:31 am

I was invoking the daemon from different folders (seed1 and seed2) hence --data-dir=./ in both cases.

I tried the suggested changes but now the first daemon doesn't even discover the additional blocks that were mined in the second. It just repeats the following output:

14:23:35.898997 DEBUG Connecting to 127.0.0.1:17903 (white=1, last_seen: never)...
14:23:35.912081 TRACE [127.0.0.1:17903 OUT] REMOTE PEERLIST: TIME_DELTA: 0, remote peerlist size=0
14:23:35.912163 TRACE [127.0.0.1:17903 OUT] REMOTE PEERLIST:
14:23:35.912230 DEBUG [127.0.0.1:17903 OUT] CONNECTION HANDSHAKED OK AND CLOSED.
14:23:37.915637 DEBUG Connecting to 127.0.0.1:17903 (white=1, last_seen: never)...
14:23:37.925473 TRACE [127.0.0.1:17903 OUT] REMOTE PEERLIST: TIME_DELTA: 0, remote peerlist size=0
14:23:37.925550 TRACE [127.0.0.1:17903 OUT] REMOTE PEERLIST:
14:23:37.925611 DEBUG [127.0.0.1:17903 OUT] CONNECTION HANDSHAKED OK AND CLOSED.

If you have the time, perhaps you could suggest a sequence of steps starting with empty data dirs to run 2 daemons for the first time, mine in one of them and have the new blocks recognised by the other node.

Thanks for your help.
chris
 
Posts: 4
Joined: Thu Dec 31, 2015 1:37 am

Re: Local testing

Postby chris » Sun Jan 03, 2016 4:33 am

BTW, the repeating output from the node on which blocks were mined is:

14:23:33.894465 DEBUG COMMAND_HANDSHAKE
14:23:33.894552 DEBUG [127.0.0.1:64762 INC] msg 1:1001
14:23:33.894617 DEBUG [127.0.0.1:64762 INC] msg 2:2008
14:23:33.894916 DEBUG [127.0.0.1:64762 INC] Interrupt connection
14:23:33.894986 DEBUG [127.0.0.1:64762 INC] writeHandler finished
14:23:33.895037 TRACE [127.0.0.1:64762 INC] CLOSE CONNECTION
14:23:35.906106 TRACE [127.0.0.1:64763 INC] NEW CONNECTION
14:23:35.906205 DEBUG [127.0.0.1:64763 INC] writeHandler started
14:23:35.911878 DEBUG COMMAND_HANDSHAKE
14:23:35.911967 DEBUG [127.0.0.1:64763 INC] msg 1:1001
14:23:35.912035 DEBUG [127.0.0.1:64763 INC] msg 2:2008
14:23:35.912322 DEBUG [127.0.0.1:64763 INC] Interrupt connection
14:23:35.912395 DEBUG [127.0.0.1:64763 INC] writeHandler finished
14:23:35.912447 TRACE [127.0.0.1:64763 INC] CLOSE CONNECTION
14:23:37.925115 TRACE [127.0.0.1:64764 INC] NEW CONNECTION
chris
 
Posts: 4
Joined: Thu Dec 31, 2015 1:37 am

Re: Local testing

Postby *tech_star* » Thu Jan 07, 2016 10:13 pm

Sorry for the delay, long holidays :D
So, I got your problem(probably). You set the address of the other daemon via --seed-node parameter, so this address is the seed's address.
When daemon connects to the seed, it requests the peer list and disconnects before synchronizing.
So if you want a connection between daemons and synchronization process, you have to use --add-priority-node or --add-exclusive-node parameter.
So you better try:
../../cryptonote/build/release/src/mycoind --log-level=4 --data-dir=./data1 --p2p-bind-port=17902 --rpc-bind-port=18902 --add-exclusive-node=10.1.1.3:17903
Hope it helps.
*tech_star*
 
Posts: 35
Joined: Fri Mar 28, 2014 9:51 am

Re: Local testing

Postby chris » Fri Jan 08, 2016 5:31 am

That worked! Thanks a lot for your help, much appreciated.
chris
 
Posts: 4
Joined: Thu Dec 31, 2015 1:37 am


Return to Reference Code & Forking

Who is online

Users browsing this forum: No registered users and 1 guest

cron