diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f22b2fb7..047e0fb7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - uses: actions/setup-node@v2 with: node-version: 16 - uses: actions/cache@v2 @@ -32,6 +35,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' - uses: actions/setup-node@v2 with: node-version: 16 @@ -59,7 +65,10 @@ jobs: name: test node ${{ matrix.node }} steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - uses: actions/setup-node@v2 with: node-version: 16 - uses: actions/cache@v2 @@ -92,7 +101,10 @@ jobs: - webworker steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - uses: actions/setup-node@v2 with: node-version: 16 - uses: actions/cache@v2 @@ -122,7 +134,10 @@ jobs: - electron-renderer steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - uses: actions/setup-node@v2 with: node-version: 16 - uses: actions/cache@v2 diff --git a/.gitignore b/.gitignore index 729bf0ce..36922669 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,5 @@ dist test/test-data/go-ipfs-repo/LOCK test/test-data/go-ipfs-repo/LOG test/test-data/go-ipfs-repo/LOG.old -types \ No newline at end of file +types +tmp diff --git a/package.json b/package.json index 0e69128d..21b9834c 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "npm": ">6.0.0" }, "scripts": { + "preinstall": "bash ./setup-http-rpc-runtime.sh", "lint": "aegir lint", "build": "aegir build", "pretest": "aegir build --esm-tests", diff --git a/setup-http-rpc-runtime.sh b/setup-http-rpc-runtime.sh new file mode 100755 index 00000000..a4b9051c --- /dev/null +++ b/setup-http-rpc-runtime.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -xeo pipefail + +# this script sets up the Rube Goldberg machine for testing HTTP RPC wire format change end-to-end +# context: +# - https://github.com/ipfs/go-ipfs/pull/8183 +# - https://github.com/ipfs/js-ipfs/pull/3922 + +# use updated GO implementation from https://github.com/ipfs/go-ipfs/pull/8183 +cd tmp + git clone -b feat/pubsub-require-multibase https://github.com/coryschwartz/go-ipfs.git + cd go-ipfs + make build + make install + cd ../.. +# TODO: go-ipfs binary path to be used as IPFS_GO_EXEC +realpath tmp/go-ipfs/cmd/ipfs/ipfs + + +# use updated JS implementation from https://github.com/ipfs/js-ipfs/pull/3922 +rm -rf node_modules tmp +mkdir tmp +cd tmp + git clone -b feat/pubsub-require-multibase https://github.com/ipfs/js-ipfs.git + cd js-ipfs + npm install + npm run build + npm run link + cd ../.. + +# make sure npm uses js-ipfs libs +npx connect-deps link \ + ./tmp/js-ipfs/packages/ipfs \ + ./tmp/js-ipfs/packages/ipfs-http-client \ + --connect