@aztec/end-to-end 3.0.0-nightly.20250925 → 3.0.0-nightly.20250926
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/dest/fixtures/setup_p2p_test.d.ts +4 -0
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +37 -20
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +42 -0
- package/package.json +37 -37
- package/src/fixtures/setup_p2p_test.ts +53 -16
- package/src/fixtures/web3signer.ts +46 -0
|
@@ -11,9 +11,13 @@ export declare function generatePrivateKeys(startIndex: number, numberOfKeys: nu
|
|
|
11
11
|
export declare function createNodes(config: AztecNodeConfig & {
|
|
12
12
|
dontStartSequencer?: boolean;
|
|
13
13
|
}, dateProvider: DateProvider, bootstrapNodeEnr: string, numNodes: number, bootNodePort: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, indexOffset?: number): Promise<AztecNodeService[]>;
|
|
14
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
14
15
|
export declare function createNode(config: AztecNodeConfig & {
|
|
15
16
|
dontStartSequencer?: boolean;
|
|
16
17
|
}, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
18
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
19
|
+
export declare function createNonValidatorNode(baseConfig: AztecNodeConfig, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
17
20
|
export declare function createProverNode(config: AztecNodeConfig, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<import("@aztec/prover-node").ProverNode>;
|
|
21
|
+
export declare function createP2PConfig(config: AztecNodeConfig, bootstrapNodeEnr?: string, port?: number, dataDirectory?: string): Promise<AztecNodeConfig>;
|
|
18
22
|
export declare function createValidatorConfig(config: AztecNodeConfig, bootstrapNodeEnr?: string, port?: number, addressIndex?: number, dataDirectory?: string): Promise<AztecNodeConfig>;
|
|
19
23
|
//# sourceMappingURL=setup_p2p_test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AASrD,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,EAAE,CAO7F;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,eAAe,GAAG;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,EAC1D,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,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BAYvB"}
|
|
@@ -43,8 +43,7 @@ export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNod
|
|
|
43
43
|
removeLogNameHandler(logNameHandler);
|
|
44
44
|
return nodes;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
export async function createNode(config, dateProvider, tcpPort, bootstrapNode, addressIndex, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
46
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, addressIndex, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
48
47
|
const createNode = async ()=>{
|
|
49
48
|
const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
|
|
50
49
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
@@ -58,20 +57,30 @@ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, a
|
|
|
58
57
|
};
|
|
59
58
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
60
59
|
}
|
|
60
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */ export async function createNonValidatorNode(baseConfig, dateProvider, tcpPort, bootstrapNode, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
61
|
+
const createNode = async ()=>{
|
|
62
|
+
const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
|
|
63
|
+
const config = {
|
|
64
|
+
...p2pConfig,
|
|
65
|
+
disableValidator: true,
|
|
66
|
+
validatorPrivateKeys: undefined,
|
|
67
|
+
publisherPrivateKeys: []
|
|
68
|
+
};
|
|
69
|
+
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
70
|
+
return await AztecNodeService.createAndSync(config, {
|
|
71
|
+
telemetry,
|
|
72
|
+
dateProvider
|
|
73
|
+
}, {
|
|
74
|
+
prefilledPublicData
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
78
|
+
}
|
|
61
79
|
export async function createProverNode(config, tcpPort, bootstrapNode, addressIndex, proverNodeDeps, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
62
80
|
const createProverNode = async ()=>{
|
|
63
81
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex);
|
|
64
82
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
65
|
-
const proverConfig =
|
|
66
|
-
p2pIp: `127.0.0.1`,
|
|
67
|
-
p2pPort: tcpPort ?? await getPort(),
|
|
68
|
-
p2pEnabled: true,
|
|
69
|
-
peerCheckIntervalMS: TEST_PEER_CHECK_INTERVAL_MS,
|
|
70
|
-
blockCheckIntervalMS: 1000,
|
|
71
|
-
bootstrapNodes: bootstrapNode ? [
|
|
72
|
-
bootstrapNode
|
|
73
|
-
] : []
|
|
74
|
-
};
|
|
83
|
+
const proverConfig = await createP2PConfig(config, bootstrapNode, tcpPort, dataDirectory);
|
|
75
84
|
const aztecNodeRpcTxProvider = undefined;
|
|
76
85
|
return await createAndSyncProverNode(bufferToHex(proverNodePrivateKey), config, {
|
|
77
86
|
...proverConfig,
|
|
@@ -83,15 +92,8 @@ export async function createProverNode(config, tcpPort, bootstrapNode, addressIn
|
|
|
83
92
|
};
|
|
84
93
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
|
|
85
94
|
}
|
|
86
|
-
export async function
|
|
95
|
+
export async function createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory) {
|
|
87
96
|
port = port ?? await getPort();
|
|
88
|
-
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex));
|
|
89
|
-
config.validatorPrivateKeys = new SecretValue([
|
|
90
|
-
attesterPrivateKey
|
|
91
|
-
]);
|
|
92
|
-
config.publisherPrivateKeys = [
|
|
93
|
-
new SecretValue(attesterPrivateKey)
|
|
94
|
-
];
|
|
95
97
|
const nodeConfig = {
|
|
96
98
|
...config,
|
|
97
99
|
p2pIp: `127.0.0.1`,
|
|
@@ -106,3 +108,18 @@ export async function createValidatorConfig(config, bootstrapNodeEnr, port, addr
|
|
|
106
108
|
};
|
|
107
109
|
return nodeConfig;
|
|
108
110
|
}
|
|
111
|
+
export async function createValidatorConfig(config, bootstrapNodeEnr, port, addressIndex = 1, dataDirectory) {
|
|
112
|
+
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex));
|
|
113
|
+
const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
|
|
114
|
+
const nodeConfig = {
|
|
115
|
+
...config,
|
|
116
|
+
...p2pConfig,
|
|
117
|
+
validatorPrivateKeys: new SecretValue([
|
|
118
|
+
attesterPrivateKey
|
|
119
|
+
]),
|
|
120
|
+
publisherPrivateKeys: [
|
|
121
|
+
new SecretValue(attesterPrivateKey)
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
return nodeConfig;
|
|
125
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function createWeb3SignerKeystore(dir: string, ...privateKeys: string[]): Promise<void>;
|
|
2
|
+
export declare function refreshWeb3Signer(url: string): Promise<void>;
|
|
3
|
+
export declare function getWeb3SignerTestKeystoreDir(): string;
|
|
4
|
+
export declare function getWeb3SignerUrl(): string;
|
|
5
|
+
//# sourceMappingURL=web3signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3signer.d.ts","sourceRoot":"","sources":["../../src/fixtures/web3signer.ts"],"names":[],"mappings":"AAOA,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,iBAcnF;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,iBAKlD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAOrD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { mkdirSync } from 'node:fs';
|
|
4
|
+
import { writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
export async function createWeb3SignerKeystore(dir, ...privateKeys) {
|
|
7
|
+
const yaml = privateKeys.map((pk)=>`\
|
|
8
|
+
type: file-raw
|
|
9
|
+
keyType: SECP256K1
|
|
10
|
+
privateKey: ${pk}`).join('\n---\n');
|
|
11
|
+
// NOTE: nodejs stdlib can only create temp directories, not temp files!
|
|
12
|
+
// this write uses wx (write-exclusive) so it'll throw if the file already exists
|
|
13
|
+
const path = join(dir, `keystore-${randomBytes(4).toString('hex')}.yaml`);
|
|
14
|
+
await writeFile(path, yaml, {
|
|
15
|
+
flag: 'wx'
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export async function refreshWeb3Signer(url) {
|
|
19
|
+
await fetch(new URL('reload', url), {
|
|
20
|
+
method: 'POST'
|
|
21
|
+
});
|
|
22
|
+
// give the service a chance to load up the new files
|
|
23
|
+
// 1s might not be enough if there are a lot of files to scan
|
|
24
|
+
await sleep(1000);
|
|
25
|
+
}
|
|
26
|
+
export function getWeb3SignerTestKeystoreDir() {
|
|
27
|
+
if (process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR) {
|
|
28
|
+
mkdirSync(process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR, {
|
|
29
|
+
recursive: true
|
|
30
|
+
});
|
|
31
|
+
return process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR;
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error('Web3signer not running');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function getWeb3SignerUrl() {
|
|
37
|
+
if (process.env.WEB3_SIGNER_URL) {
|
|
38
|
+
return process.env.WEB3_SIGNER_URL;
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error('Web3signer not running');
|
|
41
|
+
}
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250926",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250926",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250926",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250926",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250926",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250926",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250926",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250926",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250926",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250926",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250926",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250926",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250926",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250926",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250926",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250926",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250926",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250926",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250926",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250926",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250926",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250926",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250926",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250926",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250926",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250926",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250926",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250926",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250926",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250926",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250926",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250926",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250926",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250926",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250926",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250926",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250926",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -78,7 +78,7 @@ export async function createNodes(
|
|
|
78
78
|
return nodes;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
82
82
|
export async function createNode(
|
|
83
83
|
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
84
84
|
dateProvider: DateProvider,
|
|
@@ -102,6 +102,31 @@ export async function createNode(
|
|
|
102
102
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
106
|
+
export async function createNonValidatorNode(
|
|
107
|
+
baseConfig: AztecNodeConfig,
|
|
108
|
+
dateProvider: DateProvider,
|
|
109
|
+
tcpPort: number,
|
|
110
|
+
bootstrapNode: string | undefined,
|
|
111
|
+
prefilledPublicData?: PublicDataTreeLeaf[],
|
|
112
|
+
dataDirectory?: string,
|
|
113
|
+
metricsPort?: number,
|
|
114
|
+
loggerIdStorage?: AsyncLocalStorage<string>,
|
|
115
|
+
) {
|
|
116
|
+
const createNode = async () => {
|
|
117
|
+
const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
|
|
118
|
+
const config: AztecNodeConfig = {
|
|
119
|
+
...p2pConfig,
|
|
120
|
+
disableValidator: true,
|
|
121
|
+
validatorPrivateKeys: undefined,
|
|
122
|
+
publisherPrivateKeys: [],
|
|
123
|
+
};
|
|
124
|
+
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
125
|
+
return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
|
|
126
|
+
};
|
|
127
|
+
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
128
|
+
}
|
|
129
|
+
|
|
105
130
|
export async function createProverNode(
|
|
106
131
|
config: AztecNodeConfig,
|
|
107
132
|
tcpPort: number,
|
|
@@ -117,14 +142,13 @@ export async function createProverNode(
|
|
|
117
142
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
|
|
118
143
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
119
144
|
|
|
120
|
-
const proverConfig: Partial<ProverNodeConfig> =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
145
|
+
const proverConfig: Partial<ProverNodeConfig> = await createP2PConfig(
|
|
146
|
+
config,
|
|
147
|
+
bootstrapNode,
|
|
148
|
+
tcpPort,
|
|
149
|
+
dataDirectory,
|
|
150
|
+
);
|
|
151
|
+
|
|
128
152
|
const aztecNodeRpcTxProvider = undefined;
|
|
129
153
|
return await createAndSyncProverNode(
|
|
130
154
|
bufferToHex(proverNodePrivateKey),
|
|
@@ -138,20 +162,14 @@ export async function createProverNode(
|
|
|
138
162
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
|
|
139
163
|
}
|
|
140
164
|
|
|
141
|
-
export async function
|
|
165
|
+
export async function createP2PConfig(
|
|
142
166
|
config: AztecNodeConfig,
|
|
143
167
|
bootstrapNodeEnr?: string,
|
|
144
168
|
port?: number,
|
|
145
|
-
addressIndex: number = 1,
|
|
146
169
|
dataDirectory?: string,
|
|
147
170
|
) {
|
|
148
171
|
port = port ?? (await getPort());
|
|
149
172
|
|
|
150
|
-
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!);
|
|
151
|
-
|
|
152
|
-
config.validatorPrivateKeys = new SecretValue([attesterPrivateKey]);
|
|
153
|
-
config.publisherPrivateKeys = [new SecretValue(attesterPrivateKey)];
|
|
154
|
-
|
|
155
173
|
const nodeConfig: AztecNodeConfig = {
|
|
156
174
|
...config,
|
|
157
175
|
p2pIp: `127.0.0.1`,
|
|
@@ -165,3 +183,22 @@ export async function createValidatorConfig(
|
|
|
165
183
|
|
|
166
184
|
return nodeConfig;
|
|
167
185
|
}
|
|
186
|
+
|
|
187
|
+
export async function createValidatorConfig(
|
|
188
|
+
config: AztecNodeConfig,
|
|
189
|
+
bootstrapNodeEnr?: string,
|
|
190
|
+
port?: number,
|
|
191
|
+
addressIndex: number = 1,
|
|
192
|
+
dataDirectory?: string,
|
|
193
|
+
) {
|
|
194
|
+
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!);
|
|
195
|
+
const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
|
|
196
|
+
const nodeConfig: AztecNodeConfig = {
|
|
197
|
+
...config,
|
|
198
|
+
...p2pConfig,
|
|
199
|
+
validatorPrivateKeys: new SecretValue([attesterPrivateKey]),
|
|
200
|
+
publisherPrivateKeys: [new SecretValue(attesterPrivateKey)],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
return nodeConfig;
|
|
204
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
|
|
4
|
+
import { mkdirSync } from 'node:fs';
|
|
5
|
+
import { writeFile } from 'node:fs/promises';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
|
|
8
|
+
export async function createWeb3SignerKeystore(dir: string, ...privateKeys: string[]) {
|
|
9
|
+
const yaml = privateKeys
|
|
10
|
+
.map(
|
|
11
|
+
pk => `\
|
|
12
|
+
type: file-raw
|
|
13
|
+
keyType: SECP256K1
|
|
14
|
+
privateKey: ${pk}`,
|
|
15
|
+
)
|
|
16
|
+
.join('\n---\n');
|
|
17
|
+
|
|
18
|
+
// NOTE: nodejs stdlib can only create temp directories, not temp files!
|
|
19
|
+
// this write uses wx (write-exclusive) so it'll throw if the file already exists
|
|
20
|
+
const path = join(dir, `keystore-${randomBytes(4).toString('hex')}.yaml`);
|
|
21
|
+
await writeFile(path, yaml, { flag: 'wx' });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function refreshWeb3Signer(url: string) {
|
|
25
|
+
await fetch(new URL('reload', url), { method: 'POST' });
|
|
26
|
+
// give the service a chance to load up the new files
|
|
27
|
+
// 1s might not be enough if there are a lot of files to scan
|
|
28
|
+
await sleep(1000);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getWeb3SignerTestKeystoreDir(): string {
|
|
32
|
+
if (process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR) {
|
|
33
|
+
mkdirSync(process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR, { recursive: true });
|
|
34
|
+
return process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR;
|
|
35
|
+
} else {
|
|
36
|
+
throw new Error('Web3signer not running');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getWeb3SignerUrl(): string {
|
|
41
|
+
if (process.env.WEB3_SIGNER_URL) {
|
|
42
|
+
return process.env.WEB3_SIGNER_URL;
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error('Web3signer not running');
|
|
45
|
+
}
|
|
46
|
+
}
|