Factomd 6.5.0 P2P2 beta test

It's time for the first public test of factomd 6.5.0 with p2p2, a rewrite of the p2p2 protocol with the CAT mechanism enabled. You can read more about CAT in my blog post but the general idea is this:

The structure of factom's p2p network revolves around central servers ("seed nodes") that every peer connects to at first, then finds more connections from there. The drawback is that these central nodes will receive an overwhelming share of the randomized traffic due to their abundance of connections. CAT aims to break that by periodically dropping connections in favor of new ones, gradually reordering the network over time.

This is accomplished by dropping from 32 connections down to 30 connections every 15 minutes. The two open spots are then filled by randomly finding new peers from the other 30. It doesn't sound like much but given enough time, this will result in nodes being connected to a random set of other nodes.

In the old system, nodes would try to dial out to at least 32 other nodes but accept far more inbound nodes than that, up to 200. Once that limit is reached, nodes refuse all connections. In p2p2, this limit has been reduced even further (down to 36) but now instead of quietly rejecting a connection, the node will send a list of alternative peers before closing the connection. This means connecting nodes will be able to eventually find an open node.

In addition to the CAT mechanism, there is the addition of the v10 protocol that is a lighter version of the current v9 protocol. Nodes are backward compatible with v9 through a new handshake mechanism that lets nodes run multiple protocols at the same time. This opens up forward compatibility for future improvements in that area without requiring a hard fork.

Integration into factomd is seamless and you can run the codebase without any special requirements. The control panel peer list has been adapted to support P2P2:

It now shows the protocol the other node is using, as well as the current bandwidth rates, measured over a five-second period. The color coding has been changed to: orange (<1MB transferred), lime (between 1MB and 10MB), and dark green (>10MB) to indicate the strength of the node. You should typically be seeing between 30 and 32 nodes, with nodes having a very mixed amount of "time connected" between them. This is due to CAT randomly disconnecting two peers every 15 minutes.

Everything else should be working as expected on a 6.5.0 node.

Docker images:
You'll need to remove the -broadcastnum tag when restarting the node using the docker run command.
Alpine: docker pull factominc/factomd:v6.5.0-p2p2-beta0-alpine
Non-alpine: docker pull factominc/factomd:v6.5.0-p2p2-beta0
GitHub Release: https://github.com/FactomProject/factomd/releases/tag/v6.5.0-p2p2-beta
Source Code: https://github.com/WhoSoup/factomd/tree/factomize-p2p2-november (commit 779f2d53664b89407331885c8339551cca1a80bc)

This test is intended for the factom testnet, so please use the testnet factomd config: https://raw.githubusercontent.com/FactomProject/communitytestnet/master/factomd.conf.EXAMPLE

Run factomd with
factomd --net=CUSTOM --customnet=fct_community_test
Building it yourself:

go get github.com/FactomProject/factomd
cd $GOPATH/src/github.com/FactomProject/factomd
git remote add whosoup https://github.com/WhoSoup/factomd
git fetch whosoup factomize-p2p2-november
git checkout factomize-p2p2-november
go build -ldflags "-X github.com/FactomProject/factomd/engine.Build=`git rev-parse HEAD` -X github.com/FactomProject/factomd/engine.FactomdVersion=`cat VERSION`"

Most importantly, any p2p related errors should be reported. Other than that, things of interest are:
* CPU usage of the node
* Bandwidth usage of the node
* If the connections consistently are between 30 and 32 (a few above or below are okay)
* If the node has problems keeping up with the height
Last edited by a moderator: