diff --git a/README.md b/README.md index d1f097f2..3ec2f0f7 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,17 @@ # js-libp2p-daemon [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-daemon.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-daemon) -[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-daemon/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) > Standalone libp2p executable ## Table of contents - [Structure](#structure) -- [Contribute](#contribute) - [License](#license) -- [Contribution](#contribution) +- [Contribute](#contribute) ## Structure @@ -22,14 +20,6 @@ - [`/packages/libp2p-daemon-protocol`](./packages/libp2p-daemon-protocol) Communication protocol between libp2p daemons and clients - [`/packages/libp2p-daemon-server`](./packages/libp2p-daemon-server) API server for libp2p-daemon instances -## Contribute - -Feel free to join in. All welcome. Open an [issue](https://github.com/libp2p/js-interfaces/issues)! - -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). - -[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md) - ## License Licensed under either of @@ -37,6 +27,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/lerna.json b/lerna.json index d7a23368..fe9f1a3a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,10 +1,13 @@ { - "lerna": "4.0.0", + "lerna": "5.4.0", "useWorkspaces": true, "version": "independent", "command": { "run": { "stream": true } - } + }, + "packages": [ + "packages/*" + ] } diff --git a/package.json b/package.json index 245e468d..5bd271cf 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "release": "lerna run --concurrency 1 release -- --" }, "dependencies": { - "lerna": "^5.1.2", + "lerna": "^6.0.0", "rimraf": "^3.0.2" }, "workspaces": [ diff --git a/packages/libp2p-daemon-client/README.md b/packages/libp2p-daemon-client/README.md index 2c420efc..aac966e2 100644 --- a/packages/libp2p-daemon-client/README.md +++ b/packages/libp2p-daemon-client/README.md @@ -1,10 +1,9 @@ # @libp2p/daemon-client [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-daemon.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-daemon) -[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-daemon/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) > libp2p-daemon client implementation @@ -16,9 +15,8 @@ - [Run a daemon process](#run-a-daemon-process) - [Interact with the daemon process using the client](#interact-with-the-daemon-process-using-the-client) - [API](#api) -- [Contribute](#contribute) - [License](#license) -- [Contribution](#contribution) +- [Contribute](#contribute) ## Install @@ -77,10 +75,6 @@ await client.close() - [`dht.getClosestPeers`](API.md#dht.getClosestPeers) - [`dht.getPublicKey`](API.md#dht.getPublicKey) -## Contribute - -This module is actively under development. Please check out the issues and submit PRs! - ## License Licensed under either of @@ -88,6 +82,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/libp2p-daemon-client/package.json b/packages/libp2p-daemon-client/package.json index 6232abd6..42bf42b8 100644 --- a/packages/libp2p-daemon-client/package.json +++ b/packages/libp2p-daemon-client/package.json @@ -137,13 +137,14 @@ "@libp2p/daemon-protocol": "^3.0.0", "@libp2p/interface-peer-id": "^1.0.2", "@libp2p/interface-peer-info": "^1.0.1", + "@libp2p/interface-transport": "^2.0.0", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.10", - "@libp2p/tcp": "^4.0.1", + "@libp2p/tcp": "^5.0.0", "@multiformats/multiaddr": "^11.0.0", "err-code": "^3.0.1", "it-stream-types": "^1.0.4", - "multiformats": "^9.6.4", + "multiformats": "^10.0.0", "uint8arraylist": "^2.3.2" }, "devDependencies": { @@ -151,15 +152,15 @@ "@libp2p/daemon-server": "^3.0.0", "@libp2p/interface-compliance-tests": "^3.0.1", "@libp2p/interface-dht": "^1.0.0", - "@libp2p/interface-mocks": "^6.0.0", + "@libp2p/interface-mocks": "^7.0.1", "@libp2p/interface-peer-store": "^1.0.0", - "@libp2p/interface-pubsub": "^2.0.1", + "@libp2p/interface-pubsub": "^3.0.0", "@libp2p/peer-id-factory": "^1.0.9", "aegir": "^37.2.0", "it-all": "^1.0.6", "it-pipe": "^2.0.3", "sinon": "^14.0.0", - "ts-sinon": "^2.0.2", - "uint8arrays": "^3.0.0" + "sinon-ts": "^0.0.2", + "uint8arrays": "^4.0.2" } } diff --git a/packages/libp2p-daemon-client/src/index.ts b/packages/libp2p-daemon-client/src/index.ts index 20d3b01a..25809fe6 100644 --- a/packages/libp2p-daemon-client/src/index.ts +++ b/packages/libp2p-daemon-client/src/index.ts @@ -1,5 +1,5 @@ import errcode from 'err-code' -import { TCP } from '@libp2p/tcp' +import { tcp } from '@libp2p/tcp' import { PSMessage, Request, Response, StreamInfo } from '@libp2p/daemon-protocol' import { StreamHandler } from '@libp2p/daemon-protocol/stream-handler' import type { Multiaddr } from '@multiformats/multiaddr' @@ -15,6 +15,7 @@ import type { PeerInfo } from '@libp2p/interface-peer-info' import type { MultiaddrConnection } from '@libp2p/interface-connection' import type { Uint8ArrayList } from 'uint8arraylist' import { logger } from '@libp2p/logger' +import type { Transport } from '@libp2p/interface-transport' const log = logger('libp2p:daemon-client') @@ -22,11 +23,11 @@ class Client implements DaemonClient { private readonly multiaddr: Multiaddr public dht: DHT public pubsub: Pubsub - private readonly tcp: TCP + private readonly tcp: Transport constructor (addr: Multiaddr) { this.multiaddr = addr - this.tcp = new TCP() + this.tcp = tcp()() this.dht = new DHT(this) this.pubsub = new Pubsub(this) } diff --git a/packages/libp2p-daemon-client/test/dht.spec.ts b/packages/libp2p-daemon-client/test/dht.spec.ts index 280d9c0c..bae2f4ad 100644 --- a/packages/libp2p-daemon-client/test/dht.spec.ts +++ b/packages/libp2p-daemon-client/test/dht.spec.ts @@ -6,7 +6,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server' import { createClient, DaemonClient } from '../src/index.js' import { multiaddr } from '@multiformats/multiaddr' -import { StubbedInstance, stubInterface } from 'ts-sinon' +import { StubbedInstance, stubInterface } from 'sinon-ts' import { DualDHT, ValueEvent, FinalPeerEvent, PeerResponseEvent, MessageType, EventTypes } from '@libp2p/interface-dht' import { peerIdFromString } from '@libp2p/peer-id' import { CID } from 'multiformats/cid' @@ -14,6 +14,10 @@ import all from 'it-all' const defaultMultiaddr = multiaddr('/ip4/0.0.0.0/tcp/12345') +function match (cid: CID) { + return sinon.match((c: CID) => c.toString() === cid.toString(), 'cid') +} + describe('daemon dht client', function () { this.timeout(30e3) @@ -138,7 +142,7 @@ describe('daemon dht client', function () { await client.dht.provide(cid) - expect(dht.provide.calledWith(cid)).to.be.true() + expect(dht.provide.calledWith(match(cid))).to.be.true() }) it('should error if receive an error message', async () => { @@ -157,7 +161,7 @@ describe('daemon dht client', function () { const cid = CID.parse('QmVzw6MPsF96TyXBSRs1ptLoVMWRv5FCYJZZGJSVB2Hp38') const id = peerIdFromString('12D3KooWJKCJW8Y26pRFNv78TCMGLNTfyN8oKaFswMRYXTzSbSsa') - dht.findProviders.withArgs(cid).returns(async function * () { + dht.findProviders.withArgs(match(cid)).returns(async function * () { const event: PeerResponseEvent = { name: 'PEER_RESPONSE', type: EventTypes.PEER_RESPONSE, diff --git a/packages/libp2p-daemon-client/test/index.spec.ts b/packages/libp2p-daemon-client/test/index.spec.ts index 1bd2eda3..1b7fca4a 100644 --- a/packages/libp2p-daemon-client/test/index.spec.ts +++ b/packages/libp2p-daemon-client/test/index.spec.ts @@ -5,7 +5,7 @@ import sinon from 'sinon' import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server' import { createClient, DaemonClient } from '../src/index.js' import { multiaddr } from '@multiformats/multiaddr' -import { StubbedInstance, stubInterface } from 'ts-sinon' +import { StubbedInstance, stubInterface } from 'sinon-ts' import { isPeerId } from '@libp2p/interface-peer-id' import { peerIdFromString } from '@libp2p/peer-id' import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-mocks' diff --git a/packages/libp2p-daemon-client/test/pubsub.spec.ts b/packages/libp2p-daemon-client/test/pubsub.spec.ts index 10242e11..07cb1087 100644 --- a/packages/libp2p-daemon-client/test/pubsub.spec.ts +++ b/packages/libp2p-daemon-client/test/pubsub.spec.ts @@ -6,7 +6,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server' import { createClient, DaemonClient } from '../src/index.js' import { multiaddr } from '@multiformats/multiaddr' -import { StubbedInstance, stubInterface } from 'ts-sinon' +import { StubbedInstance, stubInterface } from 'sinon-ts' import type { PubSub } from '@libp2p/interface-pubsub' const defaultMultiaddr = multiaddr('/ip4/0.0.0.0/tcp/12345') diff --git a/packages/libp2p-daemon-client/test/stream.spec.ts b/packages/libp2p-daemon-client/test/stream.spec.ts index d3159a21..b9806b43 100644 --- a/packages/libp2p-daemon-client/test/stream.spec.ts +++ b/packages/libp2p-daemon-client/test/stream.spec.ts @@ -5,7 +5,7 @@ import sinon from 'sinon' import { createServer, Libp2p, Libp2pServer } from '@libp2p/daemon-server' import { createClient, DaemonClient } from '../src/index.js' import { multiaddr } from '@multiformats/multiaddr' -import { StubbedInstance, stubInterface } from 'ts-sinon' +import { StubbedInstance, stubInterface } from 'sinon-ts' import { peerIdFromString } from '@libp2p/peer-id' import { mockRegistrar, connectionPair } from '@libp2p/interface-mocks' import type { PeerStore, AddressBook } from '@libp2p/interface-peer-store' diff --git a/packages/libp2p-daemon-protocol/README.md b/packages/libp2p-daemon-protocol/README.md index 416a5b0c..4efc24d3 100644 --- a/packages/libp2p-daemon-protocol/README.md +++ b/packages/libp2p-daemon-protocol/README.md @@ -1,19 +1,17 @@ # @libp2p/daemon-protocol [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-daemon.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-daemon) -[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-daemon/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) > Communication protocol between libp2p daemons and clients ## Table of contents - [Install](#install) -- [Contribute](#contribute) - [License](#license) -- [Contribution](#contribution) +- [Contribute](#contribute) ## Install @@ -21,10 +19,6 @@ $ npm i @libp2p/daemon-protocol ``` -## Contribute - -This module is actively under development. Please check out the issues and submit PRs! - ## License Licensed under either of @@ -32,6 +26,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/libp2p-daemon-protocol/package.json b/packages/libp2p-daemon-protocol/package.json index 62efab9e..b7e929ac 100644 --- a/packages/libp2p-daemon-protocol/package.json +++ b/packages/libp2p-daemon-protocol/package.json @@ -159,11 +159,11 @@ "dependencies": { "@libp2p/interface-transport": "^2.0.0", "it-handshake": "^4.0.0", - "protons-runtime": "^3.0.1", + "protons-runtime": "^4.0.1", "uint8arraylist": "^2.3.2" }, "devDependencies": { "aegir": "^37.2.0", - "protons": "^5.0.0" + "protons": "^6.0.0" } } diff --git a/packages/libp2p-daemon-protocol/src/index.ts b/packages/libp2p-daemon-protocol/src/index.ts index e7e70ecc..f3728c14 100644 --- a/packages/libp2p-daemon-protocol/src/index.ts +++ b/packages/libp2p-daemon-protocol/src/index.ts @@ -1,5 +1,7 @@ /* eslint-disable import/export */ +/* eslint-disable complexity */ /* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime' import type { Uint8ArrayList } from 'uint8arraylist' @@ -54,60 +56,74 @@ export namespace Request { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - Request.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + Request.Type.codec().encode(obj.type, w) } if (obj.connect != null) { - writer.uint32(18) - ConnectRequest.codec().encode(obj.connect, writer) + w.uint32(18) + ConnectRequest.codec().encode(obj.connect, w, { + writeDefaults: false + }) } if (obj.streamOpen != null) { - writer.uint32(26) - StreamOpenRequest.codec().encode(obj.streamOpen, writer) + w.uint32(26) + StreamOpenRequest.codec().encode(obj.streamOpen, w, { + writeDefaults: false + }) } if (obj.streamHandler != null) { - writer.uint32(34) - StreamHandlerRequest.codec().encode(obj.streamHandler, writer) + w.uint32(34) + StreamHandlerRequest.codec().encode(obj.streamHandler, w, { + writeDefaults: false + }) } if (obj.dht != null) { - writer.uint32(42) - DHTRequest.codec().encode(obj.dht, writer) + w.uint32(42) + DHTRequest.codec().encode(obj.dht, w, { + writeDefaults: false + }) } if (obj.connManager != null) { - writer.uint32(50) - ConnManagerRequest.codec().encode(obj.connManager, writer) + w.uint32(50) + ConnManagerRequest.codec().encode(obj.connManager, w, { + writeDefaults: false + }) } if (obj.disconnect != null) { - writer.uint32(58) - DisconnectRequest.codec().encode(obj.disconnect, writer) + w.uint32(58) + DisconnectRequest.codec().encode(obj.disconnect, w, { + writeDefaults: false + }) } if (obj.pubsub != null) { - writer.uint32(66) - PSRequest.codec().encode(obj.pubsub, writer) + w.uint32(66) + PSRequest.codec().encode(obj.pubsub, w, { + writeDefaults: false + }) } if (obj.peerStore != null) { - writer.uint32(74) - PeerstoreRequest.codec().encode(obj.peerStore, writer) + w.uint32(74) + PeerstoreRequest.codec().encode(obj.peerStore, w, { + writeDefaults: false + }) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -153,10 +169,6 @@ export namespace Request { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -205,59 +217,69 @@ export namespace Response { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - Response.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + Response.Type.codec().encode(obj.type, w) } if (obj.error != null) { - writer.uint32(18) - ErrorResponse.codec().encode(obj.error, writer) + w.uint32(18) + ErrorResponse.codec().encode(obj.error, w, { + writeDefaults: false + }) } if (obj.streamInfo != null) { - writer.uint32(26) - StreamInfo.codec().encode(obj.streamInfo, writer) + w.uint32(26) + StreamInfo.codec().encode(obj.streamInfo, w, { + writeDefaults: false + }) } if (obj.identify != null) { - writer.uint32(34) - IdentifyResponse.codec().encode(obj.identify, writer) + w.uint32(34) + IdentifyResponse.codec().encode(obj.identify, w, { + writeDefaults: false + }) } if (obj.dht != null) { - writer.uint32(42) - DHTResponse.codec().encode(obj.dht, writer) + w.uint32(42) + DHTResponse.codec().encode(obj.dht, w, { + writeDefaults: false + }) } if (obj.peers != null) { for (const value of obj.peers) { - writer.uint32(50) - PeerInfo.codec().encode(value, writer) + w.uint32(50) + PeerInfo.codec().encode(value, w, { + writeDefaults: true + }) } - } else { - throw new Error('Protocol error: required field "peers" was not found in object') } if (obj.pubsub != null) { - writer.uint32(58) - PSResponse.codec().encode(obj.pubsub, writer) + w.uint32(58) + PSResponse.codec().encode(obj.pubsub, w, { + writeDefaults: false + }) } if (obj.peerStore != null) { - writer.uint32(66) - PeerstoreResponse.codec().encode(obj.peerStore, writer) + w.uint32(66) + PeerstoreResponse.codec().encode(obj.peerStore, w, { + writeDefaults: false + }) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -301,10 +323,6 @@ export namespace Response { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -331,29 +349,25 @@ export namespace IdentifyResponse { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.id != null) { - writer.uint32(10) - writer.bytes(obj.id) - } else { - throw new Error('Protocol error: required field "id" was not found in object') + if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.id) } if (obj.addrs != null) { for (const value of obj.addrs) { - writer.uint32(18) - writer.bytes(value) + w.uint32(18) + w.bytes(value) } - } else { - throw new Error('Protocol error: required field "addrs" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -379,10 +393,6 @@ export namespace IdentifyResponse { } } - if (obj.id == null) { - throw new Error('Protocol error: value for required field "id" was not found in protobuf') - } - return obj }) } @@ -410,34 +420,30 @@ export namespace ConnectRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.peer != null) { - writer.uint32(10) - writer.bytes(obj.peer) - } else { - throw new Error('Protocol error: required field "peer" was not found in object') + if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.peer) } if (obj.addrs != null) { for (const value of obj.addrs) { - writer.uint32(18) - writer.bytes(value) + w.uint32(18) + w.bytes(value) } - } else { - throw new Error('Protocol error: required field "addrs" was not found in object') } if (obj.timeout != null) { - writer.uint32(24) - writer.int64(obj.timeout) + w.uint32(24) + w.int64(obj.timeout) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -466,10 +472,6 @@ export namespace ConnectRequest { } } - if (obj.peer == null) { - throw new Error('Protocol error: value for required field "peer" was not found in protobuf') - } - return obj }) } @@ -497,34 +499,30 @@ export namespace StreamOpenRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.peer != null) { - writer.uint32(10) - writer.bytes(obj.peer) - } else { - throw new Error('Protocol error: required field "peer" was not found in object') + if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.peer) } if (obj.proto != null) { for (const value of obj.proto) { - writer.uint32(18) - writer.string(value) + w.uint32(18) + w.string(value) } - } else { - throw new Error('Protocol error: required field "proto" was not found in object') } if (obj.timeout != null) { - writer.uint32(24) - writer.int64(obj.timeout) + w.uint32(24) + w.int64(obj.timeout) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -553,10 +551,6 @@ export namespace StreamOpenRequest { } } - if (obj.peer == null) { - throw new Error('Protocol error: value for required field "peer" was not found in protobuf') - } - return obj }) } @@ -583,29 +577,25 @@ export namespace StreamHandlerRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.addr != null) { - writer.uint32(10) - writer.bytes(obj.addr) - } else { - throw new Error('Protocol error: required field "addr" was not found in object') + if (opts.writeDefaults === true || (obj.addr != null && obj.addr.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.addr) } if (obj.proto != null) { for (const value of obj.proto) { - writer.uint32(18) - writer.string(value) + w.uint32(18) + w.string(value) } - } else { - throw new Error('Protocol error: required field "proto" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -631,10 +621,6 @@ export namespace StreamHandlerRequest { } } - if (obj.addr == null) { - throw new Error('Protocol error: value for required field "addr" was not found in protobuf') - } - return obj }) } @@ -660,20 +646,18 @@ export namespace ErrorResponse { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.msg != null) { - writer.uint32(10) - writer.string(obj.msg) - } else { - throw new Error('Protocol error: required field "msg" was not found in object') + if (opts.writeDefaults === true || obj.msg !== '') { + w.uint32(10) + w.string(obj.msg) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -695,10 +679,6 @@ export namespace ErrorResponse { } } - if (obj.msg == null) { - throw new Error('Protocol error: value for required field "msg" was not found in protobuf') - } - return obj }) } @@ -726,34 +706,28 @@ export namespace StreamInfo { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.peer != null) { - writer.uint32(10) - writer.bytes(obj.peer) - } else { - throw new Error('Protocol error: required field "peer" was not found in object') + if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.peer) } - if (obj.addr != null) { - writer.uint32(18) - writer.bytes(obj.addr) - } else { - throw new Error('Protocol error: required field "addr" was not found in object') + if (opts.writeDefaults === true || (obj.addr != null && obj.addr.byteLength > 0)) { + w.uint32(18) + w.bytes(obj.addr) } - if (obj.proto != null) { - writer.uint32(26) - writer.string(obj.proto) - } else { - throw new Error('Protocol error: required field "proto" was not found in object') + if (opts.writeDefaults === true || obj.proto !== '') { + w.uint32(26) + w.string(obj.proto) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -783,18 +757,6 @@ export namespace StreamInfo { } } - if (obj.peer == null) { - throw new Error('Protocol error: value for required field "peer" was not found in protobuf') - } - - if (obj.addr == null) { - throw new Error('Protocol error: value for required field "addr" was not found in protobuf') - } - - if (obj.proto == null) { - throw new Error('Protocol error: value for required field "proto" was not found in protobuf') - } - return obj }) } @@ -856,50 +818,48 @@ export namespace DHTRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - DHTRequest.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + DHTRequest.Type.codec().encode(obj.type, w) } if (obj.peer != null) { - writer.uint32(18) - writer.bytes(obj.peer) + w.uint32(18) + w.bytes(obj.peer) } if (obj.cid != null) { - writer.uint32(26) - writer.bytes(obj.cid) + w.uint32(26) + w.bytes(obj.cid) } if (obj.key != null) { - writer.uint32(34) - writer.bytes(obj.key) + w.uint32(34) + w.bytes(obj.key) } if (obj.value != null) { - writer.uint32(42) - writer.bytes(obj.value) + w.uint32(42) + w.bytes(obj.value) } if (obj.count != null) { - writer.uint32(48) - writer.int32(obj.count) + w.uint32(48) + w.int32(obj.count) } if (obj.timeout != null) { - writer.uint32(56) - writer.int64(obj.timeout) + w.uint32(56) + w.int64(obj.timeout) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -939,10 +899,6 @@ export namespace DHTRequest { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -988,30 +944,30 @@ export namespace DHTResponse { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - DHTResponse.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + DHTResponse.Type.codec().encode(obj.type, w) } if (obj.peer != null) { - writer.uint32(18) - PeerInfo.codec().encode(obj.peer, writer) + w.uint32(18) + PeerInfo.codec().encode(obj.peer, w, { + writeDefaults: false + }) } if (obj.value != null) { - writer.uint32(26) - writer.bytes(obj.value) + w.uint32(26) + w.bytes(obj.value) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1039,10 +995,6 @@ export namespace DHTResponse { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -1069,29 +1021,25 @@ export namespace PeerInfo { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.id != null) { - writer.uint32(10) - writer.bytes(obj.id) - } else { - throw new Error('Protocol error: required field "id" was not found in object') + if (opts.writeDefaults === true || (obj.id != null && obj.id.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.id) } if (obj.addrs != null) { for (const value of obj.addrs) { - writer.uint32(18) - writer.bytes(value) + w.uint32(18) + w.bytes(value) } - } else { - throw new Error('Protocol error: required field "addrs" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1117,10 +1065,6 @@ export namespace PeerInfo { } } - if (obj.id == null) { - throw new Error('Protocol error: value for required field "id" was not found in protobuf') - } - return obj }) } @@ -1167,35 +1111,33 @@ export namespace ConnManagerRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - ConnManagerRequest.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + ConnManagerRequest.Type.codec().encode(obj.type, w) } if (obj.peer != null) { - writer.uint32(18) - writer.bytes(obj.peer) + w.uint32(18) + w.bytes(obj.peer) } if (obj.tag != null) { - writer.uint32(26) - writer.string(obj.tag) + w.uint32(26) + w.string(obj.tag) } if (obj.weight != null) { - writer.uint32(32) - writer.int64(obj.weight) + w.uint32(32) + w.int64(obj.weight) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1226,10 +1168,6 @@ export namespace ConnManagerRequest { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -1255,20 +1193,18 @@ export namespace DisconnectRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.peer != null) { - writer.uint32(10) - writer.bytes(obj.peer) - } else { - throw new Error('Protocol error: required field "peer" was not found in object') + if (opts.writeDefaults === true || (obj.peer != null && obj.peer.byteLength > 0)) { + w.uint32(10) + w.bytes(obj.peer) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1290,10 +1226,6 @@ export namespace DisconnectRequest { } } - if (obj.peer == null) { - throw new Error('Protocol error: value for required field "peer" was not found in protobuf') - } - return obj }) } @@ -1341,30 +1273,28 @@ export namespace PSRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - PSRequest.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + PSRequest.Type.codec().encode(obj.type, w) } if (obj.topic != null) { - writer.uint32(18) - writer.string(obj.topic) + w.uint32(18) + w.string(obj.topic) } if (obj.data != null) { - writer.uint32(26) - writer.bytes(obj.data) + w.uint32(26) + w.bytes(obj.data) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1392,10 +1322,6 @@ export namespace PSRequest { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -1426,47 +1352,45 @@ export namespace PSMessage { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } if (obj.from != null) { - writer.uint32(10) - writer.bytes(obj.from) + w.uint32(10) + w.bytes(obj.from) } if (obj.data != null) { - writer.uint32(18) - writer.bytes(obj.data) + w.uint32(18) + w.bytes(obj.data) } if (obj.seqno != null) { - writer.uint32(26) - writer.bytes(obj.seqno) + w.uint32(26) + w.bytes(obj.seqno) } if (obj.topicIDs != null) { for (const value of obj.topicIDs) { - writer.uint32(34) - writer.string(value) + w.uint32(34) + w.string(value) } - } else { - throw new Error('Protocol error: required field "topicIDs" was not found in object') } if (obj.signature != null) { - writer.uint32(42) - writer.bytes(obj.signature) + w.uint32(42) + w.bytes(obj.signature) } if (obj.key != null) { - writer.uint32(50) - writer.bytes(obj.key) + w.uint32(50) + w.bytes(obj.key) } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1529,31 +1453,27 @@ export namespace PSResponse { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } if (obj.topics != null) { for (const value of obj.topics) { - writer.uint32(10) - writer.string(value) + w.uint32(10) + w.string(value) } - } else { - throw new Error('Protocol error: required field "topics" was not found in object') } if (obj.peerIDs != null) { for (const value of obj.peerIDs) { - writer.uint32(18) - writer.bytes(value) + w.uint32(18) + w.bytes(value) } - } else { - throw new Error('Protocol error: required field "peerIDs" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1624,34 +1544,30 @@ export namespace PeerstoreRequest { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } - if (obj.type != null) { - writer.uint32(8) - PeerstoreRequest.Type.codec().encode(obj.type, writer) - } else { - throw new Error('Protocol error: required field "type" was not found in object') + if (opts.writeDefaults === true || (obj.type != null && __TypeValues[obj.type] !== 0)) { + w.uint32(8) + PeerstoreRequest.Type.codec().encode(obj.type, w) } if (obj.id != null) { - writer.uint32(18) - writer.bytes(obj.id) + w.uint32(18) + w.bytes(obj.id) } if (obj.protos != null) { for (const value of obj.protos) { - writer.uint32(26) - writer.string(value) + w.uint32(26) + w.string(value) } - } else { - throw new Error('Protocol error: required field "protos" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { @@ -1680,10 +1596,6 @@ export namespace PeerstoreRequest { } } - if (obj.type == null) { - throw new Error('Protocol error: value for required field "type" was not found in protobuf') - } - return obj }) } @@ -1710,27 +1622,27 @@ export namespace PeerstoreResponse { export const codec = (): Codec => { if (_codec == null) { - _codec = message((obj, writer, opts = {}) => { + _codec = message((obj, w, opts = {}) => { if (opts.lengthDelimited !== false) { - writer.fork() + w.fork() } if (obj.peer != null) { - writer.uint32(10) - PeerInfo.codec().encode(obj.peer, writer) + w.uint32(10) + PeerInfo.codec().encode(obj.peer, w, { + writeDefaults: false + }) } if (obj.protos != null) { for (const value of obj.protos) { - writer.uint32(18) - writer.string(value) + w.uint32(18) + w.string(value) } - } else { - throw new Error('Protocol error: required field "protos" was not found in object') } if (opts.lengthDelimited !== false) { - writer.ldelim() + w.ldelim() } }, (reader, length) => { const obj: any = { diff --git a/packages/libp2p-daemon-server/README.md b/packages/libp2p-daemon-server/README.md index 2d749e3b..22679b62 100644 --- a/packages/libp2p-daemon-server/README.md +++ b/packages/libp2p-daemon-server/README.md @@ -1,10 +1,9 @@ # @libp2p/daemon-server [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-daemon.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-daemon) -[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-daemon/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) > API server for libp2p-daemon instances @@ -13,9 +12,8 @@ - [Install](#install) - [Specs](#specs) - [Usage](#usage) -- [Contribute](#contribute) - [License](#license) -- [Contribution](#contribution) +- [Contribute](#contribute) ## Install @@ -44,10 +42,6 @@ const server = await createServer(multiaddr, libp2p) await server.start() ``` -## Contribute - -This module is actively under development. Please check out the issues and submit PRs! - ## License Licensed under either of @@ -55,6 +49,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/packages/libp2p-daemon-server/package.json b/packages/libp2p-daemon-server/package.json index 3d133c25..904e1d04 100644 --- a/packages/libp2p-daemon-server/package.json +++ b/packages/libp2p-daemon-server/package.json @@ -147,18 +147,18 @@ "@libp2p/interfaces": "^3.0.2", "@libp2p/logger": "^2.0.0", "@libp2p/peer-id": "^1.1.10", - "@libp2p/tcp": "^4.0.1", + "@libp2p/tcp": "^5.0.0", "@multiformats/multiaddr": "^11.0.0", "it-drain": "^1.0.5", "it-length-prefixed": "^8.0.2", "it-pipe": "^2.0.3", "it-pushable": "^3.0.0", - "multiformats": "^9.6.4", - "uint8arrays": "^3.0.0" + "multiformats": "^10.0.0", + "uint8arrays": "^4.0.2" }, "devDependencies": { "aegir": "^37.2.0", "sinon": "^14.0.0", - "ts-sinon": "^2.0.2" + "sinon-ts": "^0.0.2" } } diff --git a/packages/libp2p-daemon-server/src/index.ts b/packages/libp2p-daemon-server/src/index.ts index e48bbf46..1dc3e7a5 100644 --- a/packages/libp2p-daemon-server/src/index.ts +++ b/packages/libp2p-daemon-server/src/index.ts @@ -1,6 +1,6 @@ /* eslint max-depth: ["error", 6] */ -import { TCP } from '@libp2p/tcp' +import { tcp } from '@libp2p/tcp' import { multiaddr, protocols } from '@multiformats/multiaddr' import type { Multiaddr } from '@multiformats/multiaddr' import { CID } from 'multiformats/cid' @@ -15,7 +15,7 @@ import { PSRequest, StreamInfo } from '@libp2p/daemon-protocol' -import type { Listener } from '@libp2p/interface-transport' +import type { Listener, Transport } from '@libp2p/interface-transport' import type { Connection, MultiaddrConnection, Stream } from '@libp2p/interface-connection' import type { PeerId } from '@libp2p/interface-peer-id' import type { AbortOptions } from '@libp2p/interfaces' @@ -66,7 +66,7 @@ export interface Libp2pServer { export class Server implements Libp2pServer { private readonly multiaddr: Multiaddr private readonly libp2p: Libp2p - private readonly tcp: TCP + private readonly tcp: Transport private readonly listener: Listener private readonly dhtOperations?: DHTOperations private readonly pubsubOperations?: PubSubOperations @@ -76,7 +76,7 @@ export class Server implements Libp2pServer { this.multiaddr = multiaddr this.libp2p = libp2pNode - this.tcp = new TCP() + this.tcp = tcp()() this.listener = this.tcp.createListener({ handler: this.handleConnection.bind(this), upgrader: passThroughUpgrader diff --git a/packages/libp2p-daemon-server/test/index.spec.ts b/packages/libp2p-daemon-server/test/index.spec.ts index fc24faa2..3b1a7aad 100644 --- a/packages/libp2p-daemon-server/test/index.spec.ts +++ b/packages/libp2p-daemon-server/test/index.spec.ts @@ -4,7 +4,7 @@ import { multiaddr } from '@multiformats/multiaddr' import { expect } from 'aegir/chai' import { createServer, Libp2p } from '../src/index.js' -import { stubInterface } from 'ts-sinon' +import { stubInterface } from 'sinon-ts' const ma = multiaddr('/ip4/0.0.0.0/tcp/0') diff --git a/packages/libp2p-daemon/README.md b/packages/libp2p-daemon/README.md index d262a0b1..db24c0a3 100644 --- a/packages/libp2p-daemon/README.md +++ b/packages/libp2p-daemon/README.md @@ -1,10 +1,9 @@ # @libp2p/daemon [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) -[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-daemon.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-daemon) -[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) +[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-daemon/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-daemon/actions/workflows/js-test-and-release.yml) > libp2p-daemon JavaScript implementation @@ -13,9 +12,8 @@ - [Install](#install) - [Specs](#specs) - [Usage](#usage) -- [Contribute](#contribute) - [License](#license) -- [Contribution](#contribution) +- [Contribute](#contribute) ## Install @@ -43,10 +41,6 @@ As an alternative, you can use this daemon with a different version of libp2p as $ LIBP2P_JS=/path/to/js-libp2p/src/index.js jsp2pd ``` -## Contribute - -This module is actively under development. Please check out the issues and submit PRs! - ## License Licensed under either of @@ -54,6 +48,6 @@ Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribution +## Contribute Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.