0

I have a running EOS blockchain with a connected peer (running) created by following the documentation tutorial https://developers.eos.io/welcome/latest/tutorials/bios-boot-sequence. So, my config file is not on the default path. The respective files are stored on the path /home/user/biosboot/genesis. Now to get the Peers information using the reference of NET API Plugin, I am calling the API https://developers.eos.io/manuals/eos/latest/nodeos/plugins/net_api_plugin/api-reference/index#operation/connections at my endpoint. It returns the list of peers connected but not with accurate values. For example:

Genesis node

cleos --url http://genesisip:8889 get info

returns head_block_num as 10385207

Connected Peer

cleos --url http://connectedip:8889 get info

returns head_block_num as 10385207

Now On POSTMAN, I call POST http://genesisip:8889/v1/net/connections it returns (*** are edited by me),

[
    {
        "peer": "",
        "connecting": false,
        "syncing": false,
        "last_handshake": {
            "network_version": 1207,
            "chain_id": "***",
            "node_id": "***",
            "key": "***",
            "time": "1612778978797327000",
            "token": "0000000000000000000000000000000000000000000000000000000000000000",
            "sig": "***",
            "p2p_address": "connectedip:8888 - 540c0e9",
            "last_irreversible_block_num": 1445747,
            "last_irreversible_block_id": "***",
            "head_num": 1445748,
            "head_id": "***",
            "os": "linux",
            "agent": "\"EOS Test Agent\"",
            "generation": 3
        }
    }
]

All information of connected peer is completely different.chain_id is the same, head_num should be in the range of 10385207. why peer is empty? Why connecting and syncing are false? Do I need to pass any parameters related to the file's path? Please help.

1

2 Answers 2

0

if you hit that url with postman several times does the block numbers (e.g. LIB, head_number) are increasing? or you always get the same numbers?

if you always get the same numbers it means it is not syncing as the "connecting" and "syncing" values set as "false" are saying.

when you start the nodeos are there any errors printed in the console that can give clues? when you start nodeos do you start it with the net_api plugin and net plugin as well?

I saw the comment pointing to a telegram channel broken link, the EOSIO Developers telegram channel correct link is: https://t.me/joinchat/0uhWYfXVpPlkNTA1

4
  • 1.No the block number is not increasing. 2. net_api plugin was added before, now I added --plugin eosio::net_plugin \ in all peer nodeos files and run again. Still, it returns save output connecting and syncing as false with incorrect blockhead number.
    – Varsh
    Apr 20, 2021 at 8:01
  • And all the peers are receiving blocks means they are running. No errors in the log file.
    – Varsh
    Apr 20, 2021 at 8:18
  • The block number is the number at the time of the connection. it is not updated after. Jun 18, 2021 at 15:02
  • hi, did you get anywhere with this? if you solved it can you please share your lessons learned, why it was not working as expected?
    – ovi
    Jun 21, 2021 at 11:22
0

The information you get from peers depends on if it is an "incoming" connection or an "outgoing" connection. If peer A is configured to connect to peer B and peer B is configured to connect to peer A, only one of these connections will be active, the other will be marked duplicate and dropped. All p2p connections are bi-directional, so it doesn't matter that one is dropped, but you see the difference in what connections reports.

The block number reported is from the time the connection is established.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.