For testing, I want to be able to run several IPFS nodes on a single machine.
This is the scenario: I am building small services on top of IPFS core library, following the Making your own IPFS service guide. When I try to put client and server on the same machine (note that each of them will create their own IPFS node), I will get the following:
panic: cannot acquire lock: Lock FcntlFlock of /Users/long/.ipfs/repo.lock failed: resource temporarily unavailable
Usually, when you start with IPFS, you will use
ipfs init
, which will create a new node. The default data and config stored for that particular node are located at~/.ipfs
. Here is how you can create a new node and config it so it can run besides your default node.1. Create a new node
For a new node you have to use
ipfs init
again. Use for instance the following:This will create a new node at ~/.ipfs2 (not using the default path).
2. Change Address Configs
As both of your nodes now bind to the same ports, you need to change the port configuration, so both nodes can run side by side. For this, open ~/.ipfs2/config
and find
Addresses`:To for example the following:
With this, you should be able to run both node .ipfs and .ipfs2 on a single machine.
Notes:
IPFS_PATH=~/.ipfs2
Hello, I use ipfs2, after running two daemons at the same time, can indeed open localhost:5001 / webui, run the second localhost:5002 / webui has an error, as shown in the attachment
Here are some ways I've used to create multiple nodes/peers ids.
I use windows 10.
Use VirtualBox to run a minimal ubuntu installation. (You can set up as many as you want) Repeat the process and you have 4 nodes or as many as you want.
https://discuss.ipfs.io/t/ipfs-manager-download-install-manage-debug-your-ipfs-node/3534 is another gui that installs and lets you manage all ipfs commands without CMD. He just released it a few days ago and it looks well worth lots of reviews.
Disclaimer I am not a coder or computer professional. Just a huge fan of IPFS! I hope we can raise awareness and change the world.