@aztec/cli 3.0.0-nightly.20251128 → 3.0.0-nightly.20251201.2

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.
@@ -5,7 +5,8 @@ import { type NetworkConfig, type NetworkNames } from '@aztec/foundation/config'
5
5
  *
6
6
  * @param networkName - The network name to fetch config for
7
7
  * @param cacheDir - Optional cache directory for storing fetched config
8
- * @returns Remote configuration for the specified network, or undefined if not found/error
8
+ * @returns Remote configuration for the specified network, or undefined if network not found in config
9
+ * @throws Error if both primary and fallback URLs fail to fetch
9
10
  */
10
11
  export declare function getNetworkConfig(networkName: NetworkNames, cacheDir?: string): Promise<NetworkConfig | undefined>;
11
12
  /**
@@ -14,6 +15,8 @@ export declare function getNetworkConfig(networkName: NetworkNames, cacheDir?: s
14
15
  * from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
15
16
  *
16
17
  * @param networkName - The network name to fetch remote config for
18
+ * @throws Error if network config fetch fails (network errors, parse errors, etc.)
19
+ * Does not throw if the network simply doesn't exist in the config - just returns without enriching
17
20
  */
18
21
  export declare function enrichEnvironmentWithNetworkConfig(networkName: NetworkNames): Promise<void>;
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV0d29ya19jb25maWcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvbmV0d29ya19jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssYUFBYSxFQUEwQixLQUFLLFlBQVksRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBYXpHOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0IsZ0JBQWdCLENBQ3BDLFdBQVcsRUFBRSxZQUFZLEVBQ3pCLFFBQVEsQ0FBQyxFQUFFLE1BQU0sR0FDaEIsT0FBTyxDQUFDLGFBQWEsR0FBRyxTQUFTLENBQUMsQ0FhcEM7QUEwREQ7Ozs7OztHQU1HO0FBQ0gsd0JBQXNCLGtDQUFrQyxDQUFDLFdBQVcsRUFBRSxZQUFZLGlCQW9CakYifQ==
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV0d29ya19jb25maWcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWcvbmV0d29ya19jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssYUFBYSxFQUEwQixLQUFLLFlBQVksRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBYXpHOzs7Ozs7OztHQVFHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUNwQyxXQUFXLEVBQUUsWUFBWSxFQUN6QixRQUFRLENBQUMsRUFBRSxNQUFNLEdBQ2hCLE9BQU8sQ0FBQyxhQUFhLEdBQUcsU0FBUyxDQUFDLENBOEJwQztBQXVERDs7Ozs7Ozs7R0FRRztBQUNILHdCQUFzQixrQ0FBa0MsQ0FBQyxXQUFXLEVBQUUsWUFBWSxpQkFvQmpGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"network_config.d.ts","sourceRoot":"","sources":["../../src/config/network_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA0B,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAazG;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAapC;AA0DD;;;;;;GAMG;AACH,wBAAsB,kCAAkC,CAAC,WAAW,EAAE,YAAY,iBAoBjF"}
1
+ {"version":3,"file":"network_config.d.ts","sourceRoot":"","sources":["../../src/config/network_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA0B,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAazG;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CA8BpC;AAuDD;;;;;;;;GAQG;AACH,wBAAsB,kCAAkC,CAAC,WAAW,EAAE,YAAY,iBAoBjF"}
@@ -12,15 +12,32 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
12
12
  *
13
13
  * @param networkName - The network name to fetch config for
14
14
  * @param cacheDir - Optional cache directory for storing fetched config
15
- * @returns Remote configuration for the specified network, or undefined if not found/error
15
+ * @returns Remote configuration for the specified network, or undefined if network not found in config
16
+ * @throws Error if both primary and fallback URLs fail to fetch
16
17
  */ export async function getNetworkConfig(networkName, cacheDir) {
17
18
  // Try with the primary URL (env var or default)
18
19
  const configLocation = process.env.NETWORK_CONFIG_LOCATION || DEFAULT_CONFIG_URL;
20
+ let primaryError;
21
+ let config;
19
22
  // First try the primary config location
20
- let config = await fetchNetworkConfigFromUrl(configLocation, networkName, cacheDir);
23
+ try {
24
+ config = await fetchNetworkConfigFromUrl(configLocation, networkName, cacheDir);
25
+ } catch (error) {
26
+ primaryError = error;
27
+ }
21
28
  // If primary fails and we were using the default URL, try the fallback
22
29
  if (!config && configLocation === DEFAULT_CONFIG_URL) {
23
- config = await fetchNetworkConfigFromUrl(FALLBACK_CONFIG_URL, networkName, cacheDir);
30
+ try {
31
+ config = await fetchNetworkConfigFromUrl(FALLBACK_CONFIG_URL, networkName, cacheDir);
32
+ } catch {
33
+ // Both failed - throw the primary error
34
+ if (primaryError) {
35
+ throw primaryError;
36
+ }
37
+ }
38
+ } else if (primaryError) {
39
+ // Primary failed and no fallback to try
40
+ throw primaryError;
24
41
  }
25
42
  return config;
26
43
  }
@@ -29,7 +46,8 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
29
46
  * @param configLocation - The URL or file path to fetch from
30
47
  * @param networkName - The network name to fetch config for
31
48
  * @param cacheDir - Optional cache directory for storing fetched config
32
- * @returns Remote configuration for the specified network, or undefined if not found/error
49
+ * @returns Remote configuration for the specified network, or undefined if network not found in config, or undefined if URL invalid
50
+ * @throws Error if fetch/parse fails
33
51
  */ async function fetchNetworkConfigFromUrl(configLocation, networkName, cacheDir) {
34
52
  let url;
35
53
  try {
@@ -43,28 +61,24 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
43
61
  if (!url) {
44
62
  return undefined;
45
63
  }
46
- try {
47
- let rawConfig;
48
- if (url.protocol === 'http:' || url.protocol === 'https:') {
49
- rawConfig = await cachedFetch(url.href, {
50
- cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
51
- cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined
52
- });
53
- } else if (url.protocol === 'file:') {
54
- rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
55
- } else {
56
- throw new Error('Unsupported Aztec network config protocol: ' + url.href);
57
- }
58
- if (!rawConfig) {
59
- return undefined;
60
- }
61
- const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
62
- if (networkName in networkConfigMap) {
63
- return networkConfigMap[networkName];
64
- } else {
65
- return undefined;
66
- }
67
- } catch {
64
+ let rawConfig;
65
+ if (url.protocol === 'http:' || url.protocol === 'https:') {
66
+ rawConfig = await cachedFetch(url.href, {
67
+ cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
68
+ cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined
69
+ });
70
+ } else if (url.protocol === 'file:') {
71
+ rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
72
+ } else {
73
+ throw new Error('Unsupported Aztec network config protocol: ' + url.href);
74
+ }
75
+ if (!rawConfig) {
76
+ return undefined;
77
+ }
78
+ const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
79
+ if (networkName in networkConfigMap) {
80
+ return networkConfigMap[networkName];
81
+ } else {
68
82
  return undefined;
69
83
  }
70
84
  }
@@ -74,6 +88,8 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
74
88
  * from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
75
89
  *
76
90
  * @param networkName - The network name to fetch remote config for
91
+ * @throws Error if network config fetch fails (network errors, parse errors, etc.)
92
+ * Does not throw if the network simply doesn't exist in the config - just returns without enriching
77
93
  */ export async function enrichEnvironmentWithNetworkConfig(networkName) {
78
94
  if (networkName === 'local') {
79
95
  return; // No remote config for local development
@@ -81,7 +97,7 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
81
97
  const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
82
98
  const networkConfig = await getNetworkConfig(networkName, cacheDir);
83
99
  if (!networkConfig) {
84
- throw new Error(`Failed to fetch network config for network: ${networkName}`);
100
+ return; // Network not found in config, continue without enriching
85
101
  }
86
102
  enrichVar('BOOTSTRAP_NODES', networkConfig.bootnodes.join(','));
87
103
  enrichVar('L1_CHAIN_ID', String(networkConfig.l1ChainId));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "3.0.0-nightly.20251128",
3
+ "version": "3.0.0-nightly.20251201.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
@@ -71,21 +71,21 @@
71
71
  ]
72
72
  },
73
73
  "dependencies": {
74
- "@aztec/accounts": "3.0.0-nightly.20251128",
75
- "@aztec/archiver": "3.0.0-nightly.20251128",
76
- "@aztec/aztec.js": "3.0.0-nightly.20251128",
77
- "@aztec/constants": "3.0.0-nightly.20251128",
78
- "@aztec/entrypoints": "3.0.0-nightly.20251128",
79
- "@aztec/ethereum": "3.0.0-nightly.20251128",
80
- "@aztec/foundation": "3.0.0-nightly.20251128",
81
- "@aztec/l1-artifacts": "3.0.0-nightly.20251128",
82
- "@aztec/node-keystore": "3.0.0-nightly.20251128",
83
- "@aztec/node-lib": "3.0.0-nightly.20251128",
84
- "@aztec/p2p": "3.0.0-nightly.20251128",
85
- "@aztec/protocol-contracts": "3.0.0-nightly.20251128",
86
- "@aztec/stdlib": "3.0.0-nightly.20251128",
87
- "@aztec/test-wallet": "3.0.0-nightly.20251128",
88
- "@aztec/world-state": "3.0.0-nightly.20251128",
74
+ "@aztec/accounts": "3.0.0-nightly.20251201.2",
75
+ "@aztec/archiver": "3.0.0-nightly.20251201.2",
76
+ "@aztec/aztec.js": "3.0.0-nightly.20251201.2",
77
+ "@aztec/constants": "3.0.0-nightly.20251201.2",
78
+ "@aztec/entrypoints": "3.0.0-nightly.20251201.2",
79
+ "@aztec/ethereum": "3.0.0-nightly.20251201.2",
80
+ "@aztec/foundation": "3.0.0-nightly.20251201.2",
81
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251201.2",
82
+ "@aztec/node-keystore": "3.0.0-nightly.20251201.2",
83
+ "@aztec/node-lib": "3.0.0-nightly.20251201.2",
84
+ "@aztec/p2p": "3.0.0-nightly.20251201.2",
85
+ "@aztec/protocol-contracts": "3.0.0-nightly.20251201.2",
86
+ "@aztec/stdlib": "3.0.0-nightly.20251201.2",
87
+ "@aztec/test-wallet": "3.0.0-nightly.20251201.2",
88
+ "@aztec/world-state": "3.0.0-nightly.20251201.2",
89
89
  "@ethersproject/wallet": "^5.8.0",
90
90
  "@iarna/toml": "^2.2.5",
91
91
  "@libp2p/peer-id-factory": "^3.0.4",
@@ -99,9 +99,9 @@
99
99
  "viem": "npm:@aztec/viem@2.38.2"
100
100
  },
101
101
  "devDependencies": {
102
- "@aztec/aztec-node": "3.0.0-nightly.20251128",
103
- "@aztec/kv-store": "3.0.0-nightly.20251128",
104
- "@aztec/telemetry-client": "3.0.0-nightly.20251128",
102
+ "@aztec/aztec-node": "3.0.0-nightly.20251201.2",
103
+ "@aztec/kv-store": "3.0.0-nightly.20251201.2",
104
+ "@aztec/telemetry-client": "3.0.0-nightly.20251201.2",
105
105
  "@jest/globals": "^30.0.0",
106
106
  "@types/jest": "^30.0.0",
107
107
  "@types/lodash.chunk": "^4.2.9",
@@ -118,15 +118,15 @@
118
118
  "typescript": "^5.3.3"
119
119
  },
120
120
  "peerDependencies": {
121
- "@aztec/accounts": "3.0.0-nightly.20251128",
122
- "@aztec/bb-prover": "3.0.0-nightly.20251128",
123
- "@aztec/ethereum": "3.0.0-nightly.20251128",
124
- "@aztec/l1-artifacts": "3.0.0-nightly.20251128",
125
- "@aztec/noir-contracts.js": "3.0.0-nightly.20251128",
126
- "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251128",
127
- "@aztec/noir-test-contracts.js": "3.0.0-nightly.20251128",
128
- "@aztec/protocol-contracts": "3.0.0-nightly.20251128",
129
- "@aztec/stdlib": "3.0.0-nightly.20251128"
121
+ "@aztec/accounts": "3.0.0-nightly.20251201.2",
122
+ "@aztec/bb-prover": "3.0.0-nightly.20251201.2",
123
+ "@aztec/ethereum": "3.0.0-nightly.20251201.2",
124
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251201.2",
125
+ "@aztec/noir-contracts.js": "3.0.0-nightly.20251201.2",
126
+ "@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251201.2",
127
+ "@aztec/noir-test-contracts.js": "3.0.0-nightly.20251201.2",
128
+ "@aztec/protocol-contracts": "3.0.0-nightly.20251201.2",
129
+ "@aztec/stdlib": "3.0.0-nightly.20251201.2"
130
130
  },
131
131
  "files": [
132
132
  "dest",
@@ -17,7 +17,8 @@ const NETWORK_CONFIG_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour
17
17
  *
18
18
  * @param networkName - The network name to fetch config for
19
19
  * @param cacheDir - Optional cache directory for storing fetched config
20
- * @returns Remote configuration for the specified network, or undefined if not found/error
20
+ * @returns Remote configuration for the specified network, or undefined if network not found in config
21
+ * @throws Error if both primary and fallback URLs fail to fetch
21
22
  */
22
23
  export async function getNetworkConfig(
23
24
  networkName: NetworkNames,
@@ -26,12 +27,29 @@ export async function getNetworkConfig(
26
27
  // Try with the primary URL (env var or default)
27
28
  const configLocation = process.env.NETWORK_CONFIG_LOCATION || DEFAULT_CONFIG_URL;
28
29
 
30
+ let primaryError: Error | undefined;
31
+ let config: NetworkConfig | undefined;
32
+
29
33
  // First try the primary config location
30
- let config = await fetchNetworkConfigFromUrl(configLocation, networkName, cacheDir);
34
+ try {
35
+ config = await fetchNetworkConfigFromUrl(configLocation, networkName, cacheDir);
36
+ } catch (error) {
37
+ primaryError = error as Error;
38
+ }
31
39
 
32
40
  // If primary fails and we were using the default URL, try the fallback
33
41
  if (!config && configLocation === DEFAULT_CONFIG_URL) {
34
- config = await fetchNetworkConfigFromUrl(FALLBACK_CONFIG_URL, networkName, cacheDir);
42
+ try {
43
+ config = await fetchNetworkConfigFromUrl(FALLBACK_CONFIG_URL, networkName, cacheDir);
44
+ } catch {
45
+ // Both failed - throw the primary error
46
+ if (primaryError) {
47
+ throw primaryError;
48
+ }
49
+ }
50
+ } else if (primaryError) {
51
+ // Primary failed and no fallback to try
52
+ throw primaryError;
35
53
  }
36
54
 
37
55
  return config;
@@ -42,7 +60,8 @@ export async function getNetworkConfig(
42
60
  * @param configLocation - The URL or file path to fetch from
43
61
  * @param networkName - The network name to fetch config for
44
62
  * @param cacheDir - Optional cache directory for storing fetched config
45
- * @returns Remote configuration for the specified network, or undefined if not found/error
63
+ * @returns Remote configuration for the specified network, or undefined if network not found in config, or undefined if URL invalid
64
+ * @throws Error if fetch/parse fails
46
65
  */
47
66
  async function fetchNetworkConfigFromUrl(
48
67
  configLocation: string,
@@ -64,31 +83,27 @@ async function fetchNetworkConfigFromUrl(
64
83
  return undefined;
65
84
  }
66
85
 
67
- try {
68
- let rawConfig: any;
69
-
70
- if (url.protocol === 'http:' || url.protocol === 'https:') {
71
- rawConfig = await cachedFetch(url.href, {
72
- cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
73
- cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined,
74
- });
75
- } else if (url.protocol === 'file:') {
76
- rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
77
- } else {
78
- throw new Error('Unsupported Aztec network config protocol: ' + url.href);
79
- }
86
+ let rawConfig: any;
87
+
88
+ if (url.protocol === 'http:' || url.protocol === 'https:') {
89
+ rawConfig = await cachedFetch(url.href, {
90
+ cacheDurationMs: NETWORK_CONFIG_CACHE_DURATION_MS,
91
+ cacheFile: cacheDir ? join(cacheDir, networkName, 'network_config.json') : undefined,
92
+ });
93
+ } else if (url.protocol === 'file:') {
94
+ rawConfig = JSON.parse(await readFile(url.pathname, 'utf-8'));
95
+ } else {
96
+ throw new Error('Unsupported Aztec network config protocol: ' + url.href);
97
+ }
80
98
 
81
- if (!rawConfig) {
82
- return undefined;
83
- }
99
+ if (!rawConfig) {
100
+ return undefined;
101
+ }
84
102
 
85
- const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
86
- if (networkName in networkConfigMap) {
87
- return networkConfigMap[networkName];
88
- } else {
89
- return undefined;
90
- }
91
- } catch {
103
+ const networkConfigMap = NetworkConfigMapSchema.parse(rawConfig);
104
+ if (networkName in networkConfigMap) {
105
+ return networkConfigMap[networkName];
106
+ } else {
92
107
  return undefined;
93
108
  }
94
109
  }
@@ -99,6 +114,8 @@ async function fetchNetworkConfigFromUrl(
99
114
  * from the remote config, following the same pattern as enrichEnvironmentWithChainConfig().
100
115
  *
101
116
  * @param networkName - The network name to fetch remote config for
117
+ * @throws Error if network config fetch fails (network errors, parse errors, etc.)
118
+ * Does not throw if the network simply doesn't exist in the config - just returns without enriching
102
119
  */
103
120
  export async function enrichEnvironmentWithNetworkConfig(networkName: NetworkNames) {
104
121
  if (networkName === 'local') {
@@ -109,7 +126,7 @@ export async function enrichEnvironmentWithNetworkConfig(networkName: NetworkNam
109
126
  const networkConfig = await getNetworkConfig(networkName, cacheDir);
110
127
 
111
128
  if (!networkConfig) {
112
- throw new Error(`Failed to fetch network config for network: ${networkName}`);
129
+ return; // Network not found in config, continue without enriching
113
130
  }
114
131
 
115
132
  enrichVar('BOOTSTRAP_NODES', networkConfig.bootnodes.join(','));