Peer Connect

Node Discovery

When the Meey server starts running, you need a way to connect to the network. To do this, you need to know and connect to other Meey server nodes already connected to the chain. Meey does this using several methods.

Query wezen

Wezen keep list of meey server nodes, such like DNS. Meey server connect and query to official Meey Wezen automatically, if the chain is Official MeeyMainNet or MeeyTestNet.

You can build and run custom Wezen for your private chain or custom public chain. You should configure to use custom Wezen by modifying config file.

Designate Peer

You can add a list of designated known peers to connect to at boot time in configuration file using the option ‘npaddpeers’.

Dynamic peer discovery

Meey server requests peer list from other connected peers as well as Wezen if it cannot find enough peers.

Peer connect process

The network communication of Meey server operates on libp2p basis, and libp2p is responsible for encryption and node distinction at transmission level. After a tcp session is created, both peers start the handshake operation.

Peer Handshake

In the Handshake phase, peers exchanges each other’s version, chain ID and state to determine whether to connect. If the other node version is not supported by the current server or the operating chain ID is different, the connection is stopped. Once the handshake is successful, the difference in block height is compared and synchronization started.

Keep Alive

Meey server maintains a connection-based communication. Both peers disconnect when the internally defined retention score increases beyond a certain level. This score decreases to a low level when a query is requested, and increases when a bad block or TX notification is sent.

Peer blacklist

When an internally defined ban score exceeds a certain level, the Meey server blocks the peer’s connection. This score increases due to the connection being disconnected due to exceeding the connection maintenance score, etc., and the blocking period is also changed by calculating the score or the number of blocking times. You can also permanently block by specifying a block address in the configuration file.

Last updated