I've got the CLI client built and running, now what?

roz303roz303 Member Posts: 66
Hello! Yesterday, I successfully built and tested the AlephZero CLI client of PoC9. I get this "terminating discovery after 0 rounds" after calling ./eth and letting it run. I'm thinking it's just that I haven't specified how to connect to testnet, so, how would I do that? After that, how can I create contracts and... for lack of a better term at the moment, "upload" them to the testnet? Thanks for your help guys, I'm glad to be part of the frontier :)

Comments

  • mids106mids106 Member Posts: 188 ✭✭✭
    edited March 2015
    from Gavin Wood:
    It's a little less good than it used to be
    Because of the new Kademlia protocol we're using
    We'll try to get that sorted for next release
    In the meantime a workaround is to restart AZ prior to connect
    Basically if a peer drops it gets marked bad and won't explicitly connect again
    It should force the matter but doesn't. I'll try to fix today.
  • roz303roz303 Member Posts: 66
    Sorry - I didn't mean I was using the GUI, I chose to build the command line headless system. But there's really no difference, they're both the same CPP program, right? But thank you. How do I do this?
  • bfaysalbfaysal Member Posts: 4
    Roz,

    Gav explained you the main issue which is related to the way peer to peer network discover nodes around. It's 100% a Kademlia problem, Kademlia is used to produce a virtual network over the real physical network. The resulted network is called overlay network, public keys are used instead of the real network characteristics of the nodes. These keys are 100% random numbers ( 512 bits in the case of Ethereum), it used XOR to define the closeness between them.

    A node has capability to discover other nodes in this overlay network. Your error "
    "terminating discovery after 0 rounds" it may be caused by a node is not able to see any nearest nodes.

    I need to have a close look or dig into the libp2p library to see what caused that. Note that this library is a very nested one and one of the most important one for Ethereum peer to peer system.

    For now it's not as you imagine, GUI.

    Best.









  • bfaysalbfaysal Member Posts: 4
    edited March 2015
    Hi Roz,

    I spent sometimes to assess the problem, mainly the sub-library NodeTable in library libp2p
    that is spitting that error.

    Actually, Gav and Alex, the authors, put couple of clog(NodeTableNote) , a condition on s_maxSteps and a second condition below on tried.empty() using the same message text, it is better to use different messages.

    After a modification of the function discover,

    if (_round == s_maxSteps)
    {
    clog(NodeTableNote) << "Terminating discover after_s_maxSteps " << _round << " rounds.";
    return;
    }
    ...

    if (tried.empty())
    {
    clog(NodeTableNote) << "Terminating discover after_tried.empty() " << _round << " rounds.";
    return;
    }

    It appears that tried.empty() is the main issue:


    nearest.size() is: 0
    tried.size() is: 0
    *P* [ 20:01:36 | main ] Terminating discover after_tried.empty() 0 rounds.

    The function discover() called a second discover function with the node ID as argument, no m_state initialization as nearest.size() is 0.

    The problem is as, I explained before, no nearest is found. The node has no m_state initialization.

    When, in the function nearestNodeEntries, I forced a kind of random initialization of m_sate using 100 random nodes each time, everything worked and no error have been observed, the code exhausted the runs till 8 with around 900 nodes in the m_state ... our node has something on the plate ...

    This exercise is just to test the coding, now I need to see how to initialize correctly the m_sate before calling discover ...
    It's a long process, reading the nested libp2p library, this library is using boost asio, the asynchronous nature of this library needs more testing to figure out what's going on ... at the level of the codes and also how the operating system is acting with io-service and so on ...

    If Gav and Alex have time to discuss these points, it will be great to come up with an adequate fixing?

    Cheers,











    Post edited by bfaysal on
Sign In or Register to comment.