Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AddPeer adds a peer to the Freenet node.
The message should contain only one of
- a File
- a URL, or
- a raw Node Reference.
Care must be taken to ensure that any automated connection system maintains the correct "network topology", otherwise Freenet's overall performance could deteriorate dramatically. Connections must be "clustered" in such a way that if node A is connect to node B, and node B is connect to node C, then there must be a higher than normal probability that node A is connected to node C. Human relationships have this property, but simply connecting together nodes at random will not, and will result in serious problems for the Freenet network. You can achieve a good network topology if you try to ensure that the probability of two nodes being connected is proportional to the inverse of the distance between the node's locations - noting that locations are on a ring, where 0.0 is the same as 1.0 (in the same way that zero o'clock is the same as twelve o'clock). If you are implementing anything that uses AddPeer, and you are unclear about this issue, please seek guidance on the tech mailing list before you proceed.
AddPeer Trust=HIGH Visibility=YES File=newref.txt EndMessage
AddPeer Trust=NORMAL Visibility=NAME_ONLY URL=http://foobar.net/myref.txt EndMessage
AddPeer Trust=LOW Visibility=NO physical.udp=220.127.116.11:12345 lastGoodVersion=Fred,0.7,1.0,874 ark.pubURI=SSK@fjRw9dk...AQABAAE/ark ark.number=123 identity=GT5~dseFDw... myName=foobar base64=true location=0.01234567890 testnet=false version=Fred,0.7,1.0,918 EndMessage
|Trust||LOW, NORMAL, HIGH||yes||Sets the trust you put in the new peer.|
|Visibility||NO, NAME_ONLY, YES||yes||Determines whether the new peer will be visible for your peers.|
|File||filename||no||If set, the peer noderef is read from the given filename relative to the node's current directory.|
|URL||URL||no||If set, the peer noderef is read from the given URL.|
|<raw_noderef>||<key>=<value>||no||If neither File nor URL are set, the field set is read as a noderef.|
Note: Only one of the above sources for a peer is allowed to be present in this message.