@aztec/p2p-bootstrap 0.0.0-test.0 → 0.0.1-commit.0208eb9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dest/index.d.ts +3 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +4 -4
- package/package.json +21 -18
- package/src/index.ts +5 -6
package/README.md
CHANGED
|
@@ -6,6 +6,6 @@ To build the package simply type `yarn build`, to start the boot node, simply ty
|
|
|
6
6
|
|
|
7
7
|
The node will require a number of environment variables:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
P2P_IP - The IP address on which to listen for connections.
|
|
10
|
+
P2P_PORT - The port on which to listen for connections.
|
|
10
11
|
PEER_ID_PRIVATE_KEY - The private key to be used by the peer for secure communications with other peers. This key will also be used to derive the Peer ID.
|
|
11
|
-
P2P_UDP_ANNOUNCE_ADDR - The address that other peers should use to connect to this node, this may be different to P2P_TCP_LISTEN_ADDR if e.g. the node is behind a NAT.
|
package/dest/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
1
2
|
import { type BootnodeConfig } from '@aztec/p2p';
|
|
2
3
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
3
4
|
/**
|
|
4
5
|
* The application entry point.
|
|
5
6
|
*/
|
|
6
|
-
declare function main(config: BootnodeConfig, telemetryClient?: TelemetryClient,
|
|
7
|
+
declare function main(config: BootnodeConfig, telemetryClient?: TelemetryClient, bindings?: LoggerBindings): Promise<void>;
|
|
7
8
|
export default main;
|
|
8
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQWdCLE1BQU0sdUJBQXVCLENBQUM7QUFFMUUsT0FBTyxFQUFFLEtBQUssY0FBYyxFQUFpQixNQUFNLFlBQVksQ0FBQztBQUNoRSxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXNCLE1BQU0seUJBQXlCLENBQUM7QUFPbkY7O0dBRUc7QUFDSCxpQkFBZSxJQUFJLENBQ2pCLE1BQU0sRUFBRSxjQUFjLEVBQ3RCLGVBQWUsR0FBRSxlQUFzQyxFQUN2RCxRQUFRLENBQUMsRUFBRSxjQUFjLGlCQThCMUI7QUFFRCxlQUFlLElBQUksQ0FBQyJ9
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAOnF;;GAEG;AACH,iBAAe,IAAI,CACjB,MAAM,EAAE,cAAc,EACtB,eAAe,GAAE,eAAsC,EACvD,QAAQ,CAAC,EAAE,cAAc,iBA8B1B;AAED,eAAe,IAAI,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -4,13 +4,13 @@ import { BootstrapNode } from '@aztec/p2p';
|
|
|
4
4
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
5
5
|
import Koa from 'koa';
|
|
6
6
|
import Router from 'koa-router';
|
|
7
|
-
const debugLogger = createLogger('p2p-bootstrap:bootstrap_node');
|
|
8
7
|
const { HTTP_PORT } = process.env;
|
|
9
8
|
/**
|
|
10
9
|
* The application entry point.
|
|
11
|
-
*/ async function main(config, telemetryClient = getTelemetryClient(),
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
*/ async function main(config, telemetryClient = getTelemetryClient(), bindings) {
|
|
11
|
+
const logger = createLogger('p2p-bootstrap:bootstrap_node', bindings);
|
|
12
|
+
const store = await createStore('p2p-bootstrap', 1, config, bindings);
|
|
13
|
+
const bootstrapNode = new BootstrapNode(store, telemetryClient, bindings);
|
|
14
14
|
await bootstrapNode.start(config);
|
|
15
15
|
logger.info('DiscV5 Bootnode started');
|
|
16
16
|
const httpApp = new Koa();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/p2p-bootstrap",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1-commit.0208eb9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"typedocOptions": {
|
|
@@ -11,12 +11,10 @@
|
|
|
11
11
|
"tsconfig": "./tsconfig.json"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "yarn clean && tsc
|
|
15
|
-
"build:dev": "tsc
|
|
14
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
15
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
16
16
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
17
|
-
"
|
|
18
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
19
|
-
"start:dev": "tsc-watch -p tsconfig.json --onSuccess 'yarn start'",
|
|
17
|
+
"start:dev": "concurrently -k \"../scripts/tsc.sh --watch\" \"nodemon --watch dest --exec yarn start\"",
|
|
20
18
|
"start": "node ./dest/index.js",
|
|
21
19
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
22
20
|
},
|
|
@@ -24,24 +22,25 @@
|
|
|
24
22
|
"../package.common.json"
|
|
25
23
|
],
|
|
26
24
|
"dependencies": {
|
|
27
|
-
"@aztec/foundation": "0.0.
|
|
28
|
-
"@aztec/kv-store": "0.0.
|
|
29
|
-
"@aztec/p2p": "0.0.
|
|
30
|
-
"@aztec/telemetry-client": "0.0.
|
|
25
|
+
"@aztec/foundation": "0.0.1-commit.0208eb9",
|
|
26
|
+
"@aztec/kv-store": "0.0.1-commit.0208eb9",
|
|
27
|
+
"@aztec/p2p": "0.0.1-commit.0208eb9",
|
|
28
|
+
"@aztec/telemetry-client": "0.0.1-commit.0208eb9",
|
|
31
29
|
"dotenv": "^16.0.3",
|
|
32
|
-
"koa": "^2.
|
|
33
|
-
"koa-router": "^
|
|
30
|
+
"koa": "^2.16.1",
|
|
31
|
+
"koa-router": "^13.1.1",
|
|
34
32
|
"tslib": "^2.4.0"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@jest/globals": "^
|
|
38
|
-
"@types/jest": "^
|
|
35
|
+
"@jest/globals": "^30.0.0",
|
|
36
|
+
"@types/jest": "^30.0.0",
|
|
39
37
|
"@types/koa": "^2.15.0",
|
|
40
38
|
"@types/koa-router": "^7.4.8",
|
|
41
|
-
"@types/node": "^
|
|
42
|
-
"
|
|
39
|
+
"@types/node": "^22.15.17",
|
|
40
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
41
|
+
"jest": "^30.0.0",
|
|
43
42
|
"ts-node": "^10.9.1",
|
|
44
|
-
"typescript": "^5.
|
|
43
|
+
"typescript": "^5.3.3"
|
|
45
44
|
},
|
|
46
45
|
"files": [
|
|
47
46
|
"dest",
|
|
@@ -80,9 +79,13 @@
|
|
|
80
79
|
"testTimeout": 120000,
|
|
81
80
|
"setupFiles": [
|
|
82
81
|
"../../foundation/src/jest/setup.mjs"
|
|
82
|
+
],
|
|
83
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
84
|
+
"setupFilesAfterEnv": [
|
|
85
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
83
86
|
]
|
|
84
87
|
},
|
|
85
88
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
89
|
+
"node": ">=20.10"
|
|
87
90
|
}
|
|
88
91
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
1
|
+
import { type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
3
3
|
import { type BootnodeConfig, BootstrapNode } from '@aztec/p2p';
|
|
4
4
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -6,8 +6,6 @@ import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-clien
|
|
|
6
6
|
import Koa from 'koa';
|
|
7
7
|
import Router from 'koa-router';
|
|
8
8
|
|
|
9
|
-
const debugLogger = createLogger('p2p-bootstrap:bootstrap_node');
|
|
10
|
-
|
|
11
9
|
const { HTTP_PORT } = process.env;
|
|
12
10
|
|
|
13
11
|
/**
|
|
@@ -16,11 +14,12 @@ const { HTTP_PORT } = process.env;
|
|
|
16
14
|
async function main(
|
|
17
15
|
config: BootnodeConfig,
|
|
18
16
|
telemetryClient: TelemetryClient = getTelemetryClient(),
|
|
19
|
-
|
|
17
|
+
bindings?: LoggerBindings,
|
|
20
18
|
) {
|
|
21
|
-
const
|
|
19
|
+
const logger = createLogger('p2p-bootstrap:bootstrap_node', bindings);
|
|
20
|
+
const store = await createStore('p2p-bootstrap', 1, config, bindings);
|
|
22
21
|
|
|
23
|
-
const bootstrapNode = new BootstrapNode(store, telemetryClient,
|
|
22
|
+
const bootstrapNode = new BootstrapNode(store, telemetryClient, bindings);
|
|
24
23
|
await bootstrapNode.start(config);
|
|
25
24
|
logger.info('DiscV5 Bootnode started');
|
|
26
25
|
|