From 34cd44b7f207701242727673733af886fed92f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=B6lling?= Date: Thu, 25 Nov 2021 15:07:30 +0100 Subject: [PATCH] ipfs + binder: run a local node within binder and configure peering --- postBuild | 7 +++++++ start | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 postBuild diff --git a/postBuild b/postBuild new file mode 100644 index 00000000..60147cee --- /dev/null +++ b/postBuild @@ -0,0 +1,7 @@ +#!/bin/bash + +IPFS_VERSION=0.10.0 + +wget https://dist.ipfs.io/go-ipfs/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSION}_linux-amd64.tar.gz +tar -xvzf go-ipfs_v${IPFS_VERSION}_linux-amd64.tar.gz +rm go-ipfs_v${IPFS_VERSION}_linux-amd64.tar.gz diff --git a/start b/start index 0b6cc357..546bae6f 100644 --- a/start +++ b/start @@ -1,5 +1,15 @@ #!/bin/bash -export IPFSSPEC_GATEWAYS="https://tempgw01.web3.storage https://ipfs.io https://dweb.link https://cloudflare-ipfs.com/" +# make ipfs command available +export PATH=$PATH:$HOME/go-ipfs +# set up local node +ipfs init +# configure peering with known peers +ipfs config --json Peering "`curl -L https://github.com/eurec4a/ipfs_tools/raw/main/peers.json`" + +# start the daemon +ipfs daemon 2>ipfs.log | grep -i -o -m1 'Daemon is ready' & tail -f --pid=$! ipfs.log + +# continue starting the jupyter server exec "$@"