@libp2p/tcp
Advanced tools
Comparing version 1.0.11 to 2.0.0
/// <reference types="node" /> | ||
import net from 'net'; | ||
import { CreateListenerOptions, DialOptions, symbol, Transport } from '@libp2p/interfaces/transport'; | ||
import { CreateListenerOptions, DialOptions, symbol, Transport } from '@libp2p/interface-transport'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
@@ -9,3 +9,3 @@ import type { AbortOptions } from '@libp2p/interfaces'; | ||
get [Symbol.toStringTag](): string; | ||
dial(ma: Multiaddr, options: DialOptions): Promise<import("@libp2p/interfaces/dist/src/connection").Connection>; | ||
dial(ma: Multiaddr, options: DialOptions): Promise<import("@libp2p/interface-connection/dist/src").Connection>; | ||
_connect(ma: Multiaddr, options?: AbortOptions): Promise<net.Socket>; | ||
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
createListener(options: CreateListenerOptions): import("@libp2p/interfaces/transport").Listener; | ||
createListener(options: CreateListenerOptions): import("@libp2p/interface-transport").Listener; | ||
/** | ||
@@ -20,0 +20,0 @@ * Takes a list of `Multiaddr`s and returns only valid TCP addresses |
@@ -10,3 +10,3 @@ import net from 'net'; | ||
import { CODE_CIRCUIT, CODE_P2P } from './constants.js'; | ||
import { symbol } from '@libp2p/interfaces/transport'; | ||
import { symbol } from '@libp2p/interface-transport'; | ||
const log = logger('libp2p:tcp'); | ||
@@ -13,0 +13,0 @@ export class TCP { |
@@ -1,3 +0,3 @@ | ||
import type { Connection } from '@libp2p/interfaces/connection'; | ||
import type { Upgrader, Listener } from '@libp2p/interfaces/transport'; | ||
import type { Connection } from '@libp2p/interface-connection'; | ||
import type { Upgrader, Listener } from '@libp2p/interface-transport'; | ||
interface Context { | ||
@@ -4,0 +4,0 @@ handler?: (conn: Connection) => void; |
import type { Socket } from 'net'; | ||
import type { Multiaddr } from '@multiformats/multiaddr'; | ||
import type { MultiaddrConnection } from '@libp2p/interfaces/transport'; | ||
import type { MultiaddrConnection } from '@libp2p/interface-connection'; | ||
interface ToConnectionOptions { | ||
@@ -14,4 +14,4 @@ listeningAddr?: Multiaddr; | ||
*/ | ||
export declare const toMultiaddrConnection: (socket: Socket, options?: ToConnectionOptions | undefined) => MultiaddrConnection; | ||
export declare const toMultiaddrConnection: (socket: Socket, options?: ToConnectionOptions) => MultiaddrConnection; | ||
export {}; | ||
//# sourceMappingURL=socket-to-conn.d.ts.map |
{ | ||
"name": "@libp2p/tcp", | ||
"version": "1.0.11", | ||
"version": "2.0.0", | ||
"description": "Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces", | ||
@@ -37,2 +37,3 @@ "license": "Apache-2.0 OR MIT", | ||
".": { | ||
"types": "./src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
@@ -139,3 +140,5 @@ } | ||
"dependencies": { | ||
"@libp2p/interfaces": "^2.0.1", | ||
"@libp2p/interface-connection": "^1.0.1", | ||
"@libp2p/interface-transport": "^1.0.0", | ||
"@libp2p/interfaces": "^3.0.2", | ||
"@libp2p/logger": "^1.1.2", | ||
@@ -150,3 +153,4 @@ "@libp2p/utils": "^1.0.9", | ||
"devDependencies": { | ||
"@libp2p/interface-compliance-tests": "^2.0.1", | ||
"@libp2p/interface-mocks": "^1.0.1", | ||
"@libp2p/interface-transport-compliance-tests": "^1.0.0", | ||
"aegir": "^37.0.4", | ||
@@ -153,0 +157,0 @@ "it-all": "^1.0.6", |
@@ -1,21 +0,14 @@ | ||
# js-libp2p-tcp <!-- omit in toc --> | ||
# @libp2p/tcp <!-- omit in toc --> | ||
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai) | ||
[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/) | ||
[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p) | ||
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io) | ||
[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-tcp.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-tcp) | ||
[![Build Status](https://github.com/libp2p/js-libp2p-tcp/actions/workflows/js-test-and-release.yml/badge.svg?branch=main)](https://github.com/libp2p/js-libp2p-tcp/actions/workflows/js-test-and-release.yml) | ||
[![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) | ||
[![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-tcp.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-tcp) | ||
[![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-tcp/actions/workflows/js-test-and-release.yml) | ||
[![](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) | ||
> Node.js implementation of the TCP module that libp2p uses, which implements the interface-connection and interface-transport interfaces | ||
> JavaScript implementation of the TCP module for libp2p. It exposes the [interface-transport](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/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. | ||
## Table of contents <!-- omit in toc --> | ||
## Table of Contents <!-- omit in toc --> | ||
- [Install](#install) | ||
- [npm](#npm) | ||
- [Usage](#usage) | ||
@@ -28,8 +21,13 @@ - [API](#api) | ||
- [License](#license) | ||
- [Contribution](#contribution) | ||
- [Contribution](#contribution) | ||
## Install | ||
### npm | ||
```console | ||
$ npm i @libp2p/tcp | ||
``` | ||
[![](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) | ||
```sh | ||
@@ -121,4 +119,4 @@ > npm install @libp2p/tcp | ||
- Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically. | ||
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs. | ||
- Go through the modules and **check out existing issues**. This is especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically. | ||
- **Perform code reviews**. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs. | ||
@@ -129,7 +127,7 @@ ## License | ||
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0) | ||
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT) | ||
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) | ||
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) | ||
### Contribution | ||
## Contribution | ||
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. |
@@ -10,3 +10,3 @@ import net from 'net' | ||
import { CODE_CIRCUIT, CODE_P2P } from './constants.js' | ||
import { CreateListenerOptions, DialOptions, symbol, Transport } from '@libp2p/interfaces/transport' | ||
import { CreateListenerOptions, DialOptions, symbol, Transport } from '@libp2p/interface-transport' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
@@ -13,0 +13,0 @@ import type { Socket } from 'net' |
@@ -10,4 +10,4 @@ import net from 'net' | ||
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events' | ||
import type { Connection } from '@libp2p/interfaces/connection' | ||
import type { MultiaddrConnection, Upgrader, Listener } from '@libp2p/interfaces/transport' | ||
import type { MultiaddrConnection, Connection } from '@libp2p/interface-connection' | ||
import type { Upgrader, Listener } from '@libp2p/interface-transport' | ||
import type { Server } from 'net' | ||
@@ -14,0 +14,0 @@ import type { Multiaddr } from '@multiformats/multiaddr' |
@@ -9,3 +9,3 @@ import { abortableSource } from 'abortable-iterator' | ||
import type { Multiaddr } from '@multiformats/multiaddr' | ||
import type { MultiaddrConnection } from '@libp2p/interfaces/transport' | ||
import type { MultiaddrConnection } from '@libp2p/interface-connection' | ||
@@ -12,0 +12,0 @@ const log = logger('libp2p:tcp:socket') |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54381
10
7
131
+ Added@libp2p/interface-connection@1.0.13.1.1(transitive)
+ Added@libp2p/interface-peer-id@1.1.22.0.2(transitive)
+ Added@libp2p/interface-transport@1.0.4(transitive)
+ Added@libp2p/interfaces@3.3.2(transitive)
+ Added@multiformats/multiaddr@11.6.1(transitive)
+ Addedmultiformats@10.0.311.0.212.1.3(transitive)
+ Addeduint8arrays@4.0.10(transitive)
Updated@libp2p/interfaces@^3.0.2