Testing - WhoSoup/factom-p2p GitHub Wiki
P2P 2.0 Test
Thank you everyone for assisting me in testing the new p2p package. If you are interested in what that actually is, you can read my FIP for it, though that's not necessary for this test.
The TL;DR is that this replaces the code that connects to other nodes and delivers messages between nodes. One of the goals is for it to be a seamless drop-in replacement, meaning that if everything goes well, nothing is going to change.
Areas of Interest
First and foremost the thing to look out for is: does the node connect to the network and in general not crash? You should be seeing the usual amount of connections in the control panel and have the node sync.
The next thing is server performance. This code switches from a polling-based loop to a blocking on-demand architecture. Golang has some idiosynchracies here in terms of scheduling, so I'm keen to find out if the CPU usage remains fairly consistent or if CPU-spikes increase. I'm also interested in overall CPU usage as well as memory usage. If you have a baseline for those to compare against, that would be incredible.
Third is bandwidth but this comes with a very heavy caveat. Nodes running the new code that connect to other nodes running the new code will attempt to converse in a lower bandwidth protocol, which should reduce overall bandwidth by 25% or more (data transfer, not amount of packets). The problem is that in the testnet you'll mostly be connecting to legacy nodes and this one won't be as apparent. If this test goes well, we can schedule a more elaborate test that builds a network of only new nodes.
Fourth is if you have a setup to monitor prometheus from the node itself, there are new things in there like a histogram of packet sizes.
Summary of things that can potentially go wrong / things to watch out for:
- Crashes of any kind
- Unable to connect to nodes
- Frequent disconnects to nodes (low "time connected" in the control panel, "error" log entries)
- Dropped messages ("warning" log entries)
- High CPU usage
Installation
Sorry but this is gonna be a little more difficult to install since the deployment hasn't been fully integrated into FactomProject yet.
- get the factomd code with
go get -u github.com/FactomProject/factomd
(or following the first two commands of the official installation instructions) - download the p2p package with
go get github.com/WhoSoup/factom-p2p
(or if you prefer, you can download the source code and extract it to your GOPATH directly) - in your factomd folder, add a new remote repository:
git remote add factomize https://github.com/WhoSoup/factomd
- get the modified factomd branch:
git fetch factomize && git checkout factomize/FACTOMIZE_new_p2p
- install with
go install
or following your usual docker installation - (as a follower) connect to the testnet with the default config in
~/.factom/m2/
and default command:factomd -network=CUSTOM -customnet=fct_community_test -loglvl=warning
I'm not very familiar with deployment to servers so if anyone more familiar with building/docker/etc would like to improve this, please let me know.