ton-blockchain / ton

Main TON monorepo
Other
2.91k stars 858 forks source link

How to use adnl-pong tool #282

Open fcloser opened 4 years ago

fcloser commented 4 years ago

After compiling all the files from the source, I began to deal with all this. I came across an interesting adnl-pong file for me. As I understand it, this tool allows you to check the connection with a specific host on the network, its adnl address means. Did I understand the essence of this file correctly? How can I use it? if possible with examples. What key is he trying to accept through the -k parameter? I tried to give him all the key options in hex and base64 format that were generated by the generate-random-id utility.

adnl/adnl-pong -k 17236849ce4c1ba61d1bc445d08f8a951824318512289e295f15a9fba510744182d6043a

Unexpected Status [Error : 621 : unknown magic 858928945] in file /usr/src/ton/adnl/adnl-pong.cpp at line 148

I ask you for help in explaining for understanding :)

fcloser commented 4 years ago

Empirically, we found out that this utility accepts a private key, and based on this key generates an ADNL address.

./adnl-pong -k "7Q襀0123456789012345678901234567891" -a <my-publick-up>:<port> -v 5

[ 4][t 2][1586954741.332991600][adnl-peer-table.cpp:203][!PeerTable][&ADNL_INFO]        adnl: adding local id qfSIwDE06EudTKqjnuhx3J8nOvwQIAofA4QoxDevnMY=
[ 4][t 2][1586954741.333080053][adnl-local-id.cpp:193][!PeerTable][&ADNL_INFO]  [localid qfSIwDE06EudTKqjnuhx3J8nOvwQIAofA4QoxDevnMY=]: created local id qfSIwDE06EudTKqjnuhx3J8nOvwQIAofA4QoxDevnMY=
[ 4][t 2][1586954741.333127260][adnl-local-id.cpp:123][!localid][&ADNL_NOTICE]  [localid qfSIwDE06EudTKqjnuhx3J8nOvwQIAofA4QoxDevnMY=]: skipping public addr list, because localid (or dht node) not fully initialized
[ 4][t 2][1586954818.746995449][adnl-local-id.cpp:123][!localid][&ADNL_NOTICE]  [localid qfSIwDE06EudTKqjnuhx3J8nOvwQIAofA4QoxDevnMY=]: skipping public addr list, because localid (or dht node) not fully initialized

Did we understand correctly that:

  1. This utility is not self-sufficient? (Other components are needed for this utility to work)
  2. Does this utility only respond to "ping" requests from another adnl-test-ping utility?
  3. Did we run this utility correctly?
awesome-doge commented 2 years ago

Merge issues https://github.com/ton-blockchain/ton/issues/271