Closed yilunzhang closed 3 years ago
Hi @yilunzhang , followed the instructions, my implementation https://github.com/rule110-io/surge/commit/a850bbc21b7bc8befe95d0bbe80438f365aa9460
Looks great! Now there is no single point of failure after first launch! :)
Some areas in the world (e.g. China) has really unstable connections to the seed nodes. To be more specific, a lot of RPC call will timeout randomly, and NKN clients will sometimes fail to create because creating a client relies on one RPC call to the seed node. We've tried all major VPS (AWS, GCP, DO, etc) and nothing works out reliably. This makes most of the errors we have seen during our Surge tests in China.
The solution we came up with for nMobile is to save last connected nodes. When creating clients next time, load and pass those nodes as seed nodes, together with the official seed node as back up. This is by far the most reliable and decentralized solution we have tried, and can eliminate most RPC timeout.
The current SDK already has all API needed, the implementation should be pretty straightforward:
Save nodes:
RPCAddr
of each nodeUse nodes:
RPCAddr
SeedRPCServerAddr
set to all saved RPCAddr (you probably need to addhttp://
prefix), with an additionalhttp://seed.nkn.org:30003
at the end as fallbackMake sure you are using the latest SDK version (v1.3.5+) so the RPC is trying seed node in order rather than random.