Compare commits

...

9 Commits

Author SHA1 Message Date
c3aaad4753 chore: add github actions 2021-04-09 10:30:48 +02:00
578276bd40 chore: update deps 2021-04-09 10:19:09 +02:00
d39ad01e96 chore: update url interfaces (#143) 2021-03-24 13:22:02 +01:00
37406d1924 chore: release version v0.15.3 2021-02-03 13:06:33 +01:00
2df478919d chore: update contributors 2021-02-03 13:06:32 +01:00
3813100438 fix: hanging close promise (#140) 2021-02-03 13:03:09 +01:00
8661c09b69 chore: release version v0.15.2 2020-12-28 09:54:14 +00:00
f9e329708d chore: update contributors 2020-12-28 09:54:14 +00:00
af9804e778 fix: intermittent error when asking for interfaces (#137)
Get interfaces only once per run
2020-12-28 09:49:48 +00:00
13 changed files with 188 additions and 96 deletions

33
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npx aegir lint
- run: npx aegir dep-check -- -i wrtc -i electron-webrtc
test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [14, 15]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npx nyc --reporter=lcov aegir test -t node -- --bail
- uses: codecov/codecov-action@v1

View File

@ -1,34 +0,0 @@
language: node_js
cache: npm
sudo: false
stages:
- check
- test
- cov
node_js:
- '10'
- '12'
os:
- linux
- osx
- windows
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'; fi
script: npx nyc -s npm run test:node -- --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
jobs:
include:
- stage: check
os: linux
script:
- npx aegir dep-check
- npm run lint
notifications:
email: false

View File

@ -1,3 +1,42 @@
<a name="0.15.3"></a>
## [0.15.3](https://github.com/libp2p/js-libp2p-tcp/compare/v0.15.2...v0.15.3) (2021-02-03)
### Bug Fixes
* hanging close promise ([#140](https://github.com/libp2p/js-libp2p-tcp/issues/140)) ([3813100](https://github.com/libp2p/js-libp2p-tcp/commit/3813100))
<a name="0.15.2"></a>
## [0.15.2](https://github.com/libp2p/js-libp2p-tcp/compare/v0.14.2...v0.15.2) (2020-12-28)
### Bug Fixes
* catch error from maConn.close ([#128](https://github.com/libp2p/js-libp2p-tcp/issues/128)) ([0fe0815](https://github.com/libp2p/js-libp2p-tcp/commit/0fe0815))
* catch thrown maConn errors in listener ([#122](https://github.com/libp2p/js-libp2p-tcp/issues/122)) ([86db568](https://github.com/libp2p/js-libp2p-tcp/commit/86db568)), closes [#121](https://github.com/libp2p/js-libp2p-tcp/issues/121)
* intermittent error when asking for interfaces ([#137](https://github.com/libp2p/js-libp2p-tcp/issues/137)) ([af9804e](https://github.com/libp2p/js-libp2p-tcp/commit/af9804e))
* remove use of assert module ([#123](https://github.com/libp2p/js-libp2p-tcp/issues/123)) ([6272876](https://github.com/libp2p/js-libp2p-tcp/commit/6272876))
* transport should not handle connection if upgradeInbound throws ([#119](https://github.com/libp2p/js-libp2p-tcp/issues/119)) ([21f8747](https://github.com/libp2p/js-libp2p-tcp/commit/21f8747))
### Chores
* update deps ([#134](https://github.com/libp2p/js-libp2p-tcp/issues/134)) ([d9f9912](https://github.com/libp2p/js-libp2p-tcp/commit/d9f9912))
### BREAKING CHANGES
* - The multiaddr dep used by this module returns Uint8Arrays and may
not be compatible with previous versions
* chore: update utils
* chore: remove gh dep url
<a name="0.15.1"></a>
## [0.15.1](https://github.com/libp2p/js-libp2p-tcp/compare/v0.15.0...v0.15.1) (2020-08-11)

View File

@ -9,11 +9,11 @@
[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-tcp.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-tcp)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)
[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/transport/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport)
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/connection/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/connection)
> JavaScript implementation of the TCP module for libp2p. It exposes the [interface-transport](https://github.com/libp2p/interface-connection) for dial/listen. `libp2p-tcp` is a very thin shim that adds support for dialing to a `multiaddr`. This small shim will enable libp2p to use other transports.
> JavaScript implementation of the TCP module for libp2p. It exposes the [interface-transport](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport) for dial/listen. `libp2p-tcp` is a very thin shim that adds support for dialing to a `multiaddr`. This small shim will enable libp2p to use other transports.
## Lead Maintainer
@ -87,7 +87,7 @@ Value: hello
### Transport
[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/transport/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/transport)
`libp2p-tcp` accepts TCP addresses as both IPFS and non IPFS encapsulated addresses, i.e:
@ -98,7 +98,8 @@ Value: hello
### Connection
[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)
[![](https://raw.githubusercontent.com/libp2p/js-libp2p-interfaces/master/src/connection/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/src/connection)
## Contribute

View File

@ -1,6 +1,6 @@
{
"name": "libp2p-tcp",
"version": "0.15.1",
"version": "0.15.3",
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces",
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
"main": "src/index.js",
@ -21,7 +21,13 @@
"url": "https://github.com/libp2p/js-libp2p-tcp.git"
},
"keywords": [
"IPFS"
"libp2p",
"network",
"p2p",
"peer",
"peer-to-peer",
"IPFS",
"TCP"
],
"license": "MIT",
"bugs": {
@ -29,24 +35,23 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-tcp",
"engines": {
"node": ">=6.0.0",
"npm": ">=3.0.0"
"node": ">=14.0.0"
},
"devDependencies": {
"aegir": "^25.0.0",
"aegir": "^33.0.0",
"it-pipe": "^1.1.0",
"libp2p-interfaces": "^0.4.0",
"sinon": "^9.0.0",
"libp2p-interfaces": "^0.9.0",
"sinon": "^10.0.1",
"streaming-iterables": "^5.0.2"
},
"dependencies": {
"abortable-iterator": "^3.0.0",
"class-is": "^1.1.0",
"debug": "^4.1.1",
"err-code": "^2.0.0",
"libp2p-utils": "^0.2.0",
"mafmt": "^8.0.0",
"multiaddr": "^8.0.0",
"debug": "^4.3.1",
"err-code": "^3.0.1",
"libp2p-utils": "^0.3.0",
"mafmt": "^8.0.4",
"multiaddr": "^9.0.1",
"stream-to-it": "^0.2.2"
},
"contributors": [
@ -54,18 +59,20 @@
"Jacob Heun <jacobheun@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Alex Potsides <alex@achingbrain.net>",
"Vasco Santos <vasco.santos@moxy.studio>",
"Alex Potsides <alex@achingbrain.net>",
"Richard Littauer <richard.littauer@gmail.com>",
"Tom White <tomtinkerer@gmail.com>",
"Alan Shaw <alan@tableflip.io>",
"Pedro Teixeira <i@pgte.me>",
"Prashanth Chandra <coolshanth94@gmail.com>",
"João Antunes <j.goncalo.antunes@gmail.com>",
"Cayman <caymannava@gmail.com>",
"Diogo Silva <fsdiogo@gmail.com>",
"Dmitriy Ryajov <dryajov@gmail.com>",
"Drew Stone <drewstone329@gmail.com>",
"Evan Schwartz <evan.mark.schwartz@gmail.com>",
"Linus Unnebäck <linus@folkdatorn.se>",
"Pedro Teixeira <i@pgte.me>",
"Prashanth Chandra <coolshanth94@gmail.com>"
"Mikeal Rogers <mikeal.rogers@gmail.com>"
]
}

View File

@ -11,12 +11,17 @@ const { multiaddrToNetConfig } = require('./utils')
const { AbortError } = require('abortable-iterator')
const { CODE_CIRCUIT, CODE_P2P } = require('./constants')
/**
* @typedef {import('multiaddr').Multiaddr} Multiaddr
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
*/
/**
* @class TCP
*/
class TCP {
/**
* @constructor
* @class
* @param {object} options
* @param {Upgrader} options.upgrader
*/
@ -31,7 +36,7 @@ class TCP {
* @async
* @param {Multiaddr} ma
* @param {object} options
* @param {AbortSignal} options.signal Used to abort dial requests
* @param {AbortSignal} options.signal - Used to abort dial requests
* @returns {Connection} An upgraded Connection
*/
async dial (ma, options) {
@ -48,7 +53,7 @@ class TCP {
* @private
* @param {Multiaddr} ma
* @param {object} options
* @param {AbortSignal} options.signal Used to abort dial requests
* @param {AbortSignal} options.signal - Used to abort dial requests
* @returns {Promise<Socket>} Resolves a TCP Socket
*/
_connect (ma, options = {}) {
@ -107,6 +112,7 @@ class TCP {
* Creates a TCP listener. The provided `handler` function will be called
* anytime a new incoming Connection has been successfully upgraded via
* `upgrader.upgradeInbound`.
*
* @param {*} [options]
* @param {function(Connection)} handler
* @returns {Listener} A TCP listener
@ -122,6 +128,7 @@ class TCP {
/**
* Takes a list of `Multiaddr`s and returns only valid TCP addresses
*
* @param {Multiaddr[]} multiaddrs
* @returns {Multiaddr[]} Valid TCP multiaddrs
*/

View File

@ -15,8 +15,9 @@ const {
/**
* Attempts to close the given maConn. If a failure occurs, it will be logged.
*
* @private
* @param {MultiaddrConnection} maConn
* @param {import('libp2p-interfaces/src/transport/types').MultiaddrConnection} maConn
*/
async function attemptClose (maConn) {
try {

View File

@ -78,7 +78,10 @@ module.exports = (socket, options) => {
resolve()
}, CLOSE_TIMEOUT)
socket.once('close', () => clearTimeout(timeout))
socket.once('close', () => {
clearTimeout(timeout)
resolve()
})
socket.end(err => {
maConn.timeline.close = Date.now()
if (err) return reject(err)

View File

@ -1,6 +1,6 @@
'use strict'
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const os = require('os')
const { resolve } = require('path')
const ProtoFamily = { ip4: 'IPv4', ip6: 'IPv6' }
@ -16,7 +16,7 @@ function multiaddrToNetConfig (addr) {
}
function getMultiaddrs (proto, ip, port) {
const toMa = ip => multiaddr(`/${proto}/${ip}/tcp/${port}`)
const toMa = ip => new Multiaddr(`/${proto}/${ip}/tcp/${port}`)
return (isAnyAddr(ip) ? getNetworkAddrs(ProtoFamily[proto]) : [ip]).map(toMa)
}
@ -26,11 +26,12 @@ function isAnyAddr (ip) {
/**
* @private
* @param {string} family One of ['IPv6', 'IPv4']
* @param {string} family - One of ['IPv6', 'IPv4']
* @returns {string[]} an array of ip address strings
*/
const networks = os.networkInterfaces()
function getNetworkAddrs (family) {
return Object.values(os.networkInterfaces()).reduce((addresses, netAddrs) => {
return Object.values(networks).reduce((addresses, netAddrs) => {
netAddrs.forEach(netAddr => {
// Add the ip of each matching network interface
if (netAddr.family === family) addresses.push(netAddr.address)

View File

@ -3,7 +3,7 @@
const sinon = require('sinon')
const tests = require('libp2p-interfaces/src/transport/tests')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const net = require('net')
const TCP = require('../src')
@ -12,9 +12,9 @@ describe('interface-transport compliance', () => {
setup ({ upgrader }) {
const tcp = new TCP({ upgrader })
const addrs = [
multiaddr('/ip4/127.0.0.1/tcp/9091'),
multiaddr('/ip4/127.0.0.1/tcp/9092'),
multiaddr('/ip4/127.0.0.1/tcp/9093')
new Multiaddr('/ip4/127.0.0.1/tcp/9091'),
new Multiaddr('/ip4/127.0.0.1/tcp/9092'),
new Multiaddr('/ip4/127.0.0.1/tcp/9093')
]
// Used by the dial tests to simulate a delayed connect

View File

@ -3,7 +3,7 @@
const { expect } = require('aegir/utils/chai')
const TCP = require('../src')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
describe('valid localAddr and remoteAddr', () => {
let tcp
@ -17,7 +17,7 @@ describe('valid localAddr and remoteAddr', () => {
tcp = new TCP({ upgrader: mockUpgrader })
})
const ma = multiaddr('/ip4/127.0.0.1/tcp/0')
const ma = new Multiaddr('/ip4/127.0.0.1/tcp/0')
it('should resolve port 0', async () => {
// Create a Promise that resolves when a connection is handled
@ -50,4 +50,38 @@ describe('valid localAddr and remoteAddr', () => {
expect(dialerConn.remoteAddr.toString())
.to.equal(listenerConn.localAddr.toString())
})
it('should handle multiple simultaneous closes', async () => {
// Create a Promise that resolves when a connection is handled
let handled
const handlerPromise = new Promise(resolve => { handled = resolve })
const handler = conn => handled(conn)
// Create a listener with the handler
const listener = tcp.createListener(handler)
// Listen on the multi-address
await listener.listen(ma)
const localAddrs = listener.getAddrs()
expect(localAddrs.length).to.equal(1)
// Dial to that address
const dialerConn = await tcp.dial(localAddrs[0])
// Wait for the incoming dial to be handled
await handlerPromise
// Close the dialer with two simultaneous calls to `close`
await Promise.race([
new Promise((resolve, reject) => setTimeout(() => reject(new Error('Timed out waiting for connection close')), 500)),
await Promise.all([
dialerConn.close(),
dialerConn.close()
])
])
await listener.close()
})
})

View File

@ -3,7 +3,7 @@
const { expect } = require('aegir/utils/chai')
const TCP = require('../src')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
describe('filter addrs', () => {
const base = '/ip4/127.0.0.1'
@ -16,14 +16,14 @@ describe('filter addrs', () => {
})
it('filter valid addrs for this transport', () => {
const ma1 = multiaddr(base + '/tcp/9090')
const ma2 = multiaddr(base + '/udp/9090')
const ma3 = multiaddr(base + '/tcp/9090/http')
const ma4 = multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const ma5 = multiaddr(base + '/tcp/9090/http' + ipfs)
const ma6 = multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs)
const ma7 = multiaddr('/dns4/libp2p.io/tcp/9090')
const ma8 = multiaddr('/dnsaddr/libp2p.io/tcp/9090')
const ma1 = new Multiaddr(base + '/tcp/9090')
const ma2 = new Multiaddr(base + '/udp/9090')
const ma3 = new Multiaddr(base + '/tcp/9090/http')
const ma4 = new Multiaddr(base + '/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const ma5 = new Multiaddr(base + '/tcp/9090/http' + ipfs)
const ma6 = new Multiaddr('/ip4/127.0.0.1/tcp/9090/p2p-circuit' + ipfs)
const ma7 = new Multiaddr('/dns4/libp2p.io/tcp/9090')
const ma8 = new Multiaddr('/dnsaddr/libp2p.io/tcp/9090')
const valid = tcp.filter([ma1, ma2, ma3, ma4, ma5, ma6, ma7, ma8])
expect(valid.length).to.equal(4)
@ -32,7 +32,7 @@ describe('filter addrs', () => {
})
it('filter a single addr for this transport', () => {
const ma1 = multiaddr(base + '/tcp/9090')
const ma1 = new Multiaddr(base + '/tcp/9090')
const valid = tcp.filter(ma1)
expect(valid.length).to.equal(1)

View File

@ -6,7 +6,7 @@ const TCP = require('../src')
const net = require('net')
const os = require('os')
const path = require('path')
const multiaddr = require('multiaddr')
const { Multiaddr } = require('multiaddr')
const pipe = require('it-pipe')
const { collect, map } = require('streaming-iterables')
const isCI = process.env.CI
@ -37,7 +37,7 @@ describe('listen', () => {
})
it('close listener with connections, through timeout', async () => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const mh = new Multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
listener = tcp.createListener((conn) => {
pipe(conn, conn)
})
@ -62,14 +62,14 @@ describe('listen', () => {
// Windows doesn't support unix paths
skipOnWindows('listen on path', async () => {
const mh = multiaddr(`/unix${path.resolve(os.tmpdir(), '/tmp/p2pd.sock')}`)
const mh = new Multiaddr(`/unix${path.resolve(os.tmpdir(), '/tmp/p2pd.sock')}`)
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
})
it('listen on port 0', async () => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/0')
const mh = new Multiaddr('/ip4/127.0.0.1/tcp/0')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
})
@ -78,19 +78,19 @@ describe('listen', () => {
if (isCI) {
return
}
const mh = multiaddr('/ip6/::/tcp/9090')
const mh = new Multiaddr('/ip6/::/tcp/9090')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
})
it('listen on any Interface', async () => {
const mh = multiaddr('/ip4/0.0.0.0/tcp/9090')
const mh = new Multiaddr('/ip4/0.0.0.0/tcp/9090')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
})
it('getAddrs', async () => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/9090')
const mh = new Multiaddr('/ip4/127.0.0.1/tcp/9090')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
@ -100,7 +100,7 @@ describe('listen', () => {
})
it('getAddrs on port 0 listen', async () => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/0')
const mh = new Multiaddr('/ip4/127.0.0.1/tcp/0')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
@ -109,7 +109,7 @@ describe('listen', () => {
})
it('getAddrs from listening on 0.0.0.0', async () => {
const mh = multiaddr('/ip4/0.0.0.0/tcp/9090')
const mh = new Multiaddr('/ip4/0.0.0.0/tcp/9090')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
@ -119,7 +119,7 @@ describe('listen', () => {
})
it('getAddrs from listening on 0.0.0.0 and port 0', async () => {
const mh = multiaddr('/ip4/0.0.0.0/tcp/0')
const mh = new Multiaddr('/ip4/0.0.0.0/tcp/0')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
@ -129,7 +129,7 @@ describe('listen', () => {
})
it('getAddrs preserves IPFS Id', async () => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const mh = new Multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
listener = tcp.createListener((conn) => {})
await listener.listen(mh)
@ -142,7 +142,7 @@ describe('listen', () => {
describe('dial', () => {
let tcp
let listener
const ma = multiaddr('/ip4/127.0.0.1/tcp/9090')
const ma = new Multiaddr('/ip4/127.0.0.1/tcp/9090')
beforeEach(async () => {
tcp = new TCP({
@ -177,7 +177,7 @@ describe('dial', () => {
return
}
const ma = multiaddr('/ip6/::/tcp/9066')
const ma = new Multiaddr('/ip6/::/tcp/9066')
const listener = tcp.createListener((conn) => {
pipe(conn, conn)
})
@ -195,7 +195,7 @@ describe('dial', () => {
// Windows doesn't support unix paths
skipOnWindows('dial on path', async () => {
const ma = multiaddr(`/unix${path.resolve(os.tmpdir(), '/tmp/p2pd.sock')}`)
const ma = new Multiaddr(`/unix${path.resolve(os.tmpdir(), '/tmp/p2pd.sock')}`)
const listener = tcp.createListener((conn) => {
pipe(conn, conn)
@ -220,7 +220,7 @@ describe('dial', () => {
handled = resolve
})
const ma = multiaddr('/ip6/::/tcp/0')
const ma = new Multiaddr('/ip6/::/tcp/0')
const listener = tcp.createListener(async (conn) => {
await pipe(
@ -248,7 +248,7 @@ describe('dial', () => {
handled = resolve
})
const ma = multiaddr('/ip6/::/tcp/0')
const ma = new Multiaddr('/ip6/::/tcp/0')
const listener = tcp.createListener(async (conn) => {
// pull(conn, pull.onEnd(destroyed))
@ -265,7 +265,7 @@ describe('dial', () => {
})
it('dial on IPv4 with IPFS Id', async () => {
const ma = multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const ma = new Multiaddr('/ip4/127.0.0.1/tcp/9090/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const conn = await tcp.dial(ma)
const res = await pipe(