A ipfs cluster with two nodes written in go
Setting up an IPFS private node locally:-
Install the prereqs from https://medium.com/@s_van_laar/deploy-a-private-ipfs-network-on-ubuntu-in-5-steps-5aad95f7261b
run the following commands
- IPFS_PATH=~/.ipfs ipfs init
Remove all pre-existing bootstrap node for the network - IPFS_PATH=~/.ipfs ipfs bootstrap rm --all
Now, change the configuration API and Gateways inside the config file inside the ".ipfs" folder
On the bootstrap node, create a swarm key by using - echo -e "/key/swarm/psk/1.0.0/\n/base16/\n
tr -dc 'a-f0-9' < /dev/urandom | head -c64
" > ~/.ipfs/swarm.key
and then send it to the clients you wish to share the network with
Find the peerID for the bootstrap node by using - IPFS_PATH=~/.ipfs ipfs config show | grep "PeerID"
Now, add bootstrap node to client node config usring - IPFS_PATH=~/.ipfs ipfs bootstrap add /ip4//tcp/4001/ipfs/
- export LIBP2P_FORCE_PNET=1
- IPFS_PATH=~/.ipfs ipfs daemon