Skip to content

Commit

Permalink
refactor: switch npm to kubo (#2152)
Browse files Browse the repository at this point in the history
cc ipfs/npm-kubo#51
cc ipfs/kubo#8959

Co-authored-by: Russell Dempsey <[email protected]>
  • Loading branch information
lidel and SgtPooki authored Aug 22, 2023
1 parent f21d1c4 commit 0cc9017
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Default behavior can be tweaked via env variables below.

#### `IPFS_GO_EXEC`

It is possible to test against arbitrary versions by tweaking `go-ipfs` in `devDependencies` section of `package.json` and applying the change via `npm i`.
It is possible to test against arbitrary versions by tweaking `kubo` in `devDependencies` section of `package.json` and applying the change via `npm i`.

One can also override the binary used in e2e tests by providing a path to an alternative one via `IPFS_GO_EXEC`:

Expand Down
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"esm": "^3.2.25",
"fake-indexeddb": "^3.1.8",
"get-port": "^5.1.1",
"go-ipfs": "^0.20.0",
"kubo": "0.22.0",
"http-proxy": "^1.18.1",
"http-server": "^14.1.1",
"ipfs": "0.58.3",
Expand Down
4 changes: 2 additions & 2 deletions src/bundles/identity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe.skip('identity.js', function () {
18 | const ipfsHttpModule = await import('ipfs-http-client')
> 19 | const { createController } = await import('ipfsd-ctl')
| ^
20 | const ipfsBin = (await import('go-ipfs')).default.path()
20 | const ipfsBin = (await import('kubo')).default.path()
21 | console.log('ipfsBin: ', ipfsBin)
22 | /**
Expand All @@ -33,7 +33,7 @@ describe.skip('identity.js', function () {
// console.log('kuboRpcModule: ', kuboRpcModule)
const kuboRpcModule = await import('kubo-rpc-client')
const { createController } = await import('ipfsd-ctl')
const ipfsBin = (await import('go-ipfs')).default.path()
const ipfsBin = (await import('kubo')).default.path()
console.log('ipfsBin: ', ipfsBin)
/**
* This test allows for a manual run of the Kubo daemon to reproduce and
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/ipns.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from './setup/coverage.js'
import { createController } from 'ipfsd-ctl'
import { path as getGoIpfsPath } from 'go-ipfs'
import { path as getGoIpfsPath } from 'kubo'
import * as kuboRpcModule from 'kubo-rpc-client'

// TODO: Fix parallelism of these tests
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/peers.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from './setup/coverage.js'
import { createController } from 'ipfsd-ctl'
import * as kuboRpcModule from 'kubo-rpc-client'
import { path as getGoIpfsPath } from 'go-ipfs'
import { path as getGoIpfsPath } from 'kubo'

const addConnection = 'text=Add connection'

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/remote-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createServer } from 'http'
import httpProxy from 'http-proxy'
import basicAuth from 'basic-auth'
import toUri from 'multiaddr-to-uri'
import { path as getGoIpfsPath } from 'go-ipfs'
import { path as getGoIpfsPath } from 'kubo'
import * as kuboRpcModule from 'kubo-rpc-client'
const { createProxyServer } = httpProxy

Expand Down Expand Up @@ -51,7 +51,7 @@ test.describe('Remote API tests', () => {
rpcUrl = new URL(remoteApiUrl).toString() // normalization for browsers
proxy.on('proxyReq', (proxyReq, req, res, options) => {
// swap Origin before passing to the real API
// This way internal check of go-ipfs does get triggered (403 Forbidden on Origin mismatch)
// This way internal check of kubo does get triggered (403 Forbidden on Origin mismatch)
proxyReq.setHeader('Origin', remoteApiUrl)
proxyReq.setHeader('Referer', remoteApiUrl)
proxyReq.setHeader('Host', new URL(remoteApiUrl).host)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/setup/ipfs-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function run (rpcPort) {
},
{
go: {
ipfsBin: process.env.IPFS_GO_EXEC || (await import('go-ipfs')).default.path()
ipfsBin: process.env.IPFS_GO_EXEC || (await import('kubo')).default.path()
}
})

Expand Down

0 comments on commit 0cc9017

Please sign in to comment.