How is a private IPFS network setup?

Viewed 1607
ubuntu@ip-172-31-39-89:~$ export LIBP2P_FORCE_PNET=1 && IPFS_PATH=~/.ipfs ipfs daemon

I have the following error -

export LIBP2P_FORCE_PNET=1 && IPFS_PATH=~/.ipfs ipfs daemon

 go1.11.1
Successfully raised file descriptor limit to 2048.
13:37:13.509 ERROR p2p-config: tried to create a libp2p node with no Private Network Protector but usage of Private Networks is forced by the enviroment config.go:69
13:37:13.512 ERROR   cmd/ipfs: error from node construction:  privnet: private network was not configured but is enforced by the environment daemon.go:332
Error: privnet: private network was not configured but is enforced by the environment
Received interrupt signal, shutting down...
(Hit ctrl-c again to force-shutdown the daemon.)

Any ideas about the cause?

2 Answers

I carefully repeated the process and regenerated the swarm keys and it worked this time.

I was having the same problem, when I tried to run it off a systemd service. Using the LIBP2P_FORCE_PNET env variable raises the error. I deleted the ipfs(~/.ipfs) data directory and run the init command again.

I think the reason could be the fact that I did not add the IPFS swarm key. Here's the commands if someone has a similar problem.

export LIBP2P_FORCE_PNET=1
IPFS_PATH=~/.ipfs ipfs init

#then,

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

IPFS_PATH=~/.ipfs ipfs daemon
Related