The WorldLand blockchain network is a peer-to-peer network. When an ETH-ECC node is running, the node runs a peer discovery protocol. ETH-ECC nodes will continue to try to connect to other EVM-compatible nodes on the internet. Upon discovering an EVM-compatible node, the nodes exchange protocol details. If both nodes use the Worldland blockchain protocol, the nodes exchange blockchain data.
Check connection
In the net module of the JSON-RPC API. There are two commands to check node connectivity. The net.listening command returns whether a node is currently listening for peer connection requests from other peers.
> net.listening
true
The net.peercount command returns the number of active peers among the peers of the current node.
> net.peerCount
3
You can get detailed information about peers through the admin module of the JSON-RPC API.
The admin.peers command can get detailed information about all connected peers. You can get most information such as IP address, current protocol status, enode information, etc.
In order for a new node to join the WorldLand network, it must discover the WorldLand node through the peer discovery protocol. However, it is not easy to quickly find a node without any clues on the vast internet. WorldLand supports new nodes through bootstrap nodes(bootnodes). The bootnode is hardcoded inside the ETH-ECC code. When an ETH-ECC node starts up, it automatically tries to connect to a set of bootnodes. Below is currently hardcoded. This is a list of boot nodes in the Seoul network and the Gwangju network.
// SeoulBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Seoul network.
var SeoulBootnodes = []string{
"enode://00de00356ccba2b6960fb0fe29d596388494efd4f889772e5b86f45cf52055c343e35daa2a8fe5f02e7c239056ddfb4e143d7488dc0831b00f018f7ce0ddab4b@3.39.197.118:30303",
"enode://7b32ddd47f9db43dd660ae3e2cb05ebd36d1092aa1a3ee31a9090c7d459ac26dbc2352693d6217d466ad8dfdf09fe69a48265d2a53a7dc18a931347ad6a481dd@3.36.252.183:30303",
"enode://6477bc373216b8a59f59532ae01461f69f6ec88ec5ba81d293026089d973386d02f43004db1db5939532617c3dc20dd1f05c3dbd81c4fb23efedefb6129a1fb9@13.250.246.202:30303",
}
// Gwangju Bootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Gwangju network.
var GwangjuBootnodes = []string{
"enode://4f4be8c67ac7b1fcfceb21a374a62c68f7f0528988f3b3d322bd6d94aeb745667f0c8e847881bbaeeba52eb1d346166301243222d5e22dd16ce70c57214178ca@43.200.52.189:30303",
"enode://bbbf2734ce12b7aa258dd1e92e9cec7ea6b2ca6766f5741272c934904f3d182e08688aef3a368684c4c06b6adc2711c51e517bb9033824b2816c9d038c256cf9@3.36.252.183:30303",
"enode://911771c7894782bced03377a13f1d8a4e8450d05e03eabab1d6daae70e1b91b6074c346d42ac4fae53d98d273efedd6cdd37d2f6715302de9736b29cc4aa7da2@13.250.246.202:30303",
}
Bootnodes can be specified at startup by supplying the --bootnode flag with comma-separated bootnode addresses in enodes format. for example:
There are cases where the discovery process is unnecessary, such as when running local tests on the Gwangju or Seoul networks where bootnodes exist. In this case, you can disable the discovery protocol on startup via the -nodiscover option.
$ ./worldland <other flags> -nodiscover
Static Node
ETH-ECC node users can add static nodes via manual addition. A static node is a specific peer to which a connection is always maintained. Even if the ETH-ECC node is stopped and running again, the node connects to the static node. Static nodes can be added directly through the console or through command line commands.
Console
Run the command below to create the configuration file config.toml described in the command line options section.
You can then go to the [Node.P2P] section inside the config file and add it as a list to the StaticNodes field. When the ETH-ECC node is running, it tries to connect directly to the corresponding StaticNodes, and the static nodes are connected.
Passing --config instructs ETH-ECC to pull configuration values from this file, so make sure the other lines in config.toml are also set correctly before starting Geth. An example of a full config.toml file can be found here.
You can also add static nodes through JSON-RPC's admin module. By entering the enode address in admin.addPeer(), a static node is added to the console.