Neo-CLI SeedList
Introduction
What is the SeedList?
The SeedList, simply put, is a list of URLs. They belong to the nodes that Neo-CLI tries to connect to when it starts. You can find the SeedList in protcol.json
, under the neo-cli directory.
Here, Neo-CLI is configured to connect to seed1.neo.org
, seed2.neo.org
, and so on through PORT:10333
.
Potential Issues with current setup
That's all well and good, but what happens if every single node in our list is down?
Well, neo-cli is smart, so it will attempt to connect to neighbouring nodes. However, there are many unknown factors in this approach. Perhaps the neighbours are down. The wait time may grow to be unbearable.
Updating the SeedList
By updating the SeedList with addresses of nodes that we're certain are alive, we can avoid lengthy wait times as described in Potential Issues .
How to update?
Live nodes
And how do we find out which nodes are alive? The good folks at City of Zion has created an excellent resource that constantly pings nodes all around the world. The results are displayed on this tracker .
Here we see a list of nodes that are available. The latest ones are pushed to the top.2tells us if the node is responding. Generally, we take the ones that say yes
and are green in color.
We try to follow the standard protocol for ports.
Main Net | Test Net | |
---|---|---|
JSON-RPC via HTTPS | 10331 | 20331 |
JSON-RPC via HTTP | 10332 | 20332 |
P2P via TCP | 10333 | 20333 |
P2P via WebSocket | 10334 | 20334 |
With that, we will choose the first node over the third node, since1adheres the convention and3does not.
We will choose the following live node addresses:
-
seed3.aphelion-neo.com
-
seed4.aphelion-neo.com
-
node2.ams2.bridgeprotocol.io
-
pyrpc1.nodeneo.ch
-
node2.nyc3.bridgeprotocol.io
The main port neo-cli works with is 10333
. Currently, we are pinging RPC
only. We are assuming that if a node's RPC
port is up, then its P2P
port should be up as well. If this sounds wrong, that's because it is! We will address it in one of our upcoming Hackathons, so stay tuned!
Editing the protocol
To let Neo-CLI know the new SeedList, we will paste the addresses chosen before into protocol.json
.
Notice that we've added :10333
to the end of each of the addresses, to tell Neo-CLI that to connect using the P2P
protocol.
And that's it! You can now start neo-cli as usual.
Reference tools
If the above steps are too tedious, there's also a script written that automatically updates the protocol.json
. Check it out here .