IPFs Private Network setup:
1. Prepare at least 2 IPFs nodes
2. Create a shared secret key
3. Configure the nodes that need to be shared with each other.
First, prepare the IPFs node.
1, prepare two Linux nodes, I test the system is Ubuntu 18.04 LTS (click can download).
2, install the IPFs command: (if installed can Shanghai aluminum ignore)
sudo snap install IPFs
3, install the Go-lang environment, the subsequent creation of the shared secret key needs to use. (if installed, ignore)
sudo apt-get install Golang
4, install Git. (Ignore if you have already installed)
sudo apt-get install git
After both Linux servers have completed the IPFs installation, the first step is complete.
Second, create a shared secret key
1. Download the key Generator tool Go-ipfs-swarm-key-gen above GitHub.
sudo git clone https://github.com/Kubuxu/go-ipfs-swarm-key-gen.git
2. Compiling Go-ipfs-swarm-key-gen
sudo go build-o ipfs-swarm-key-gen go-ipfs-swarm-key-gen/ipfs-swarm-key-gen/main.go
The current directory will be a ipfs-swarm-key-gen executable binary file. Then use the file to generate a Swarm.key file
sudo./ipfs-swarm-key-gen > Swarm.key
Copy the Swarm.key file into the. IPFs directory. (Note using Snap to install IPFs then. IPFs directory in ~/snap/ipfs/directory, for example my is under ~/snap/ipfs/589/).
Iii. configuring private networks that are shared with each other
1. Initialize two IPFS nodes respectively.
IPFs Init
2. Delete IPFs default mesh joint point
IPFs Bootstrap RM All
3. Add the address of one of the nodes to the bootstrap list of the other node.
3.1 Execute IPFs ID to view the ID value of the IPFs node.
IPFs node Information
3.2 Add a node address to another node in the bootstrap list
IPFs Bootstrap add/ip4/The IP address of the added node/tcp/4001/ipfs/the ID value of the node being added.
The IPFs private network is now complete.