Skip to content

Getting Started

This is the fastest way to get a real node running. The current codebase lives in Network/ and builds three entrypoints: bootstrap, peer, and gui.

  • Go 1.26.2 or later
  • Git
  • A terminal

Check your Go install:

Terminal window
go version
Terminal window
git clone https://github.com/connor12858-site/P2PNetwork.git
cd P2PNetwork/Network

Build the current binaries:

Terminal window
go build -o bootstrap ./cmd/bootstrap
go build -o peer ./cmd/peer
go build -o gui ./cmd/gui

The repo also includes a Makefile and build.ps1 for repeatable builds.

Terminal window
./bootstrap

The bootstrap node prompts for a name, starts on port 52837, prints its peer ID and multiaddrs, and writes the first multiaddr to a file called bs-nodes in the working directory.

If you are on Windows, use the built .exe file from bin/ or Releases/.

Open a second terminal in the same directory and run:

Terminal window
./peer

The peer node reads bs-nodes if it exists, prompts for a name, connects to the bootstrap node, and starts discovery.

The peer CLI accepts these commands:

connect <multiaddr>
peers
discovered
exit

Useful things to know:

  • peers shows currently connected peers
  • discovered shows peers returned by discovery
  • connect uses a full multiaddr like /ip4/192.168.1.10/tcp/52837/p2p/<peer-id>
  • exit shuts the node down cleanly

Run the desktop client in a third terminal:

Terminal window
./gui

The Fyne app uses the same node package. It shows the current name, running state, and connected peers.

Bootstrap

Prompts for a name, writes bs-nodes, and stays up as the discovery anchor.

Peer

Connects to bootstrap, advertises on fgov-network, and keeps searching for peers.

GUI

Starts the same node package behind a desktop window.

  • Make sure the bootstrap node is still running
  • Keep the bs-nodes file in the same working directory as the peer
  • Check the peer can reach the bootstrap machine over the network
  • Make sure you are in Network/
  • Run go mod download
  • Verify your Go version is recent enough
  • The bootstrap node gets -bootstrap appended automatically
  • Connected peers exchange names over the /fgov stream protocol

Architecture

Read Architecture to understand how the node package is organized.

How to Use

Continue with How to Use for the exact runtime behavior.

Downloads

See Downloads for the current release binaries.