Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions circular-dependency-resolution.md

This file was deleted.

73 changes: 0 additions & 73 deletions node-lightning-migration-summary.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/bitcoind/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @node-lightning/bitcoind
# @node-dlc/bitcoind

This package provides connectivity to a bitcoind node by enabling RPC functions
and Zeromq streaming.
Expand Down
52 changes: 26 additions & 26 deletions packages/bufio/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Utilities for Buffer IO

[![CircleCI](https://circleci.com/gh/altangent/node-lightning/tree/master.svg?style=shield)](https://circleci.com/gh/altangent/node-lightning/tree/master)
[![codecov](https://codecov.io/gh/altangent/node-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/altangent/node-lightning)
[![CircleCI](https://circleci.com/gh/atomicfinance/node-dlc/tree/master.svg?style=shield)](https://circleci.com/gh/atomicfinance/node-dlc/tree/master)
[![codecov](https://codecov.io/gh/atomicfinance/node-dlc/branch/master/graph/badge.svg)](https://codecov.io/gh/atomicfinance/node-dlc)

Usage:

```bash
npm install @node-lightning/bufio
npm install @node-dlc/bufio
```

```javascript
const { BufferReader, BufferWriter } = require("@node-lightning/bufio");
const { BufferReader, BufferWriter } = require("@node-dlc/bufio");

// write arbitrary length data
const writer = new BufferWriter();
Expand All @@ -32,21 +32,21 @@ console.log(buffer.readBytes());

This class wraps an existing Buffer and allows reading data from the Buffer. This class includes

- `position: number` - the current buffer cursor position
- `eof: bool` - whether the current position is at the end of the buffer
- `buffer: Buffer` - the underlying buffer
- `lastReadBytes` - number of bytes last read from the buffer
- `position: number` - the current buffer cursor position
- `eof: bool` - whether the current position is at the end of the buffer
- `buffer: Buffer` - the underlying buffer
- `lastReadBytes` - number of bytes last read from the buffer

- `readUInt8(): number` - reads 1 byte
- `readUInt16LE(): number` - reads 2 bytes as 16-bit little-endian unsigned integer
- `readUInt16BE(): number` - reads 2 bytes as 16-bit big-endian unsigned integer
- `readUInt32LE(): number` - reads 4 bytes as 32-bit little-endian unsigned integer
- `readUInt32BE(): number` - reads 4 bytes as 32-bit big-endian unsigned integer
- `readUInt64LE(): bigint` - reads 8 bytes as 64-bit little-endian unsigned integer
- `readUInt64BE(): bigint` - reads 8 bytes as 64-bit big-endian unsigned integer
- `readVarUint(): bigint` - reads a variable length integer as defined in the Bitcoin protocol [docs](https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer)
- `readBigSize(): bigint` - reads a variable length integer as defined in the Lightning Network
- `readBytes([len]): Buffer` - reads the optionally specified number of bytes. If no length is supplied, it reads to the end of the buffer.
- `readUInt8(): number` - reads 1 byte
- `readUInt16LE(): number` - reads 2 bytes as 16-bit little-endian unsigned integer
- `readUInt16BE(): number` - reads 2 bytes as 16-bit big-endian unsigned integer
- `readUInt32LE(): number` - reads 4 bytes as 32-bit little-endian unsigned integer
- `readUInt32BE(): number` - reads 4 bytes as 32-bit big-endian unsigned integer
- `readUInt64LE(): bigint` - reads 8 bytes as 64-bit little-endian unsigned integer
- `readUInt64BE(): bigint` - reads 8 bytes as 64-bit big-endian unsigned integer
- `readVarUint(): bigint` - reads a variable length integer as defined in the Bitcoin protocol [docs](https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer)
- `readBigSize(): bigint` - reads a variable length integer as defined in the Lightning Network
- `readBytes([len]): Buffer` - reads the optionally specified number of bytes. If no length is supplied, it reads to the end of the buffer.

## BufferWriter

Expand All @@ -58,11 +58,11 @@ This class can intenrally manage a Buffer and will automatically expand to fit
the data footprint required. At the end of writing, `.toBuffer` must be called
to obtain the underlying Buffer.

- `writeUInt8(number): undefined` - writes 1 byte
- `writeUInt16LE(number): undefined` - writes a number as a 16-bit little-endian unsigned integer
- `writeUInt16BE(number): undefined` - writes a number as a 16-bit big-endian unsigned integer
- `writeUInt32LE(number): undefined` - writes a number as a 32-bit little-endian unsigned integer
- `writeUInt32BE(number): undefined` - writes a number as a 32-bit big-endian unsigned integer
- `writeUInt64LE(number): undefined` - writes a number as a 64-bit little-endian unsigned integer
- `writeUInt64BE(number): undefined` - writes a number as a 64-bit big-endian unsigned integer
- `writeBytes(buffer): undefined` - writes the supplied buffer to the cursor buffer
- `writeUInt8(number): undefined` - writes 1 byte
- `writeUInt16LE(number): undefined` - writes a number as a 16-bit little-endian unsigned integer
- `writeUInt16BE(number): undefined` - writes a number as a 16-bit big-endian unsigned integer
- `writeUInt32LE(number): undefined` - writes a number as a 32-bit little-endian unsigned integer
- `writeUInt32BE(number): undefined` - writes a number as a 32-bit big-endian unsigned integer
- `writeUInt64LE(number): undefined` - writes a number as a 64-bit little-endian unsigned integer
- `writeUInt64BE(number): undefined` - writes a number as a 64-bit big-endian unsigned integer
- `writeBytes(buffer): undefined` - writes the supplied buffer to the cursor buffer
6 changes: 3 additions & 3 deletions packages/checksum/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# `@node-lightning/checksum`
# `@node-dlc/checksum`

Calculates a CRC32C checksum based on RFC3720.

## Usage

```
const { crc32c } = require('@node-lightning/checksum');
```typescript
const { crc32c } = require('@node-dlc/checksum');
const checksum = crc32c(Buffer.from("hello")); // 2591144780
```
16 changes: 8 additions & 8 deletions packages/crypto/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# @node-lightning/crypto
# @node-dlc/crypto

This packages uses the native Node.js crypto for all functionality except secp256k1. This package requires Node.js 10.17+.

This package provides cryptographic functions for use in LN Tools:

- sha256
- hash160
- hkdf
- secp256k1 ECDH
- secp256k1 private key generation
- secp256k1 public key derivation
- chacha20-poly1305 AEAD
- sha256
- hash160
- hkdf
- secp256k1 ECDH
- secp256k1 private key generation
- secp256k1 public key derivation
- chacha20-poly1305 AEAD
18 changes: 9 additions & 9 deletions packages/noise/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lightning Network Noise Protocol Socket (BOLT #8)

[![CircleCI](https://circleci.com/gh/altangent/node-lightning/tree/master.svg?style=shield)](https://circleci.com/gh/altangent/node-lightning/tree/master)
[![codecov](https://codecov.io/gh/altangent/node-lightning/branch/master/graph/badge.svg)](https://codecov.io/gh/altangent/node-lightning)
[![CircleCI](https://circleci.com/gh/atomicfinance/node-dlc/tree/master.svg?style=shield)](https://circleci.com/gh/atomicfinance/node-dlc/tree/master)
[![codecov](https://codecov.io/gh/atomicfinance/node-dlc/branch/master/graph/badge.svg)](https://codecov.io/gh/atomicfinance/node-dlc)

Implements a Noise Protocol TCP Socket and Server in Node.js as defined in Lightning Network BOLT #8 for Encrypted and Authenticated Transport.

Expand All @@ -13,12 +13,12 @@ Implements a Noise Protocol TCP Socket and Server in Node.js as defined in Light

Learn more about the Noise Protocol and the Lighting Network version:

- [Noise Protocol](http://noiseprotocol.org/)
- [Lightning Network BOLT #8](https://github.com/lightningnetwork/lightning-rfc/blob/master/08-transport.md)
- [Noise Protocol](http://noiseprotocol.org/)
- [Lightning Network BOLT #8](https://github.com/lightningnetwork/lightning-rfc/blob/master/08-transport.md)

## Requirements

- Node.js 10.17+
- Node.js 18+

## Usage

Expand All @@ -28,13 +28,13 @@ This example shows how to create a `NoiseSocket` that connects to a `NoiseServer

To create a `NoiseSocket`, you must provide:

- local private key `ls` which is a `Buffer` with 32-bytes
- remote node's compressed public key `rp` which is a `Buffer` with 33-bytes.
- local private key `ls` which is a `Buffer` with 32-bytes
- remote node's compressed public key `rp` which is a `Buffer` with 33-bytes.

These two values are required to create the encrypted and authenticated communication channel.

```javascript
const noise = require("@node-lightning/noise");
const noise = require("@node-dlc/noise");

// ls is private key as a Buffer(32) defining a point on elliptic
// curve secp256k1
Expand Down Expand Up @@ -76,7 +76,7 @@ socket.on("data", buf => {
### Creating a NoiseSocket Server:

```javascript
const noise = require('@node-lightning/noise');
const noise = require('@node-dlc/noise');

// ls is private key as a Buffer(32) defining a point on elliptic
// curve secp256k1
Expand Down
17 changes: 4 additions & 13 deletions packages/wire/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
# `@node-lightning/wire`
# `@node-dlc/wire`

This repository contains the wire protocol code for the Lightning Network and
includes the following functionality:

- Peer which manages a connection to a peer. This class allows sending and
emitting message traffic. It also manages internal state for Ping/Pong message
traffic. [/lib/peer.ts](lib/peer.ts)
- Peer which manages a connection to a peer. This class allows sending and emitting message traffic. It also manages internal state for Ping/Pong message traffic. [/lib/peer.ts](lib/peer.ts)

- Messages defined in BOLT #1 - Base Protocol, BOLT #2 - Peer Protocol for
Channel Management, and BOLT #7 P2P Node and Channel Discovery can be
found in [/lib/messages](/lib/messages). This code includes the message
types and serialization and deserialization methods for each message.
- Messages defined in BOLT #1 - Base Protocol, BOLT #2 - Peer Protocol for Channel Management, and BOLT #7 P2P Node and Channel Discovery can be found in [/lib/messages](/lib/messages). This code includes the message types and serialization and deserialization methods for each message.

- P2P Node and Channel gossip management that can be found in
[/lib/gossip](/lib/gossip). This code contains the
[GossipManger](/lib/gossip/gossip-manager) which controls gossip for many
peers. Gossip synchronization for a single peer is managed through
[PeerGossipSynchronizer](/lib/gossip/peer-gossip-synchronizer).
- P2P Node and Channel gossip management that can be found in [/lib/gossip](/lib/gossip). This code contains the [GossipManger](/lib/gossip/gossip-manager) which controls gossip for many peers. Gossip synchronization for a single peer is managed through [PeerGossipSynchronizer](/lib/gossip/peer-gossip-synchronizer).
Loading