@aztec/aztec 0.0.0-test.0 → 0.0.1-commit.21caa21
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 +1 -1
- package/dest/bin/index.d.ts +1 -1
- package/dest/bin/index.js +20 -12
- package/dest/cli/aztec_start_action.d.ts +1 -1
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +36 -37
- package/dest/cli/aztec_start_options.d.ts +5 -3
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +142 -210
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.d.ts.map +1 -1
- package/dest/cli/cli.js +39 -2
- package/dest/cli/cmds/start_archiver.d.ts +1 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +18 -10
- package/dest/cli/cmds/start_blob_sink.d.ts +1 -1
- package/dest/cli/cmds/start_blob_sink.d.ts.map +1 -1
- package/dest/cli/cmds/start_blob_sink.js +17 -1
- package/dest/cli/cmds/start_bot.d.ts +4 -7
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +24 -13
- package/dest/cli/cmds/start_node.d.ts +2 -2
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +67 -80
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +9 -4
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +31 -2
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +9 -3
- package/dest/cli/cmds/start_prover_node.d.ts +1 -1
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +43 -45
- package/dest/cli/cmds/start_txe.d.ts +1 -1
- package/dest/cli/index.d.ts +1 -1
- package/dest/cli/preload_crs.d.ts +3 -0
- package/dest/cli/preload_crs.d.ts.map +1 -0
- package/dest/cli/preload_crs.js +6 -0
- 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/cli/util.d.ts +38 -7
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +198 -28
- package/dest/cli/versioning.d.ts +1 -1
- package/dest/cli/versioning.js +3 -3
- package/dest/examples/token.d.ts +1 -1
- package/dest/examples/token.js +31 -18
- package/dest/examples/util.d.ts +5 -6
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +5 -6
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/local-network/banana_fpc.d.ts +10 -0
- package/dest/local-network/banana_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/banana_fpc.js +19 -21
- package/dest/local-network/index.d.ts +4 -0
- package/dest/local-network/index.d.ts.map +1 -0
- package/dest/local-network/index.js +3 -0
- package/dest/local-network/local-network.d.ts +74 -0
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +59 -57
- package/dest/local-network/sponsored_fpc.d.ts +5 -0
- package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
- package/dest/local-network/sponsored_fpc.js +18 -0
- package/dest/mnemonic.d.ts +1 -1
- package/dest/splash.d.ts +1 -1
- package/dest/testing/anvil_test_watcher.d.ts +34 -0
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -0
- package/dest/testing/anvil_test_watcher.js +144 -0
- package/dest/testing/cheat_codes.d.ts +41 -0
- package/dest/testing/cheat_codes.d.ts.map +1 -0
- package/dest/testing/cheat_codes.js +62 -0
- package/dest/testing/index.d.ts +4 -0
- package/dest/testing/index.d.ts.map +1 -0
- package/dest/testing/index.js +3 -0
- package/package.json +53 -45
- package/scripts/aztec.sh +60 -0
- package/scripts/compile.sh +44 -0
- package/scripts/extract_function.js +47 -0
- package/scripts/flamegraph.sh +59 -0
- package/scripts/init.sh +35 -0
- package/scripts/new.sh +59 -0
- package/scripts/setup_project.sh +31 -0
- package/src/bin/index.ts +24 -12
- package/src/cli/aztec_start_action.ts +32 -35
- package/src/cli/aztec_start_options.ts +161 -210
- package/src/cli/cli.ts +46 -5
- package/src/cli/cmds/start_archiver.ts +19 -13
- package/src/cli/cmds/start_blob_sink.ts +27 -1
- package/src/cli/cmds/start_bot.ts +35 -12
- package/src/cli/cmds/start_node.ts +90 -85
- package/src/cli/cmds/start_p2p_bootstrap.ts +12 -4
- package/src/cli/cmds/start_prover_agent.ts +22 -2
- package/src/cli/cmds/start_prover_broker.ts +23 -3
- package/src/cli/cmds/start_prover_node.ts +53 -50
- package/src/cli/preload_crs.ts +7 -0
- package/src/cli/release_version.ts +21 -0
- package/src/cli/util.ts +208 -34
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +23 -19
- package/src/examples/util.ts +6 -8
- package/src/index.ts +5 -6
- package/src/{sandbox → local-network}/banana_fpc.ts +20 -25
- package/src/local-network/index.ts +7 -0
- package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +81 -68
- package/src/local-network/sponsored_fpc.ts +26 -0
- package/src/testing/anvil_test_watcher.ts +166 -0
- package/src/testing/cheat_codes.ts +78 -0
- package/src/testing/index.ts +3 -0
- package/dest/cli/chain_l2_config.d.ts +0 -19
- package/dest/cli/chain_l2_config.d.ts.map +0 -1
- package/dest/cli/chain_l2_config.js +0 -56
- package/dest/cli/cmds/start_faucet.d.ts +0 -4
- package/dest/cli/cmds/start_faucet.d.ts.map +0 -1
- package/dest/cli/cmds/start_faucet.js +0 -20
- package/dest/cli/cmds/start_pxe.d.ts +0 -16
- package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
- package/dest/cli/cmds/start_pxe.js +0 -95
- package/dest/cli/get_l1_config.d.ts +0 -7
- package/dest/cli/get_l1_config.d.ts.map +0 -1
- package/dest/cli/get_l1_config.js +0 -13
- package/dest/sandbox/banana_fpc.d.ts +0 -11
- package/dest/sandbox/banana_fpc.d.ts.map +0 -1
- package/dest/sandbox/index.d.ts +0 -5
- package/dest/sandbox/index.d.ts.map +0 -1
- package/dest/sandbox/index.js +0 -4
- package/dest/sandbox/sandbox.d.ts +0 -76
- package/dest/sandbox/sandbox.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fee_payment_method.d.ts +0 -23
- package/dest/sandbox/sponsored_fee_payment_method.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fee_payment_method.js +0 -36
- package/dest/sandbox/sponsored_fpc.d.ts +0 -6
- package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fpc.js +0 -26
- package/src/cli/chain_l2_config.ts +0 -74
- package/src/cli/cmds/start_faucet.ts +0 -34
- package/src/cli/cmds/start_pxe.ts +0 -129
- package/src/cli/get_l1_config.ts +0 -18
- package/src/sandbox/index.ts +0 -5
- package/src/sandbox/sponsored_fee_payment_method.ts +0 -46
- package/src/sandbox/sponsored_fpc.ts +0 -38
package/scripts/init.sh
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
NARGO=${NARGO:-nargo}
|
|
5
|
+
script_path=$(realpath $(dirname "$0"))
|
|
6
|
+
|
|
7
|
+
for arg in "$@"; do
|
|
8
|
+
if [ "$arg" == "--help" ] || [ "$arg" == "-h" ]; then
|
|
9
|
+
cat << 'EOF'
|
|
10
|
+
Aztec Init - Create a new Aztec Noir project in the current directory
|
|
11
|
+
|
|
12
|
+
Usage: aztec init [OPTIONS]
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--name <NAME> Name of the package [default: current directory name]
|
|
16
|
+
--lib Use a library template
|
|
17
|
+
-h, --help Print help
|
|
18
|
+
|
|
19
|
+
This command creates a new Aztec Noir project in the current directory using nargo
|
|
20
|
+
and automatically adds the Aztec.nr dependency to your Nargo.toml file.
|
|
21
|
+
|
|
22
|
+
EOF
|
|
23
|
+
exit 0
|
|
24
|
+
fi
|
|
25
|
+
if [ "$arg" == "--lib" ]; then
|
|
26
|
+
is_contract=0
|
|
27
|
+
fi
|
|
28
|
+
done
|
|
29
|
+
|
|
30
|
+
echo "Initializing Noir project..."
|
|
31
|
+
$NARGO init "$@"
|
|
32
|
+
|
|
33
|
+
if [ "${is_contract:-1}" -eq 1 ]; then
|
|
34
|
+
$script_path/setup_project.sh
|
|
35
|
+
fi
|
package/scripts/new.sh
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
NARGO=${NARGO:-nargo}
|
|
5
|
+
script_path=$(realpath $(dirname "$0"))
|
|
6
|
+
|
|
7
|
+
type_arg="--contract"
|
|
8
|
+
|
|
9
|
+
while [[ $# -gt 0 ]]; do
|
|
10
|
+
case $1 in
|
|
11
|
+
--help|-h)
|
|
12
|
+
cat << 'EOF'
|
|
13
|
+
Aztec New - Create a new Aztec Noir project in a new directory
|
|
14
|
+
|
|
15
|
+
Usage: aztec new [OPTIONS] <PATH>
|
|
16
|
+
|
|
17
|
+
Arguments:
|
|
18
|
+
<PATH> The path to save the new project
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
--name <NAME> Name of the package [default: package directory name]
|
|
22
|
+
--lib Create a library template instead of a contract
|
|
23
|
+
-h, --help Print help
|
|
24
|
+
|
|
25
|
+
This command creates a new Aztec Noir project using nargo and automatically
|
|
26
|
+
adds the Aztec.nr dependency to your Nargo.toml file.
|
|
27
|
+
EOF
|
|
28
|
+
exit 0
|
|
29
|
+
;;
|
|
30
|
+
--lib)
|
|
31
|
+
type_arg="--lib"
|
|
32
|
+
shift
|
|
33
|
+
;;
|
|
34
|
+
--name)
|
|
35
|
+
name_arg="--name $2"
|
|
36
|
+
shift 2
|
|
37
|
+
;;
|
|
38
|
+
*)
|
|
39
|
+
project_path=$1
|
|
40
|
+
shift
|
|
41
|
+
break
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
done
|
|
45
|
+
|
|
46
|
+
if [ -z "$project_path" ]; then
|
|
47
|
+
echo "Error: PATH argument is required"
|
|
48
|
+
echo "Usage: aztec new [OPTIONS] <PATH>"
|
|
49
|
+
echo "Run 'aztec new --help' for more information"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
echo "Creating new Noir project at $project_path..."
|
|
54
|
+
$NARGO new $type_arg ${name_arg:-} $project_path
|
|
55
|
+
|
|
56
|
+
if [ "$type_arg" == "--contract" ]; then
|
|
57
|
+
cd $project_path
|
|
58
|
+
$script_path/setup_project.sh
|
|
59
|
+
fi
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Get the actual aztec version for the git tag.
|
|
5
|
+
AZTEC_VERSION=$(jq -r '.version' $(dirname $0)/../package.json)
|
|
6
|
+
NARGO_TOML_PATH="Nargo.toml"
|
|
7
|
+
MAIN_NR_PATH="src/main.nr"
|
|
8
|
+
|
|
9
|
+
if [ ! -f "$NARGO_TOML_PATH" ]; then
|
|
10
|
+
>&2 echo "Warning: Could not find Nargo.toml at $NARGO_TOML_PATH to add aztec dependency"
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [ ! -f "$MAIN_NR_PATH" ]; then
|
|
15
|
+
>&2 echo "Warning: Could not find main.nr at $MAIN_NR_PATH"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Add aztec dependency to Nargo.toml
|
|
20
|
+
echo "" >> "$NARGO_TOML_PATH"
|
|
21
|
+
echo "aztec = { git=\"https://github.com/AztecProtocol/aztec-nr\", tag=\"v${AZTEC_VERSION}\", directory=\"aztec\" }" >> "$NARGO_TOML_PATH"
|
|
22
|
+
echo "Added aztec dependency (v${AZTEC_VERSION}) to Nargo.toml"
|
|
23
|
+
|
|
24
|
+
# Replace the contents of main.nr with the Aztec contract template
|
|
25
|
+
cat > "$MAIN_NR_PATH" << 'EOF'
|
|
26
|
+
use aztec::macros::aztec;
|
|
27
|
+
|
|
28
|
+
#[aztec]
|
|
29
|
+
contract Main {}
|
|
30
|
+
EOF
|
|
31
|
+
echo "Created main.nr with Aztec contract template"
|
package/src/bin/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//
|
|
3
3
|
import { injectCommands as injectBuilderCommands } from '@aztec/builder';
|
|
4
|
-
import { injectCommands as
|
|
4
|
+
import { injectCommands as injectAztecNodeCommands } from '@aztec/cli/aztec_node';
|
|
5
|
+
import { enrichEnvironmentWithChainName, enrichEnvironmentWithNetworkConfig } from '@aztec/cli/config';
|
|
5
6
|
import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
|
|
6
|
-
import { injectCommands as injectDevnetCommands } from '@aztec/cli/devnet';
|
|
7
7
|
import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
|
|
8
8
|
import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
|
|
9
9
|
import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
10
|
-
import { injectCommands as
|
|
10
|
+
import { injectCommands as injectValidatorKeysCommands } from '@aztec/cli/validator_keys';
|
|
11
|
+
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
11
12
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
12
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
13
13
|
|
|
14
14
|
import { Command } from 'commander';
|
|
15
|
-
import { readFileSync } from 'fs';
|
|
16
|
-
import { dirname, resolve } from 'path';
|
|
17
15
|
|
|
16
|
+
import { NETWORK_FLAG } from '../cli/aztec_start_options.js';
|
|
18
17
|
import { injectAztecCommands } from '../cli/index.js';
|
|
18
|
+
import { getCliVersion } from '../cli/release_version.js';
|
|
19
19
|
|
|
20
20
|
const userLog = createConsoleLogger();
|
|
21
21
|
const debugLogger = createLogger('cli');
|
|
@@ -28,19 +28,31 @@ async function main() {
|
|
|
28
28
|
process.once('SIGINT', shutdown);
|
|
29
29
|
process.once('SIGTERM', shutdown);
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Intercept the setting of a network and enrich the environment with defaults for that network
|
|
32
|
+
let networkValue: string | undefined;
|
|
33
|
+
|
|
34
|
+
const args = process.argv.slice(2);
|
|
35
|
+
const networkIndex = args.findIndex(arg => arg.startsWith(`--${NETWORK_FLAG}=`) || arg === `--${NETWORK_FLAG}`);
|
|
36
|
+
|
|
37
|
+
if (networkIndex !== -1) {
|
|
38
|
+
networkValue = args[networkIndex].split('=')[1] || args[networkIndex + 1];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const networkName = getActiveNetworkName(networkValue);
|
|
42
|
+
await enrichEnvironmentWithNetworkConfig(networkName);
|
|
43
|
+
enrichEnvironmentWithChainName(networkName);
|
|
44
|
+
|
|
45
|
+
const cliVersion = getCliVersion();
|
|
33
46
|
let program = new Command('aztec');
|
|
34
47
|
program.description('Aztec command line interface').version(cliVersion);
|
|
35
48
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
36
49
|
program = injectBuilderCommands(program);
|
|
37
50
|
program = injectContractCommands(program, userLog, debugLogger);
|
|
38
|
-
program = injectInfrastructureCommands(program, userLog
|
|
51
|
+
program = injectInfrastructureCommands(program, userLog);
|
|
39
52
|
program = injectL1Commands(program, userLog, debugLogger);
|
|
40
|
-
program =
|
|
53
|
+
program = injectAztecNodeCommands(program, userLog, debugLogger);
|
|
41
54
|
program = injectMiscCommands(program, userLog);
|
|
42
|
-
program =
|
|
43
|
-
program = injectWalletCommands(program, userLog, debugLogger);
|
|
55
|
+
program = injectValidatorKeysCommands(program, userLog);
|
|
44
56
|
|
|
45
57
|
await program.parseAsync(process.argv);
|
|
46
58
|
}
|
|
@@ -4,43 +4,38 @@ 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
|
-
import { AztecNodeApiSchema
|
|
8
|
+
import { AztecNodeApiSchema } 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 {
|
|
14
|
-
import { dirname, resolve } from 'path';
|
|
15
|
-
|
|
16
|
-
import { createSandbox } from '../sandbox/index.js';
|
|
12
|
+
import { createLocalNetwork } from '../local-network/index.js';
|
|
17
13
|
import { github, splash } from '../splash.js';
|
|
18
|
-
import {
|
|
14
|
+
import { getCliVersion } from './release_version.js';
|
|
19
15
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
20
16
|
import { getVersions } from './versioning.js';
|
|
21
17
|
|
|
22
|
-
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
23
|
-
const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version;
|
|
24
|
-
|
|
25
18
|
export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logger) {
|
|
26
19
|
// list of 'stop' functions to call when process ends
|
|
27
20
|
const signalHandlers: Array<() => Promise<void>> = [];
|
|
28
21
|
const services: NamespacedApiHandlers = {};
|
|
22
|
+
const adminServices: NamespacedApiHandlers = {};
|
|
29
23
|
let config: ChainConfig | undefined = undefined;
|
|
30
24
|
|
|
31
|
-
if (options.
|
|
32
|
-
const
|
|
33
|
-
const
|
|
25
|
+
if (options.localNetwork) {
|
|
26
|
+
const cliVersion = getCliVersion();
|
|
27
|
+
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
28
|
+
localNetwork.testAccounts = true;
|
|
34
29
|
userLog(`${splash}\n${github}\n\n`);
|
|
35
|
-
userLog(`Setting up Aztec
|
|
30
|
+
userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
|
|
36
31
|
|
|
37
|
-
const { node,
|
|
32
|
+
const { node, stop } = await createLocalNetwork(
|
|
38
33
|
{
|
|
39
|
-
l1Mnemonic:
|
|
34
|
+
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
40
35
|
l1RpcUrls: options.l1RpcUrls,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
deployAztecContractsSalt: localNetwork.deployAztecContractsSalt,
|
|
37
|
+
testAccounts: localNetwork.testAccounts,
|
|
38
|
+
realProofs: false,
|
|
44
39
|
},
|
|
45
40
|
userLog,
|
|
46
41
|
);
|
|
@@ -48,19 +43,10 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
48
43
|
// Start Node and PXE JSON-RPC server
|
|
49
44
|
signalHandlers.push(stop);
|
|
50
45
|
services.node = [node, AztecNodeApiSchema];
|
|
51
|
-
if (!sandboxOptions.noPXE) {
|
|
52
|
-
services.pxe = [pxe, PXESchema];
|
|
53
|
-
} else {
|
|
54
|
-
userLog(`Not exposing PXE API through JSON-RPC server`);
|
|
55
|
-
}
|
|
56
46
|
} else {
|
|
57
|
-
// If a network is specified, enrich the environment with the chain config
|
|
58
|
-
if (options.network) {
|
|
59
|
-
await enrichEnvironmentWithChainConfig(options.network);
|
|
60
|
-
}
|
|
61
47
|
if (options.node) {
|
|
62
48
|
const { startNode } = await import('./cmds/start_node.js');
|
|
63
|
-
({ config } = await startNode(options, signalHandlers, services, userLog));
|
|
49
|
+
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
|
|
64
50
|
} else if (options.bot) {
|
|
65
51
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
66
52
|
await startBot(options, signalHandlers, services, userLog);
|
|
@@ -70,9 +56,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
70
56
|
} else if (options.blobSink) {
|
|
71
57
|
const { startBlobSink } = await import('./cmds/start_blob_sink.js');
|
|
72
58
|
await startBlobSink(options, signalHandlers, userLog);
|
|
73
|
-
} else if (options.pxe) {
|
|
74
|
-
const { startPXE } = await import('./cmds/start_pxe.js');
|
|
75
|
-
({ config } = await startPXE(options, signalHandlers, services, userLog));
|
|
76
59
|
} else if (options.archiver) {
|
|
77
60
|
const { startArchiver } = await import('./cmds/start_archiver.js');
|
|
78
61
|
({ config } = await startArchiver(options, signalHandlers, services));
|
|
@@ -91,9 +74,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
91
74
|
} else if (options.sequencer) {
|
|
92
75
|
userLog(`Cannot run a standalone sequencer without a node`);
|
|
93
76
|
process.exit(1);
|
|
94
|
-
} else if (options.faucet) {
|
|
95
|
-
const { startFaucet } = await import('./cmds/start_faucet.js');
|
|
96
|
-
await startFaucet(options, signalHandlers, services, userLog);
|
|
97
77
|
} else {
|
|
98
78
|
userLog(`No module specified to start`);
|
|
99
79
|
process.exit(1);
|
|
@@ -102,13 +82,30 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
102
82
|
|
|
103
83
|
installSignalHandlers(debugLogger.info, signalHandlers);
|
|
104
84
|
const versions = getVersions(config);
|
|
85
|
+
|
|
86
|
+
// Start the main JSON-RPC server
|
|
105
87
|
if (Object.entries(services).length > 0) {
|
|
106
88
|
const rpcServer = createNamespacedSafeJsonRpcServer(services, {
|
|
107
89
|
http200OnError: false,
|
|
108
90
|
log: debugLogger,
|
|
109
91
|
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
|
|
92
|
+
maxBatchSize: options.rpcMaxBatchSize,
|
|
93
|
+
maxBodySizeBytes: options.rpcMaxBodySize,
|
|
110
94
|
});
|
|
111
95
|
const { port } = await startHttpRpcServer(rpcServer, { port: options.port });
|
|
112
96
|
debugLogger.info(`Aztec Server listening on port ${port}`, versions);
|
|
113
97
|
}
|
|
98
|
+
|
|
99
|
+
// If there are any admin services, start a separate JSON-RPC server for them
|
|
100
|
+
if (Object.entries(adminServices).length > 0) {
|
|
101
|
+
const rpcServer = createNamespacedSafeJsonRpcServer(adminServices, {
|
|
102
|
+
http200OnError: false,
|
|
103
|
+
log: debugLogger,
|
|
104
|
+
middlewares: [getOtelJsonRpcPropagationMiddleware(), getVersioningMiddleware(versions)],
|
|
105
|
+
maxBatchSize: options.rpcMaxBatchSize,
|
|
106
|
+
maxBodySizeBytes: options.rpcMaxBodySize,
|
|
107
|
+
});
|
|
108
|
+
const { port } = await startHttpRpcServer(rpcServer, { port: options.adminPort });
|
|
109
|
+
debugLogger.info(`Aztec Server admin API listening on port ${port}`, versions);
|
|
110
|
+
}
|
|
114
111
|
}
|