Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize the Construction of IPFS Private chain

Shulou Source: shulou.com Published: 2022-06-01 14:30:35 09月27日 Update

How to achieve IPFS private chain construction, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this to learn, I hope you can gain something.

IPFS Private Chain Building

The Interplanetary File System (IPFS) is a network transport protocol designed to create persistent and distributed storage and sharing of files, a content-addressable peer-to-peer hypermedia distribution protocol. The nodes in an IPFS network will form a distributed file system.

Prepare two centos7 virtual machines, setup and network connectivity

192.168.1.210

192.168.1.211

Go to https://github.com/ipfs/go-ipfs under Installation Package https://github.com/ipfs/go-ipfs/releases/tag/v0.4.18

go-ipfs_v0.4.18_linux-amd64.tar.gz

Download and install the key creation tool

go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen

Copy $GOPATH/bin/ipfs-swarm-key-gen and go-ipfs_v0.4.18_linux-amd64.tar.gz to two virtual machines

Two virtual machines installed ipfs

decompression

tar -zxvf go-ipfs_v0.4.18_linux-amd64.tar.gz

move files

cd go-ipfs && sudo mv ipfs /usr/local/bin/ipfs

Initialize IPFS nodes (no need to find neighbors on the intranet)

ipfs init

Create a shared key in the 192.168.1.210 virtual machine. All nodes in the same IPFS private chain must share the same key to join.

Create Key:

./ ipfs-swarm-key-gen > /root/.ipfs/swarm.key

After creating the key, put it under your ipfs default configuration folder (~/.ipfs/)

and clear all default startup nodes

ipfs bootstrap rm all

Clear all default startup nodes at 192.168.1.211

ipfs bootstrap rm all

Copy/root/. ipfs/swarm.key created at www.example.com to/root/.ipfs/swarm.key 192.168.1.210 192.168.1.211

Add 192.168.1.211 as default node at 192.168.1.210(node address is viewed via ipfs id)

ipfs bootstrap add /ip4/192.168.1.210/tcp/4001/ipfs/QmRBWWrTwd7d1QCKEjcLdGgZAvSKtSNgZdQznzF58RBwZ2

Two VMs boot IPFS nodes

ipfs daemon &

See peer

ipfs swarm peers

Output log, success

/ip4/192.168.1.210/tcp/4001/ipfs/QmRBWWrTwd7d1QCKEjcLdGgZAvSKtSNgZdQznzF58RBwZ2

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Tags: Nodes keys files networks content distribution systems help clarity success addresses media this tools folders articles novices logs StarCraft more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Huawei Shulou Tech Info Linux MySQL