Reputation: 401
When configured as a private network, "ipfs files ls" does not return anything (although many files are loaded and visible through the webui for that particular peer. It does work fine when the network is public. The nodejs client ipfs.files.ls does not return anything either. Is this due to some mis-configuration of my node? Any way around this? Thanks.
Upvotes: 1
Views: 890
Reputation: 772
Interesting. I cannot seem to reproduce that behaviour on my end, what version of IPFS are you running?
Here's what I did to setup a private network, with a working MFS (fresh install):
ipfs init
go get github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
cd ~/go/bin/
./ipfs-swarm-key-gen > ~/.ipfs/swarm.key
ipfs bootstrap rm --all
ipfs bootstrap add <multiaddr>
Add Environment="LIBP2P_FORCE_PNET=1"
underneath [Service]
sudo vim /usr/lib/systemd/user/ipfs.service
systemctl --user start ipfs
ipfs files ls /
No output, because we just initialised
echo "Hello world" > hello
ipfs add hello
ipfs files cp /ipfs/QmePw8gVcBMb8x6kAep6aMBAX23hCSk6iZW3i9VKkiFhu1 /hello
ipfs files ls /
Correctly reports hello
systemctl --user stop ipfs
mv ~/.ipfs/swarm.key ~/.ipfs/swarm.key.bk
systemctl --user start ipfs
systemctl --user status ipfs
You should see the daemon has failed to start, if private network is being enforced.
mv ~/.ipfs/swarm.key.bk ~/.ipfs/swarm.key
Upvotes: 1