@aztec/aztec 0.0.1-commit.b655e406 → 0.0.1-commit.c2595eba
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 +6 -3
- 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 +14 -13
- package/dest/cli/aztec_start_options.d.ts +1 -1
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +23 -32
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.d.ts.map +1 -1
- package/dest/cli/cli.js +8 -7
- package/dest/cli/cmds/migrate_ha_db.d.ts +3 -0
- package/dest/cli/cmds/migrate_ha_db.d.ts.map +1 -0
- package/dest/cli/cmds/migrate_ha_db.js +27 -0
- 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 +11 -13
- package/dest/cli/cmds/start_bot.d.ts +1 -1
- package/dest/cli/cmds/start_bot.js +1 -1
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.js +4 -4
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts +2 -2
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +2 -3
- 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 +2 -2
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.js +2 -2
- package/dest/cli/cmds/start_prover_node.d.ts +1 -1
- package/dest/cli/cmds/start_prover_node.js +2 -2
- 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 +1 -1
- package/dest/cli/release_version.d.ts +1 -1
- package/dest/cli/util.d.ts +8 -8
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +3 -3
- package/dest/cli/versioning.d.ts +1 -1
- package/dest/examples/token.d.ts +1 -1
- package/dest/examples/token.js +4 -4
- package/dest/examples/util.d.ts +2 -2
- package/dest/examples/util.d.ts.map +1 -1
- 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 +3 -3
- package/dest/local-network/index.d.ts +4 -0
- package/dest/local-network/index.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/index.js +1 -1
- package/dest/local-network/local-network.d.ts +71 -0
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +43 -32
- package/dest/local-network/sponsored_fpc.d.ts +5 -0
- package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
- package/dest/mnemonic.d.ts +1 -1
- package/dest/splash.d.ts +1 -1
- package/dest/testing/anvil_test_watcher.d.ts +4 -4
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +16 -14
- package/dest/testing/cheat_codes.d.ts +1 -1
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/epoch_test_settler.d.ts +19 -0
- package/dest/testing/epoch_test_settler.d.ts.map +1 -0
- package/dest/testing/epoch_test_settler.js +62 -0
- package/dest/testing/index.d.ts +2 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -0
- package/package.json +41 -37
- package/scripts/aztec.sh +63 -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 +7 -3
- package/src/cli/aztec_start_action.ts +13 -12
- package/src/cli/aztec_start_options.ts +22 -31
- package/src/cli/cli.ts +12 -11
- package/src/cli/cmds/migrate_ha_db.ts +43 -0
- package/src/cli/cmds/start_archiver.ts +7 -18
- package/src/cli/cmds/start_bot.ts +1 -1
- package/src/cli/cmds/start_node.ts +4 -4
- package/src/cli/cmds/start_p2p_bootstrap.ts +3 -3
- package/src/cli/cmds/start_prover_agent.ts +2 -10
- package/src/cli/cmds/start_prover_broker.ts +2 -2
- package/src/cli/cmds/start_prover_node.ts +2 -2
- package/src/cli/util.ts +7 -7
- package/src/examples/token.ts +4 -6
- package/src/examples/util.ts +1 -1
- package/src/index.ts +2 -2
- package/src/{sandbox → local-network}/banana_fpc.ts +11 -7
- package/src/{sandbox → local-network}/index.ts +1 -1
- package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +77 -79
- package/src/{sandbox → local-network}/sponsored_fpc.ts +3 -2
- package/src/testing/anvil_test_watcher.ts +16 -14
- package/src/testing/cheat_codes.ts +3 -2
- package/src/testing/epoch_test_settler.ts +71 -0
- package/src/testing/index.ts +1 -0
- package/dest/cli/cmds/start_blob_sink.d.ts +0 -3
- package/dest/cli/cmds/start_blob_sink.d.ts.map +0 -1
- package/dest/cli/cmds/start_blob_sink.js +0 -33
- package/dest/sandbox/banana_fpc.d.ts +0 -10
- package/dest/sandbox/banana_fpc.d.ts.map +0 -1
- package/dest/sandbox/index.d.ts +0 -4
- package/dest/sandbox/index.d.ts.map +0 -1
- package/dest/sandbox/sandbox.d.ts +0 -74
- package/dest/sandbox/sandbox.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fpc.d.ts +0 -4
- package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
- package/src/cli/cmds/start_blob_sink.ts +0 -57
- /package/dest/{sandbox → local-network}/sponsored_fpc.js +0 -0
|
@@ -9,7 +9,7 @@ import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
|
9
9
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
10
10
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { createLocalNetwork } from '../local-network/index.js';
|
|
13
13
|
import { github, splash } from '../splash.js';
|
|
14
14
|
import { getCliVersion } from './release_version.js';
|
|
15
15
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
@@ -22,20 +22,24 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
22
22
|
const adminServices: NamespacedApiHandlers = {};
|
|
23
23
|
let config: ChainConfig | undefined = undefined;
|
|
24
24
|
|
|
25
|
-
if (options.
|
|
25
|
+
if (options.localNetwork) {
|
|
26
26
|
const cliVersion = getCliVersion();
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
28
|
+
localNetwork.testAccounts = true;
|
|
29
29
|
userLog(`${splash}\n${github}\n\n`);
|
|
30
|
-
userLog(`Setting up Aztec
|
|
30
|
+
userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
|
|
31
31
|
|
|
32
|
-
const { node, stop } = await
|
|
32
|
+
const { node, stop } = await createLocalNetwork(
|
|
33
33
|
{
|
|
34
|
-
l1Mnemonic:
|
|
34
|
+
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
35
35
|
l1RpcUrls: options.l1RpcUrls,
|
|
36
|
-
|
|
37
|
-
testAccounts: sandboxOptions.testAccounts,
|
|
36
|
+
testAccounts: localNetwork.testAccounts,
|
|
38
37
|
realProofs: false,
|
|
38
|
+
// Setting the epoch duration to 4 by default for local network. This allows the epoch to be "proven" faster, so
|
|
39
|
+
// the users can consume out hash without having to wait for a long time.
|
|
40
|
+
// Note: We are not proving anything in the local network (realProofs == false). But in `createLocalNetwork`,
|
|
41
|
+
// the EpochTestSettler will set the out hash to the outbox when an epoch is complete.
|
|
42
|
+
aztecEpochDuration: 4,
|
|
39
43
|
},
|
|
40
44
|
userLog,
|
|
41
45
|
);
|
|
@@ -53,9 +57,6 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
53
57
|
} else if (options.proverNode) {
|
|
54
58
|
const { startProverNode } = await import('./cmds/start_prover_node.js');
|
|
55
59
|
({ config } = await startProverNode(options, signalHandlers, services, userLog));
|
|
56
|
-
} else if (options.blobSink) {
|
|
57
|
-
const { startBlobSink } = await import('./cmds/start_blob_sink.js');
|
|
58
|
-
await startBlobSink(options, signalHandlers, userLog);
|
|
59
60
|
} else if (options.archiver) {
|
|
60
61
|
const { startArchiver } = await import('./cmds/start_archiver.js');
|
|
61
62
|
({ config } = await startArchiver(options, signalHandlers, services));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import {
|
|
3
|
-
import { blobSinkConfigMappings } from '@aztec/blob-sink/server';
|
|
2
|
+
import { blobClientConfigMapping } from '@aztec/blob-client/client/config';
|
|
4
3
|
import { botConfigMappings } from '@aztec/bot/config';
|
|
5
|
-
import {
|
|
4
|
+
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
5
|
+
import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
6
|
+
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
6
7
|
import { getKeys } from '@aztec/foundation/collection';
|
|
7
8
|
import {
|
|
8
9
|
type ConfigMapping,
|
|
@@ -14,12 +15,13 @@ import {
|
|
|
14
15
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
15
16
|
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
16
17
|
import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
|
|
17
|
-
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
|
|
18
|
+
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker/config';
|
|
18
19
|
import { proverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
19
20
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
21
|
+
import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
22
|
+
import { chainConfigMappings, nodeRpcConfigMappings } from '@aztec/stdlib/config';
|
|
23
|
+
import { telemetryClientConfigMappings } from '@aztec/telemetry-client/config';
|
|
24
|
+
import { worldStateConfigMappings } from '@aztec/world-state/config';
|
|
23
25
|
|
|
24
26
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
25
27
|
|
|
@@ -82,6 +84,7 @@ export const universalOptions = [
|
|
|
82
84
|
'l1ConsensusHostApiKeys',
|
|
83
85
|
'l1ConsensusHostApiKeyHeaders',
|
|
84
86
|
'p2pEnabled',
|
|
87
|
+
'fishermanMode',
|
|
85
88
|
...getKeys(chainConfigMappings),
|
|
86
89
|
...getKeys(l1ContractsConfigMappings),
|
|
87
90
|
...getKeys(l1ContractAddressesMapping),
|
|
@@ -107,28 +110,22 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
107
110
|
|
|
108
111
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
109
112
|
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
|
113
|
+
|
|
114
|
+
configToFlag('--fisherman-mode', sharedNodeConfigMappings.fishermanMode),
|
|
110
115
|
],
|
|
111
|
-
|
|
116
|
+
LOCAL_NETWORK: [
|
|
112
117
|
{
|
|
113
|
-
flag: '--
|
|
114
|
-
description: 'Starts Aztec
|
|
118
|
+
flag: '--local-network',
|
|
119
|
+
description: 'Starts Aztec Local Network',
|
|
115
120
|
defaultValue: undefined,
|
|
116
121
|
env: undefined,
|
|
117
122
|
},
|
|
118
123
|
{
|
|
119
|
-
flag: '--
|
|
124
|
+
flag: '--local-network.l1Mnemonic <value>',
|
|
120
125
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
121
126
|
defaultValue: DefaultMnemonic,
|
|
122
127
|
env: 'MNEMONIC',
|
|
123
128
|
},
|
|
124
|
-
{
|
|
125
|
-
flag: '--sandbox.deployAztecContractsSalt <value>',
|
|
126
|
-
description:
|
|
127
|
-
'Numeric salt for deploying L1 Aztec contracts before starting the sandbox. Needs mnemonic or private key to be set.',
|
|
128
|
-
env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
|
|
129
|
-
defaultValue: undefined,
|
|
130
|
-
parseVal: (val: string) => (val ? parseInt(val) : undefined),
|
|
131
|
-
},
|
|
132
129
|
],
|
|
133
130
|
API: [
|
|
134
131
|
{
|
|
@@ -151,14 +148,16 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
151
148
|
defaultValue: '',
|
|
152
149
|
env: 'API_PREFIX',
|
|
153
150
|
},
|
|
151
|
+
configToFlag('--rpcMaxBatchSize', nodeRpcConfigMappings.rpcMaxBatchSize),
|
|
152
|
+
configToFlag('--rpcMaxBodySize', nodeRpcConfigMappings.rpcMaxBodySize),
|
|
154
153
|
],
|
|
155
154
|
ETHEREUM: [
|
|
156
155
|
configToFlag('--l1-chain-id', l1ReaderConfigMappings.l1ChainId),
|
|
157
156
|
// Do not set default for CLI: keep undefined unless provided via flag or env
|
|
158
157
|
configToFlag('--l1-rpc-urls', { ...l1ReaderConfigMappings.l1RpcUrls, defaultValue: undefined }),
|
|
159
|
-
configToFlag('--l1-consensus-host-urls',
|
|
160
|
-
configToFlag('--l1-consensus-host-api-keys',
|
|
161
|
-
configToFlag('--l1-consensus-host-api-key-headers',
|
|
158
|
+
configToFlag('--l1-consensus-host-urls', blobClientConfigMapping.l1ConsensusHostUrls),
|
|
159
|
+
configToFlag('--l1-consensus-host-api-keys', blobClientConfigMapping.l1ConsensusHostApiKeys),
|
|
160
|
+
configToFlag('--l1-consensus-host-api-key-headers', blobClientConfigMapping.l1ConsensusHostApiKeyHeaders),
|
|
162
161
|
],
|
|
163
162
|
'L1 CONTRACTS': [
|
|
164
163
|
configToFlag('--registry-address', l1ContractAddressesMapping.registryAddress),
|
|
@@ -205,21 +204,13 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
205
204
|
'sequencer',
|
|
206
205
|
omitConfigMappings(sequencerClientConfigMappings, [
|
|
207
206
|
'fakeProcessingDelayPerTxMs',
|
|
207
|
+
'fakeThrowAfterProcessingTxCount',
|
|
208
208
|
'skipCollectingAttestations',
|
|
209
209
|
'skipInvalidateBlockAsProposer',
|
|
210
210
|
'blobSinkMapSizeKb',
|
|
211
211
|
]),
|
|
212
212
|
),
|
|
213
213
|
],
|
|
214
|
-
'BLOB SINK': [
|
|
215
|
-
{
|
|
216
|
-
flag: '--blob-sink',
|
|
217
|
-
description: 'Starts Aztec Blob Sink with options',
|
|
218
|
-
defaultValue: undefined,
|
|
219
|
-
env: undefined,
|
|
220
|
-
},
|
|
221
|
-
...getOptions('blobSink', blobSinkConfigMappings),
|
|
222
|
-
],
|
|
223
214
|
'PROVER NODE': [
|
|
224
215
|
{
|
|
225
216
|
flag: '--prover-node',
|
package/src/cli/cli.ts
CHANGED
|
@@ -31,18 +31,19 @@ export function injectAztecCommands(program: Command, userLog: LogFn, debugLogge
|
|
|
31
31
|
|
|
32
32
|
program.configureHelp({ sortSubcommands: true });
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
if (process.env.AZTEC_SHELL_WRAPPER) {
|
|
35
|
+
program.addHelpText(
|
|
36
|
+
'after',
|
|
37
|
+
`
|
|
38
|
+
Additional commands:
|
|
39
|
+
|
|
40
|
+
init [folder] [options] creates a new Aztec Noir project.
|
|
41
|
+
new <path> [options] creates a new Aztec Noir project in a new directory.
|
|
42
|
+
compile [options] compiles Aztec Noir contracts.
|
|
43
|
+
test [options] starts a TXE and runs "nargo test" using it as the oracle resolver.
|
|
44
44
|
`,
|
|
45
|
-
|
|
45
|
+
);
|
|
46
|
+
}
|
|
46
47
|
|
|
47
48
|
program
|
|
48
49
|
.command('preload-crs')
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { runMigrations } from '@aztec/validator-ha-signer/migrations';
|
|
2
|
+
|
|
3
|
+
import type { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export function injectMigrateCommand(program: Command, log: (msg: string) => void): Command {
|
|
6
|
+
const migrateCommand = program.command('migrate-ha-db').description('Run validator-ha-signer database migrations');
|
|
7
|
+
|
|
8
|
+
migrateCommand
|
|
9
|
+
.command('up')
|
|
10
|
+
.description('Apply pending migrations')
|
|
11
|
+
.requiredOption('--database-url <string>', 'PostgreSQL connection string', process.env.DATABASE_URL)
|
|
12
|
+
.option('--verbose', 'Enable verbose output', false)
|
|
13
|
+
.action(async options => {
|
|
14
|
+
const migrations = await runMigrations(options.databaseUrl, {
|
|
15
|
+
direction: 'up',
|
|
16
|
+
verbose: options.verbose,
|
|
17
|
+
});
|
|
18
|
+
if (migrations.length > 0) {
|
|
19
|
+
log(`Applied migrations: ${migrations.join(', ')}`);
|
|
20
|
+
} else {
|
|
21
|
+
log('No migrations to apply - schema is up to date');
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
migrateCommand
|
|
26
|
+
.command('down')
|
|
27
|
+
.description('Rollback the last migration')
|
|
28
|
+
.requiredOption('--database-url <string>', 'PostgreSQL connection string', process.env.DATABASE_URL)
|
|
29
|
+
.option('--verbose', 'Enable verbose output', false)
|
|
30
|
+
.action(async options => {
|
|
31
|
+
const migrations = await runMigrations(options.databaseUrl, {
|
|
32
|
+
direction: 'down',
|
|
33
|
+
verbose: options.verbose,
|
|
34
|
+
});
|
|
35
|
+
if (migrations.length > 0) {
|
|
36
|
+
log(`Rolled back migrations: ${migrations.join(', ')}`);
|
|
37
|
+
} else {
|
|
38
|
+
log('No migrations to rollback');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return program;
|
|
43
|
+
}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Archiver,
|
|
3
|
-
type ArchiverConfig,
|
|
4
|
-
KVArchiverDataStore,
|
|
5
|
-
archiverConfigMappings,
|
|
6
|
-
getArchiverConfigFromEnv,
|
|
7
|
-
} from '@aztec/archiver';
|
|
1
|
+
import { type ArchiverConfig, archiverConfigMappings, createArchiver, getArchiverConfigFromEnv } from '@aztec/archiver';
|
|
8
2
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
9
|
-
import { type
|
|
3
|
+
import { type BlobClientConfig, blobClientConfigMapping, createBlobClient } from '@aztec/blob-client/client';
|
|
10
4
|
import { getL1Config } from '@aztec/cli/config';
|
|
11
5
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
12
6
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
13
|
-
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
14
7
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
15
8
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
16
9
|
|
|
@@ -25,9 +18,9 @@ export async function startArchiver(
|
|
|
25
18
|
services: NamespacedApiHandlers,
|
|
26
19
|
): Promise<{ config: ArchiverConfig & DataStoreConfig }> {
|
|
27
20
|
const envConfig = getArchiverConfigFromEnv();
|
|
28
|
-
const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig &
|
|
21
|
+
const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobClientConfig>(
|
|
29
22
|
options,
|
|
30
|
-
{ ...archiverConfigMappings, ...dataConfigMappings, ...
|
|
23
|
+
{ ...archiverConfigMappings, ...dataConfigMappings, ...blobClientConfigMapping },
|
|
31
24
|
'archiver',
|
|
32
25
|
);
|
|
33
26
|
|
|
@@ -47,13 +40,9 @@ export async function startArchiver(
|
|
|
47
40
|
archiverConfig.l1Contracts = addresses;
|
|
48
41
|
archiverConfig = { ...archiverConfig, ...l1Config };
|
|
49
42
|
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
55
|
-
const blobSinkClient = createBlobSinkClient(archiverConfig, { logger: createLogger('archiver:blob-sink:client') });
|
|
56
|
-
const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, { telemetry, blobSinkClient }, true);
|
|
43
|
+
const telemetry = await initTelemetryClient(getTelemetryClientConfig());
|
|
44
|
+
const blobClient = createBlobClient(archiverConfig, { logger: createLogger('archiver:blob-client:client') });
|
|
45
|
+
const archiver = await createArchiver(archiverConfig, { telemetry, blobClient }, { blockUntilSync: true });
|
|
57
46
|
services.archiver = [archiver, ArchiverApiSchema];
|
|
58
47
|
signalHandlers.push(archiver.stop);
|
|
59
48
|
|
|
@@ -40,7 +40,7 @@ export async function startBot(
|
|
|
40
40
|
const pxeConfig = extractRelevantOptions<PXEConfig & CliPXEOptions>(options, allPxeConfigMappings, 'pxe');
|
|
41
41
|
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
42
42
|
|
|
43
|
-
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
43
|
+
const telemetry = await initTelemetryClient(getTelemetryClientConfig());
|
|
44
44
|
await addBot(options, signalHandlers, services, wallet, aztecNode, telemetry, undefined);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -3,7 +3,7 @@ import { type AztecNodeConfig, aztecNodeConfigMappings, getConfigEnvVars } from
|
|
|
3
3
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
4
|
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
5
5
|
import { getL1Config } from '@aztec/cli/config';
|
|
6
|
-
import { getPublicClient } from '@aztec/ethereum';
|
|
6
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
7
7
|
import { SecretValue } from '@aztec/foundation/config';
|
|
8
8
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
9
9
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
19
19
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
20
20
|
|
|
21
|
-
import { createAztecNode } from '../../
|
|
21
|
+
import { createAztecNode } from '../../local-network/index.js';
|
|
22
22
|
import {
|
|
23
23
|
extractNamespacedOptions,
|
|
24
24
|
extractRelevantOptions,
|
|
@@ -93,7 +93,7 @@ export async function startNode(
|
|
|
93
93
|
...config,
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
if (!options.sequencer) {
|
|
96
|
+
if (!options.sequencer && !nodeConfig.fishermanMode) {
|
|
97
97
|
nodeConfig.disableValidator = true;
|
|
98
98
|
} else {
|
|
99
99
|
const sequencerConfig = {
|
|
@@ -117,7 +117,7 @@ export async function startNode(
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
const telemetryConfig = extractRelevantOptions<TelemetryClientConfig>(options, telemetryClientConfigMappings, 'tel');
|
|
120
|
-
const telemetry = initTelemetryClient(telemetryConfig);
|
|
120
|
+
const telemetry = await initTelemetryClient(telemetryConfig);
|
|
121
121
|
|
|
122
122
|
// Create and start Aztec Node
|
|
123
123
|
const node = await createAztecNode(nodeConfig, { telemetry }, { prefilledPublicData });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
2
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
3
|
-
import {
|
|
3
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
4
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
5
5
|
import { type BootnodeConfig, BootstrapNode, bootnodeConfigMappings } from '@aztec/p2p';
|
|
6
6
|
import { emptyChainConfig } from '@aztec/stdlib/config';
|
|
@@ -25,9 +25,9 @@ export async function startP2PBootstrap(
|
|
|
25
25
|
userLog(`Starting P2P bootstrap node with config: ${jsonStringify(safeConfig)}`);
|
|
26
26
|
|
|
27
27
|
const telemetryConfig = extractRelevantOptions<TelemetryClientConfig>(options, telemetryClientConfigMappings, 'tel');
|
|
28
|
-
const telemetryClient = initTelemetryClient(telemetryConfig);
|
|
28
|
+
const telemetryClient = await initTelemetryClient(telemetryConfig);
|
|
29
29
|
|
|
30
|
-
const store = await createStore('p2p-bootstrap', 1, config
|
|
30
|
+
const store = await createStore('p2p-bootstrap', 1, config);
|
|
31
31
|
const node = new BootstrapNode(store, telemetryClient);
|
|
32
32
|
await node.start(config);
|
|
33
33
|
signalHandlers.push(() => node.stop());
|
|
@@ -53,20 +53,12 @@ export async function startProverAgent(
|
|
|
53
53
|
);
|
|
54
54
|
const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
|
|
55
55
|
|
|
56
|
-
const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
56
|
+
const telemetry = await initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
57
57
|
const prover = await buildServerCircuitProver(config, telemetry);
|
|
58
58
|
const proofStore = new InlineProofStore();
|
|
59
59
|
const agents = times(
|
|
60
60
|
config.proverAgentCount,
|
|
61
|
-
() =>
|
|
62
|
-
new ProvingAgent(
|
|
63
|
-
broker,
|
|
64
|
-
proofStore,
|
|
65
|
-
prover,
|
|
66
|
-
config.proverAgentProofTypes,
|
|
67
|
-
config.proverAgentPollIntervalMs,
|
|
68
|
-
telemetry,
|
|
69
|
-
),
|
|
61
|
+
() => new ProvingAgent(broker, proofStore, prover, config.proverAgentProofTypes, config.proverAgentPollIntervalMs),
|
|
70
62
|
);
|
|
71
63
|
|
|
72
64
|
// expose all agents as individual services
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getL1Config } from '@aztec/cli/config';
|
|
2
|
-
import { getPublicClient } from '@aztec/ethereum';
|
|
2
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
3
3
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
5
|
import {
|
|
@@ -45,7 +45,7 @@ export async function startProverBroker(
|
|
|
45
45
|
config.l1Contracts = addresses;
|
|
46
46
|
config.rollupVersion = rollupConfig.rollupVersion;
|
|
47
47
|
|
|
48
|
-
const client = initTelemetryClient(getTelemetryClientConfig());
|
|
48
|
+
const client = await initTelemetryClient(getTelemetryClientConfig());
|
|
49
49
|
const broker = await createAndStartProvingBroker(config, client);
|
|
50
50
|
|
|
51
51
|
if (options.autoUpdate !== 'disabled' && options.autoUpdateUrl) {
|
|
@@ -2,7 +2,7 @@ import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
|
2
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
3
|
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
4
4
|
import { getL1Config } from '@aztec/cli/config';
|
|
5
|
-
import { getPublicClient } from '@aztec/ethereum';
|
|
5
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
6
6
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
7
7
|
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
8
8
|
import type { LogFn } from '@aztec/foundation/log';
|
|
@@ -67,7 +67,7 @@ export async function startProverNode(
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
70
|
+
const telemetry = await initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
71
71
|
|
|
72
72
|
let broker: ProvingJobBroker;
|
|
73
73
|
if (proverConfig.proverBrokerUrl) {
|
package/src/cli/util.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AccountManager } from '@aztec/aztec.js/wallet';
|
|
5
|
-
import type { ViemClient } from '@aztec/ethereum';
|
|
2
|
+
import type { AccountManager } from '@aztec/aztec.js/wallet';
|
|
3
|
+
import type { ViemClient } from '@aztec/ethereum/types';
|
|
6
4
|
import type { ConfigMappingsType } from '@aztec/foundation/config';
|
|
5
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
7
|
import { type LogFn, createLogger } from '@aztec/foundation/log';
|
|
8
8
|
import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
9
9
|
import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
|
|
10
|
-
import {
|
|
11
|
-
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
10
|
+
import { getTelemetryClient } from '@aztec/telemetry-client/start';
|
|
12
11
|
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
13
12
|
|
|
14
13
|
import chalk from 'chalk';
|
|
@@ -37,7 +36,7 @@ export function shutdown(logFn: LogFn, exitCode: ExitCode, cb?: Array<() => Prom
|
|
|
37
36
|
|
|
38
37
|
logFn('Shutting down...', { exitCode });
|
|
39
38
|
if (cb) {
|
|
40
|
-
shutdownPromise = Promise.allSettled(cb).then(() => process.exit(exitCode));
|
|
39
|
+
shutdownPromise = Promise.allSettled(cb.map(fn => fn())).then(() => process.exit(exitCode));
|
|
41
40
|
} else {
|
|
42
41
|
// synchronously shuts down the process
|
|
43
42
|
// no need to set shutdownPromise on this branch of the if statement because no more code will be executed
|
|
@@ -312,6 +311,7 @@ export async function setupUpdateMonitor(
|
|
|
312
311
|
updateNodeConfig?: (config: object) => Promise<void>,
|
|
313
312
|
) {
|
|
314
313
|
const logger = createLogger('update-check');
|
|
314
|
+
const { UpdateChecker } = await import('@aztec/stdlib/update-checker');
|
|
315
315
|
const checker = await UpdateChecker.new({
|
|
316
316
|
baseURL: updatesLocation,
|
|
317
317
|
publicClient,
|
package/src/examples/token.ts
CHANGED
|
@@ -21,7 +21,7 @@ async function main() {
|
|
|
21
21
|
|
|
22
22
|
const wallet = await TestWallet.create(node);
|
|
23
23
|
|
|
24
|
-
// During
|
|
24
|
+
// During local network setup we deploy a few accounts. Below we add them to our wallet.
|
|
25
25
|
const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
|
|
26
26
|
await wallet.createSchnorrAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
|
|
27
27
|
await wallet.createSchnorrAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
|
|
@@ -32,14 +32,12 @@ async function main() {
|
|
|
32
32
|
logger.info(`Fetched Alice and Bob accounts: ${alice.toString()}, ${bob.toString()}`);
|
|
33
33
|
|
|
34
34
|
logger.info('Deploying Token...');
|
|
35
|
-
const token = await TokenContract.deploy(wallet, alice, 'TokenName', 'TokenSymbol', 18)
|
|
36
|
-
.send({ from: alice })
|
|
37
|
-
.deployed();
|
|
35
|
+
const token = await TokenContract.deploy(wallet, alice, 'TokenName', 'TokenSymbol', 18).send({ from: alice });
|
|
38
36
|
logger.info('Token deployed');
|
|
39
37
|
|
|
40
38
|
// Mint tokens to Alice
|
|
41
39
|
logger.info(`Minting ${ALICE_MINT_BALANCE} more coins to Alice...`);
|
|
42
|
-
await token.methods.mint_to_private(alice, ALICE_MINT_BALANCE).send({ from: alice })
|
|
40
|
+
await token.methods.mint_to_private(alice, ALICE_MINT_BALANCE).send({ from: alice });
|
|
43
41
|
|
|
44
42
|
logger.info(`${ALICE_MINT_BALANCE} tokens were successfully minted by Alice and transferred to private`);
|
|
45
43
|
|
|
@@ -48,7 +46,7 @@ async function main() {
|
|
|
48
46
|
|
|
49
47
|
// We will now transfer tokens from Alice to Bob
|
|
50
48
|
logger.info(`Transferring ${TRANSFER_AMOUNT} tokens from Alice to Bob...`);
|
|
51
|
-
await token.methods.transfer(bob, TRANSFER_AMOUNT).send({ from: alice })
|
|
49
|
+
await token.methods.transfer(bob, TRANSFER_AMOUNT).send({ from: alice });
|
|
52
50
|
|
|
53
51
|
// Check the new balances
|
|
54
52
|
const aliceBalance = await token.methods.balance_of_private(alice).simulate({ from: alice });
|
package/src/examples/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
2
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
|
|
5
5
|
import type { Abi, Narrow } from 'abitype';
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
2
|
+
createLocalNetwork,
|
|
3
3
|
registerDeployedBananaCoinInWalletAndGetAddress,
|
|
4
4
|
registerDeployedBananaFPCInWalletAndGetAddress,
|
|
5
5
|
registerDeployedSponsoredFPCInWalletAndGetAddress,
|
|
6
|
-
} from './
|
|
6
|
+
} from './local-network/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InitialAccountData, getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
5
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
6
6
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -49,12 +49,16 @@ export async function setupBananaFPC(initialAccounts: InitialAccountData[], wall
|
|
|
49
49
|
const bananaCoinAddress = await getBananaCoinAddress(initialAccounts);
|
|
50
50
|
const admin = getBananaAdmin(initialAccounts);
|
|
51
51
|
const [bananaCoin, fpc] = await Promise.all([
|
|
52
|
-
TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal).send({
|
|
53
|
+
from: admin,
|
|
54
|
+
contractAddressSalt: BANANA_COIN_SALT,
|
|
55
|
+
universalDeploy: true,
|
|
56
|
+
}),
|
|
57
|
+
FPCContract.deploy(wallet, bananaCoinAddress, admin).send({
|
|
58
|
+
from: admin,
|
|
59
|
+
contractAddressSalt: BANANA_FPC_SALT,
|
|
60
|
+
universalDeploy: true,
|
|
61
|
+
}),
|
|
58
62
|
]);
|
|
59
63
|
|
|
60
64
|
log(`BananaCoin: ${bananaCoin.address}`);
|