@aztec/aztec 0.78.0 → 0.79.0
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/bin/index.js +2 -5
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +2 -5
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +15 -7
- package/dest/cli/release_version.d.ts +2 -0
- package/dest/cli/release_version.d.ts.map +1 -0
- package/dest/cli/release_version.js +14 -0
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +2 -1
- package/package.json +30 -30
- package/src/bin/index.ts +2 -5
- package/src/cli/aztec_start_action.ts +2 -7
- package/src/cli/cmds/start_node.ts +18 -7
- package/src/cli/release_version.ts +21 -0
- package/src/sandbox/sandbox.ts +2 -1
package/dest/bin/index.js
CHANGED
|
@@ -9,11 +9,9 @@ import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
|
|
|
9
9
|
import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
10
10
|
import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
|
|
11
11
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
12
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
13
12
|
import { Command } from 'commander';
|
|
14
|
-
import { readFileSync } from 'fs';
|
|
15
|
-
import { dirname, resolve } from 'path';
|
|
16
13
|
import { injectAztecCommands } from '../cli/index.js';
|
|
14
|
+
import { getCliVersion } from '../cli/release_version.js';
|
|
17
15
|
const userLog = createConsoleLogger();
|
|
18
16
|
const debugLogger = createLogger('cli');
|
|
19
17
|
/** CLI & full node main entrypoint */ async function main() {
|
|
@@ -22,8 +20,7 @@ const debugLogger = createLogger('cli');
|
|
|
22
20
|
};
|
|
23
21
|
process.once('SIGINT', shutdown);
|
|
24
22
|
process.once('SIGTERM', shutdown);
|
|
25
|
-
const
|
|
26
|
-
const cliVersion = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
23
|
+
const cliVersion = getCliVersion();
|
|
27
24
|
let program = new Command('aztec');
|
|
28
25
|
program.description('Aztec command line interface').version(cliVersion);
|
|
29
26
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBA0FjF"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { createNamespacedSafeJsonRpcServer, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
2
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
3
2
|
import { AztecNodeApiSchema, PXESchema } from '@aztec/stdlib/interfaces/client';
|
|
4
3
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
5
4
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
6
|
-
import { readFileSync } from 'fs';
|
|
7
|
-
import { dirname, resolve } from 'path';
|
|
8
5
|
import { createSandbox } from '../sandbox/index.js';
|
|
9
6
|
import { github, splash } from '../splash.js';
|
|
10
7
|
import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
|
|
8
|
+
import { getCliVersion } from './release_version.js';
|
|
11
9
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
12
10
|
import { getVersions } from './versioning.js';
|
|
13
|
-
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
14
|
-
const cliVersion = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
15
11
|
export async function aztecStart(options, userLog, debugLogger) {
|
|
16
12
|
// list of 'stop' functions to call when process ends
|
|
17
13
|
const signalHandlers = [];
|
|
18
14
|
const services = {};
|
|
19
15
|
let config = undefined;
|
|
20
16
|
if (options.sandbox) {
|
|
17
|
+
const cliVersion = getCliVersion();
|
|
21
18
|
const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
|
|
22
19
|
const nodeOptions = extractNamespacedOptions(options, 'node');
|
|
23
20
|
userLog(`${splash}\n${github}\n\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAEpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAEpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CAwItC"}
|
|
@@ -12,10 +12,14 @@ import { extractNamespacedOptions, extractRelevantOptions } from '../util.js';
|
|
|
12
12
|
export async function startNode(options, signalHandlers, services, userLog) {
|
|
13
13
|
// options specifically namespaced with --node.<option>
|
|
14
14
|
const nodeSpecificOptions = extractNamespacedOptions(options, 'node');
|
|
15
|
+
// All options set from environment variables
|
|
16
|
+
const configFromEnvVars = getConfigEnvVars();
|
|
17
|
+
// Extract relevant options from command line arguments
|
|
18
|
+
const relevantOptions = extractRelevantOptions(options, aztecNodeConfigMappings, 'node');
|
|
15
19
|
// All options that are relevant to the Aztec Node
|
|
16
20
|
let nodeConfig = {
|
|
17
|
-
...
|
|
18
|
-
...
|
|
21
|
+
...configFromEnvVars,
|
|
22
|
+
...relevantOptions
|
|
19
23
|
};
|
|
20
24
|
if (options.proverNode) {
|
|
21
25
|
userLog(`Running a Prover Node within a Node is not yet supported`);
|
|
@@ -68,20 +72,24 @@ export async function startNode(options, signalHandlers, services, userLog) {
|
|
|
68
72
|
if (!options.sequencer) {
|
|
69
73
|
nodeConfig.disableValidator = true;
|
|
70
74
|
} else {
|
|
71
|
-
const sequencerConfig =
|
|
75
|
+
const sequencerConfig = {
|
|
76
|
+
...configFromEnvVars,
|
|
77
|
+
...extractNamespacedOptions(options, 'sequencer')
|
|
78
|
+
};
|
|
72
79
|
let account;
|
|
73
80
|
if (!sequencerConfig.publisherPrivateKey || sequencerConfig.publisherPrivateKey === NULL_KEY) {
|
|
74
|
-
if (
|
|
81
|
+
if (sequencerConfig.validatorPrivateKey) {
|
|
82
|
+
sequencerConfig.publisherPrivateKey = sequencerConfig.validatorPrivateKey;
|
|
83
|
+
} else if (!options.l1Mnemonic) {
|
|
75
84
|
userLog('--sequencer.publisherPrivateKey or --l1-mnemonic is required to start Aztec Node with --sequencer option');
|
|
76
85
|
throw new Error('Private key or Mnemonic is required to start Aztec Node with --sequencer option');
|
|
77
86
|
} else {
|
|
78
87
|
account = mnemonicToAccount(options.l1Mnemonic);
|
|
79
88
|
const privKey = account.getHdKey().privateKey;
|
|
80
|
-
|
|
89
|
+
sequencerConfig.publisherPrivateKey = `0x${Buffer.from(privKey).toString('hex')}`;
|
|
81
90
|
}
|
|
82
|
-
} else {
|
|
83
|
-
nodeConfig.publisherPrivateKey = sequencerConfig.publisherPrivateKey;
|
|
84
91
|
}
|
|
92
|
+
nodeConfig.publisherPrivateKey = sequencerConfig.publisherPrivateKey;
|
|
85
93
|
}
|
|
86
94
|
if (nodeConfig.p2pEnabled) {
|
|
87
95
|
// ensure bootstrapNodes is an array
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_version.d.ts","sourceRoot":"","sources":["../../src/cli/release_version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,WAezB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { dirname, resolve } from 'path';
|
|
4
|
+
export const getCliVersion = ()=>{
|
|
5
|
+
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
6
|
+
const cliVersion = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
7
|
+
// If the version is 0.1.0, this is a placeholder version and we are in a docker container; query release please for the latest version
|
|
8
|
+
if (cliVersion === '0.1.0') {
|
|
9
|
+
const releasePleasePath = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../.release-please-manifest.json');
|
|
10
|
+
const releaseVersion = JSON.parse(readFileSync(releasePleasePath).toString())['.'];
|
|
11
|
+
return releaseVersion;
|
|
12
|
+
}
|
|
13
|
+
return cliVersion;
|
|
14
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAG7F,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAU7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAavH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,mCAAS,EAC7B,IAAI,GAAE;IAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,EAAE,CAAA;CAAO;;;;;;;;;;;;;;;;;;GA6BtH;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,oCAA6B,EAAE,OAAO,EAAE,KAAK;;;;GAkGtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAA;CAAO,EACpF,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAY7D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,mDAI3F"}
|
package/dest/sandbox/sandbox.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
3
|
import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import {
|
|
5
|
+
import { SignerlessWallet } from '@aztec/aztec.js';
|
|
6
|
+
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
7
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
8
|
import { setupCanonicalL2FeeJuice } from '@aztec/cli/setup-contracts';
|
|
8
9
|
import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
@@ -29,41 +29,41 @@
|
|
|
29
29
|
"../package.common.json"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aztec/accounts": "0.
|
|
33
|
-
"@aztec/archiver": "0.
|
|
34
|
-
"@aztec/aztec-faucet": "0.
|
|
35
|
-
"@aztec/aztec-node": "0.
|
|
36
|
-
"@aztec/aztec.js": "0.
|
|
37
|
-
"@aztec/bb-prover": "0.
|
|
38
|
-
"@aztec/blob-sink": "0.
|
|
39
|
-
"@aztec/bot": "0.
|
|
40
|
-
"@aztec/builder": "0.
|
|
41
|
-
"@aztec/cli": "0.
|
|
42
|
-
"@aztec/cli-wallet": "0.
|
|
43
|
-
"@aztec/constants": "0.
|
|
44
|
-
"@aztec/entrypoints": "0.
|
|
45
|
-
"@aztec/ethereum": "0.
|
|
46
|
-
"@aztec/foundation": "0.
|
|
47
|
-
"@aztec/kv-store": "0.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
50
|
-
"@aztec/p2p": "0.
|
|
51
|
-
"@aztec/p2p-bootstrap": "0.
|
|
52
|
-
"@aztec/protocol-contracts": "0.
|
|
53
|
-
"@aztec/prover-client": "0.
|
|
54
|
-
"@aztec/prover-node": "0.
|
|
55
|
-
"@aztec/pxe": "0.
|
|
56
|
-
"@aztec/stdlib": "0.
|
|
57
|
-
"@aztec/telemetry-client": "0.
|
|
58
|
-
"@aztec/txe": "0.
|
|
59
|
-
"@aztec/world-state": "0.
|
|
32
|
+
"@aztec/accounts": "0.79.0",
|
|
33
|
+
"@aztec/archiver": "0.79.0",
|
|
34
|
+
"@aztec/aztec-faucet": "0.79.0",
|
|
35
|
+
"@aztec/aztec-node": "0.79.0",
|
|
36
|
+
"@aztec/aztec.js": "0.79.0",
|
|
37
|
+
"@aztec/bb-prover": "0.79.0",
|
|
38
|
+
"@aztec/blob-sink": "0.79.0",
|
|
39
|
+
"@aztec/bot": "0.79.0",
|
|
40
|
+
"@aztec/builder": "0.79.0",
|
|
41
|
+
"@aztec/cli": "0.79.0",
|
|
42
|
+
"@aztec/cli-wallet": "0.79.0",
|
|
43
|
+
"@aztec/constants": "0.79.0",
|
|
44
|
+
"@aztec/entrypoints": "0.79.0",
|
|
45
|
+
"@aztec/ethereum": "0.79.0",
|
|
46
|
+
"@aztec/foundation": "0.79.0",
|
|
47
|
+
"@aztec/kv-store": "0.79.0",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.79.0",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.79.0",
|
|
50
|
+
"@aztec/p2p": "0.79.0",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.79.0",
|
|
52
|
+
"@aztec/protocol-contracts": "0.79.0",
|
|
53
|
+
"@aztec/prover-client": "0.79.0",
|
|
54
|
+
"@aztec/prover-node": "0.79.0",
|
|
55
|
+
"@aztec/pxe": "0.79.0",
|
|
56
|
+
"@aztec/stdlib": "0.79.0",
|
|
57
|
+
"@aztec/telemetry-client": "0.79.0",
|
|
58
|
+
"@aztec/txe": "0.79.0",
|
|
59
|
+
"@aztec/world-state": "0.79.0",
|
|
60
60
|
"@types/chalk": "^2.2.0",
|
|
61
61
|
"abitype": "^0.8.11",
|
|
62
62
|
"chalk": "^5.3.0",
|
|
63
63
|
"commander": "^12.1.0",
|
|
64
64
|
"koa": "^2.14.2",
|
|
65
65
|
"koa-router": "^12.0.0",
|
|
66
|
-
"viem": "2.
|
|
66
|
+
"viem": "2.23.7"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
69
69
|
"dest",
|
package/src/bin/index.ts
CHANGED
|
@@ -9,13 +9,11 @@ import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
|
|
|
9
9
|
import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
10
10
|
import { injectCommands as injectPXECommands } from '@aztec/cli/pxe';
|
|
11
11
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
12
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
13
12
|
|
|
14
13
|
import { Command } from 'commander';
|
|
15
|
-
import { readFileSync } from 'fs';
|
|
16
|
-
import { dirname, resolve } from 'path';
|
|
17
14
|
|
|
18
15
|
import { injectAztecCommands } from '../cli/index.js';
|
|
16
|
+
import { getCliVersion } from '../cli/release_version.js';
|
|
19
17
|
|
|
20
18
|
const userLog = createConsoleLogger();
|
|
21
19
|
const debugLogger = createLogger('cli');
|
|
@@ -28,8 +26,7 @@ async function main() {
|
|
|
28
26
|
process.once('SIGINT', shutdown);
|
|
29
27
|
process.once('SIGTERM', shutdown);
|
|
30
28
|
|
|
31
|
-
const
|
|
32
|
-
const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
29
|
+
const cliVersion = getCliVersion();
|
|
33
30
|
let program = new Command('aztec');
|
|
34
31
|
program.description('Aztec command line interface').version(cliVersion);
|
|
35
32
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
@@ -4,24 +4,18 @@ import {
|
|
|
4
4
|
startHttpRpcServer,
|
|
5
5
|
} from '@aztec/foundation/json-rpc/server';
|
|
6
6
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
7
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
8
7
|
import type { ChainConfig } from '@aztec/stdlib/config';
|
|
9
8
|
import { AztecNodeApiSchema, PXESchema } from '@aztec/stdlib/interfaces/client';
|
|
10
9
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
11
10
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
12
11
|
|
|
13
|
-
import { readFileSync } from 'fs';
|
|
14
|
-
import { dirname, resolve } from 'path';
|
|
15
|
-
|
|
16
12
|
import { createSandbox } from '../sandbox/index.js';
|
|
17
13
|
import { github, splash } from '../splash.js';
|
|
18
14
|
import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
|
|
15
|
+
import { getCliVersion } from './release_version.js';
|
|
19
16
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
20
17
|
import { getVersions } from './versioning.js';
|
|
21
18
|
|
|
22
|
-
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
23
|
-
const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
24
|
-
|
|
25
19
|
export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logger) {
|
|
26
20
|
// list of 'stop' functions to call when process ends
|
|
27
21
|
const signalHandlers: Array<() => Promise<void>> = [];
|
|
@@ -29,6 +23,7 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
29
23
|
let config: ChainConfig | undefined = undefined;
|
|
30
24
|
|
|
31
25
|
if (options.sandbox) {
|
|
26
|
+
const cliVersion = getCliVersion();
|
|
32
27
|
const sandboxOptions = extractNamespacedOptions(options, 'sandbox');
|
|
33
28
|
const nodeOptions = extractNamespacedOptions(options, 'node');
|
|
34
29
|
userLog(`${splash}\n${github}\n\n`);
|
|
@@ -26,10 +26,17 @@ export async function startNode(
|
|
|
26
26
|
): Promise<{ config: AztecNodeConfig }> {
|
|
27
27
|
// options specifically namespaced with --node.<option>
|
|
28
28
|
const nodeSpecificOptions = extractNamespacedOptions(options, 'node');
|
|
29
|
+
|
|
30
|
+
// All options set from environment variables
|
|
31
|
+
const configFromEnvVars = getConfigEnvVars();
|
|
32
|
+
|
|
33
|
+
// Extract relevant options from command line arguments
|
|
34
|
+
const relevantOptions = extractRelevantOptions(options, aztecNodeConfigMappings, 'node');
|
|
35
|
+
|
|
29
36
|
// All options that are relevant to the Aztec Node
|
|
30
37
|
let nodeConfig: AztecNodeConfig = {
|
|
31
|
-
...
|
|
32
|
-
...
|
|
38
|
+
...configFromEnvVars,
|
|
39
|
+
...relevantOptions,
|
|
33
40
|
};
|
|
34
41
|
|
|
35
42
|
if (options.proverNode) {
|
|
@@ -96,10 +103,15 @@ export async function startNode(
|
|
|
96
103
|
if (!options.sequencer) {
|
|
97
104
|
nodeConfig.disableValidator = true;
|
|
98
105
|
} else {
|
|
99
|
-
const sequencerConfig =
|
|
106
|
+
const sequencerConfig = {
|
|
107
|
+
...configFromEnvVars,
|
|
108
|
+
...extractNamespacedOptions(options, 'sequencer'),
|
|
109
|
+
};
|
|
100
110
|
let account;
|
|
101
111
|
if (!sequencerConfig.publisherPrivateKey || sequencerConfig.publisherPrivateKey === NULL_KEY) {
|
|
102
|
-
if (
|
|
112
|
+
if (sequencerConfig.validatorPrivateKey) {
|
|
113
|
+
sequencerConfig.publisherPrivateKey = sequencerConfig.validatorPrivateKey as `0x${string}`;
|
|
114
|
+
} else if (!options.l1Mnemonic) {
|
|
103
115
|
userLog(
|
|
104
116
|
'--sequencer.publisherPrivateKey or --l1-mnemonic is required to start Aztec Node with --sequencer option',
|
|
105
117
|
);
|
|
@@ -107,11 +119,10 @@ export async function startNode(
|
|
|
107
119
|
} else {
|
|
108
120
|
account = mnemonicToAccount(options.l1Mnemonic);
|
|
109
121
|
const privKey = account.getHdKey().privateKey;
|
|
110
|
-
|
|
122
|
+
sequencerConfig.publisherPrivateKey = `0x${Buffer.from(privKey!).toString('hex')}`;
|
|
111
123
|
}
|
|
112
|
-
} else {
|
|
113
|
-
nodeConfig.publisherPrivateKey = sequencerConfig.publisherPrivateKey;
|
|
114
124
|
}
|
|
125
|
+
nodeConfig.publisherPrivateKey = sequencerConfig.publisherPrivateKey;
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
if (nodeConfig.p2pEnabled) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
2
|
+
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { dirname, resolve } from 'path';
|
|
5
|
+
|
|
6
|
+
export const getCliVersion = () => {
|
|
7
|
+
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
8
|
+
const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
9
|
+
|
|
10
|
+
// If the version is 0.1.0, this is a placeholder version and we are in a docker container; query release please for the latest version
|
|
11
|
+
if (cliVersion === '0.1.0') {
|
|
12
|
+
const releasePleasePath = resolve(
|
|
13
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
14
|
+
'../../../../.release-please-manifest.json',
|
|
15
|
+
);
|
|
16
|
+
const releaseVersion = JSON.parse(readFileSync(releasePleasePath).toString())['.'];
|
|
17
|
+
return releaseVersion;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return cliVersion;
|
|
21
|
+
};
|
package/src/sandbox/sandbox.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
3
|
import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
4
4
|
import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import {
|
|
5
|
+
import { SignerlessWallet } from '@aztec/aztec.js';
|
|
6
|
+
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
7
|
import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
8
|
import { setupCanonicalL2FeeJuice } from '@aztec/cli/setup-contracts';
|
|
8
9
|
import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|