From f7fe4a181d6ca1c1ae07e75240b8df89ca9c8f50 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Tue, 1 Jan 2019 23:15:46 +0100 Subject: [PATCH] add info how to punch a UPnP hole --- README.md | 35 +++++++++++++++++++++++++++++++++++ docker-compose.yml | 3 +++ 2 files changed, 38 insertions(+) diff --git a/README.md b/README.md index 3b44157..ff593f0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Now you can use ipfs command as normal: ``` $ ipfs-daemon +$ ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080 + $ ipfs id $ ipfs swarm addrs --local $ ipfs pin ls -q --type recursive @@ -60,6 +62,39 @@ $ curl -s https://ipfs.io/ipfs/Qmdd7jNjEM4RXEnG8Y4ZikaqN6PUJkZ6bZuJZySEaFcuqY/do 03f9ccb5d2a0e88acb60188e627042ef143c7fe5426c883863e78e66dab908d7 - ``` +### Sharing stuff + +To make sure your stuff gets shared across IPFS peers well, you need to make +sure your ipfs-daemon listening on 4001/tcp port is accessible from the WAN. + +Either configure your router to foward the traffic coming to 4001/tcp to your +internal server/pc where your ipfs-daemon is running or just punch a port using +the UPnP protocol like this: + +``` +$ sudo apt-get -y install miniupnpc +$ upnpc -r 4001 tcp +``` + +> Your IGD (router/GW) must support UPnP for this to work. + +After that you should see lots of traffic is coming to your port 4001/tcp: + +``` +sudo tcpdump -qenn -i eno1 src port 4001 and not src host 192.168 +``` + +And ipfs reports lots of peers (>100 peers): + +``` +ipfs swarm peers +``` + +Then, when you've shared some stuff via the IPFS, you can try accessing it via +any available public IPFS gateway (see link below). + +It should return the content you've shared quickly. + ### Links - https://ipfs.github.io/public-gateway-checker/ diff --git a/docker-compose.yml b/docker-compose.yml index 4aefc24..d27eb7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,3 +10,6 @@ services: cap_add: - IPC_LOCK # lock memory to prevent sensitive values from being swapped to disk. shm_size: 128M + ports: + - 4001:4001 + - 8080:8080