How to run multiple IPFS hosts on the same machine?

For testing, I want to be able to run multiple IPFS hosts on the same machine.

This is the scenario: I build small services on top of the IPFS core library, following the guide Creating Your Own IPFS Service . When I try to install the client and server on the same computer (note that each of them will create its own IPFS host), I will get the following:

panic: cannot acquire lock: Lock FcntlFlock of /Users/long/.ipfs/repo.lock failed: resource temporarily unavailable
+7
source share
4 answers

, IPFS, ipfs init, node. , node, ~/.ipfs. node , node.

1. node

node ipfs init. , , :

IPFS_PATH=~/.ipfs2 ipfs init

node ~/.ipfs2 ( ).

2.

, , . ~/.ipfs2/config and find `:

"Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Gateway": "/ip4/127.0.0.1/tcp/8080",
    "Swarm": [
        "/ip4/0.0.0.0/tcp/4001",
        "/ip6/::/tcp/4001"
    ]
}

, :

"Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5002",
    "Gateway": "/ip4/127.0.0.1/tcp/8081",
    "Swarm": [
        "/ip4/0.0.0.0/tcp/4002",
        "/ip6/::/tcp/4002"
    ]
}

node.ipfs, .ipfs2 .


:

  • , .ipfs2, env IPFS_PATH=~/.ipfs2
  • node ~/.ipfs ~/.ipfs2
  • node, IPFS_PATH = ~/.ipfs2 ipfs daemon &
+14

Docker. Docker , IPFS. , cmd. Docker IPFS-, . ipfs, Mac.

docker run -it INSERT_IMAGE_ID_HERE bash

# The Dockerfile...
FROM golang

# GOPATH will be /go

RUN go get -u -d github.com/ipfs/go-ipfs
WORKDIR /go/src/github.com/ipfs/go-ipfs
RUN make install

RUN bash
0

enter image description here

, ipfs2, localhost: 5001/webui, localhost: 5002/webui ,

0

, /.

Windows 10.

VirtualBox Ubuntu. ( , ) , 4 , .

https://discuss.ipfs.io/t/ipfs-manager-download-install-manage-debug-your-ipfs-node/3534  is another graphical interface that installs and allows you to manage all ipfs commands without CMD. He just released it a few days ago, and he looks worthy of a lot 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.

-1
source

Source: https://habr.com/ru/post/1658467/


All Articles