@aztec/archiver 0.0.1-commit.5daedc8 → 0.0.1-commit.6201a7b05
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 +162 -22
- package/dest/archiver.d.ts +147 -0
- package/dest/archiver.d.ts.map +1 -0
- package/dest/archiver.js +788 -0
- package/dest/config.d.ts +32 -0
- package/dest/config.d.ts.map +1 -0
- package/dest/config.js +83 -0
- package/dest/errors.d.ts +92 -0
- package/dest/errors.d.ts.map +1 -0
- package/dest/errors.js +136 -0
- package/dest/factory.d.ts +8 -7
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +100 -15
- package/dest/index.d.ts +12 -4
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +10 -3
- package/dest/interfaces.d.ts +9 -0
- package/dest/interfaces.d.ts.map +1 -0
- package/dest/interfaces.js +3 -0
- package/dest/l1/bin/retrieve-calldata.d.ts +3 -0
- package/dest/l1/bin/retrieve-calldata.d.ts.map +1 -0
- package/dest/l1/bin/retrieve-calldata.js +152 -0
- package/dest/l1/calldata_retriever.d.ts +136 -0
- package/dest/l1/calldata_retriever.d.ts.map +1 -0
- package/dest/l1/calldata_retriever.js +408 -0
- package/dest/l1/data_retrieval.d.ts +97 -0
- package/dest/l1/data_retrieval.d.ts.map +1 -0
- package/dest/{archiver → l1}/data_retrieval.js +86 -165
- package/dest/l1/debug_tx.d.ts +19 -0
- package/dest/l1/debug_tx.d.ts.map +1 -0
- package/dest/l1/debug_tx.js +73 -0
- package/dest/l1/spire_proposer.d.ts +70 -0
- package/dest/l1/spire_proposer.d.ts.map +1 -0
- package/dest/l1/spire_proposer.js +149 -0
- package/dest/l1/trace_tx.d.ts +97 -0
- package/dest/l1/trace_tx.d.ts.map +1 -0
- package/dest/l1/trace_tx.js +91 -0
- package/dest/l1/types.d.ts +12 -0
- package/dest/l1/types.d.ts.map +1 -0
- package/dest/l1/types.js +3 -0
- package/dest/l1/validate_historical_logs.d.ts +23 -0
- package/dest/l1/validate_historical_logs.d.ts.map +1 -0
- package/dest/l1/validate_historical_logs.js +108 -0
- package/dest/l1/validate_trace.d.ts +32 -0
- package/dest/l1/validate_trace.d.ts.map +1 -0
- package/dest/l1/validate_trace.js +154 -0
- package/dest/modules/data_source_base.d.ts +95 -0
- package/dest/modules/data_source_base.d.ts.map +1 -0
- package/dest/modules/data_source_base.js +234 -0
- package/dest/modules/data_store_updater.d.ts +93 -0
- package/dest/modules/data_store_updater.d.ts.map +1 -0
- package/dest/modules/data_store_updater.js +345 -0
- package/dest/modules/instrumentation.d.ts +55 -0
- package/dest/modules/instrumentation.d.ts.map +1 -0
- package/dest/modules/instrumentation.js +143 -0
- package/dest/modules/l1_synchronizer.d.ts +77 -0
- package/dest/modules/l1_synchronizer.d.ts.map +1 -0
- package/dest/modules/l1_synchronizer.js +1265 -0
- package/dest/modules/validation.d.ts +18 -0
- package/dest/modules/validation.d.ts.map +1 -0
- package/dest/{archiver → modules}/validation.js +13 -7
- package/dest/store/block_store.d.ts +262 -0
- package/dest/store/block_store.d.ts.map +1 -0
- package/dest/store/block_store.js +1048 -0
- package/dest/store/contract_class_store.d.ts +17 -0
- package/dest/store/contract_class_store.d.ts.map +1 -0
- package/dest/store/contract_class_store.js +64 -0
- package/dest/store/contract_instance_store.d.ts +24 -0
- package/dest/store/contract_instance_store.d.ts.map +1 -0
- package/dest/{archiver/kv_archiver_store → store}/contract_instance_store.js +7 -3
- package/dest/store/kv_archiver_store.d.ts +401 -0
- package/dest/store/kv_archiver_store.d.ts.map +1 -0
- package/dest/store/kv_archiver_store.js +525 -0
- package/dest/store/l2_tips_cache.d.ts +20 -0
- package/dest/store/l2_tips_cache.d.ts.map +1 -0
- package/dest/store/l2_tips_cache.js +109 -0
- package/dest/store/log_store.d.ts +57 -0
- package/dest/store/log_store.d.ts.map +1 -0
- package/dest/store/log_store.js +531 -0
- package/dest/store/message_store.d.ts +44 -0
- package/dest/store/message_store.d.ts.map +1 -0
- package/dest/{archiver/kv_archiver_store → store}/message_store.js +36 -23
- package/dest/{archiver/structs → structs}/data_retrieval.d.ts +1 -1
- package/dest/structs/data_retrieval.d.ts.map +1 -0
- package/dest/structs/inbox_message.d.ts +15 -0
- package/dest/structs/inbox_message.d.ts.map +1 -0
- package/dest/{archiver/structs → structs}/inbox_message.js +6 -5
- package/dest/structs/published.d.ts +2 -0
- package/dest/structs/published.d.ts.map +1 -0
- package/dest/test/fake_l1_state.d.ts +214 -0
- package/dest/test/fake_l1_state.d.ts.map +1 -0
- package/dest/test/fake_l1_state.js +517 -0
- package/dest/test/index.d.ts +2 -1
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +4 -1
- package/dest/test/mock_archiver.d.ts +16 -8
- package/dest/test/mock_archiver.d.ts.map +1 -1
- package/dest/test/mock_archiver.js +19 -14
- package/dest/test/mock_l1_to_l2_message_source.d.ts +7 -6
- package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/test/mock_l1_to_l2_message_source.js +23 -12
- package/dest/test/mock_l2_block_source.d.ts +68 -20
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +298 -85
- package/dest/test/mock_structs.d.ts +83 -4
- package/dest/test/mock_structs.d.ts.map +1 -1
- package/dest/test/mock_structs.js +157 -11
- package/dest/test/noop_l1_archiver.d.ts +26 -0
- package/dest/test/noop_l1_archiver.d.ts.map +1 -0
- package/dest/test/noop_l1_archiver.js +74 -0
- package/package.json +20 -20
- package/src/archiver.ts +566 -0
- package/src/{archiver/config.ts → config.ts} +51 -14
- package/src/errors.ts +213 -0
- package/src/factory.ts +155 -17
- package/src/index.ts +12 -3
- package/src/interfaces.ts +9 -0
- package/src/l1/README.md +55 -0
- package/src/l1/bin/retrieve-calldata.ts +194 -0
- package/src/l1/calldata_retriever.ts +523 -0
- package/src/{archiver → l1}/data_retrieval.ts +155 -247
- package/src/l1/debug_tx.ts +99 -0
- package/src/l1/spire_proposer.ts +152 -0
- package/src/l1/trace_tx.ts +128 -0
- package/src/l1/types.ts +13 -0
- package/src/l1/validate_historical_logs.ts +140 -0
- package/src/l1/validate_trace.ts +229 -0
- package/src/modules/data_source_base.ts +364 -0
- package/src/modules/data_store_updater.ts +465 -0
- package/src/modules/instrumentation.ts +204 -0
- package/src/modules/l1_synchronizer.ts +1126 -0
- package/src/{archiver → modules}/validation.ts +21 -15
- package/src/store/block_store.ts +1361 -0
- package/src/store/contract_class_store.ts +82 -0
- package/src/{archiver/kv_archiver_store → store}/contract_instance_store.ts +10 -7
- package/src/store/kv_archiver_store.ts +765 -0
- package/src/store/l2_tips_cache.ts +134 -0
- package/src/store/log_store.ts +733 -0
- package/src/{archiver/kv_archiver_store → store}/message_store.ts +48 -28
- package/src/{archiver/structs → structs}/inbox_message.ts +7 -7
- package/src/{archiver/structs → structs}/published.ts +0 -1
- package/src/test/fake_l1_state.ts +770 -0
- package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
- package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
- package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
- package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
- package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
- package/src/test/fixtures/trace_transaction-proxied.json +128 -0
- package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
- package/src/test/index.ts +4 -0
- package/src/test/mock_archiver.ts +23 -16
- package/src/test/mock_l1_to_l2_message_source.ts +19 -11
- package/src/test/mock_l2_block_source.ts +367 -93
- package/src/test/mock_structs.ts +289 -13
- package/src/test/noop_l1_archiver.ts +117 -0
- package/dest/archiver/archiver.d.ts +0 -287
- package/dest/archiver/archiver.d.ts.map +0 -1
- package/dest/archiver/archiver.js +0 -1408
- package/dest/archiver/archiver_store.d.ts +0 -255
- package/dest/archiver/archiver_store.d.ts.map +0 -1
- package/dest/archiver/archiver_store.js +0 -4
- package/dest/archiver/archiver_store_test_suite.d.ts +0 -8
- package/dest/archiver/archiver_store_test_suite.d.ts.map +0 -1
- package/dest/archiver/archiver_store_test_suite.js +0 -1289
- package/dest/archiver/config.d.ts +0 -21
- package/dest/archiver/config.d.ts.map +0 -1
- package/dest/archiver/config.js +0 -55
- package/dest/archiver/data_retrieval.d.ts +0 -79
- package/dest/archiver/data_retrieval.d.ts.map +0 -1
- package/dest/archiver/errors.d.ts +0 -12
- package/dest/archiver/errors.d.ts.map +0 -1
- package/dest/archiver/errors.js +0 -17
- package/dest/archiver/index.d.ts +0 -7
- package/dest/archiver/index.d.ts.map +0 -1
- package/dest/archiver/index.js +0 -4
- package/dest/archiver/instrumentation.d.ts +0 -35
- package/dest/archiver/instrumentation.d.ts.map +0 -1
- package/dest/archiver/instrumentation.js +0 -140
- package/dest/archiver/kv_archiver_store/block_store.d.ts +0 -124
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/block_store.js +0 -370
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +0 -18
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/contract_class_store.js +0 -120
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +0 -24
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +0 -168
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +0 -296
- package/dest/archiver/kv_archiver_store/log_store.d.ts +0 -49
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +0 -1
- package/dest/archiver/kv_archiver_store/log_store.js +0 -336
- package/dest/archiver/kv_archiver_store/message_store.d.ts +0 -39
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +0 -1
- package/dest/archiver/structs/data_retrieval.d.ts.map +0 -1
- package/dest/archiver/structs/inbox_message.d.ts +0 -15
- package/dest/archiver/structs/inbox_message.d.ts.map +0 -1
- package/dest/archiver/structs/published.d.ts +0 -3
- package/dest/archiver/structs/published.d.ts.map +0 -1
- package/dest/archiver/validation.d.ts +0 -17
- package/dest/archiver/validation.d.ts.map +0 -1
- package/dest/rpc/index.d.ts +0 -9
- package/dest/rpc/index.d.ts.map +0 -1
- package/dest/rpc/index.js +0 -15
- package/src/archiver/archiver.ts +0 -1858
- package/src/archiver/archiver_store.ts +0 -305
- package/src/archiver/archiver_store_test_suite.ts +0 -1264
- package/src/archiver/errors.ts +0 -26
- package/src/archiver/index.ts +0 -6
- package/src/archiver/instrumentation.ts +0 -187
- package/src/archiver/kv_archiver_store/block_store.ts +0 -481
- package/src/archiver/kv_archiver_store/contract_class_store.ts +0 -176
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +0 -422
- package/src/archiver/kv_archiver_store/log_store.ts +0 -406
- package/src/rpc/index.ts +0 -16
- /package/dest/{archiver/structs → structs}/data_retrieval.js +0 -0
- /package/dest/{archiver/structs → structs}/published.js +0 -0
- /package/src/{archiver/structs → structs}/data_retrieval.ts +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import type { ViemPublicClient, ViemPublicDebugClient } from '@aztec/ethereum/types';
|
|
3
|
+
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
4
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
+
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
7
|
+
|
|
8
|
+
import { type Hex, createPublicClient, decodeEventLog, getAbiItem, http, toEventSelector } from 'viem';
|
|
9
|
+
import { mainnet } from 'viem/chains';
|
|
10
|
+
|
|
11
|
+
import { CalldataRetriever } from '../calldata_retriever.js';
|
|
12
|
+
|
|
13
|
+
const logger = createLogger('archiver:calldata-test');
|
|
14
|
+
|
|
15
|
+
interface ScriptArgs {
|
|
16
|
+
rollupAddress: EthAddress;
|
|
17
|
+
txHash: Hex;
|
|
18
|
+
rpcUrl: string;
|
|
19
|
+
targetCommitteeSize: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function parseArgs(): ScriptArgs {
|
|
23
|
+
const args = process.argv.slice(2);
|
|
24
|
+
|
|
25
|
+
if (args.length < 2) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error('Usage: node index.js <rollup-address> <tx-hash> [target-committee-size]');
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.error('');
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.error('Environment variables:');
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
console.error(' ETHEREUM_HOST or RPC_URL - Ethereum RPC endpoint');
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.error('');
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
37
|
+
console.error('Example:');
|
|
38
|
+
// eslint-disable-next-line no-console
|
|
39
|
+
console.error(' RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY \\');
|
|
40
|
+
// eslint-disable-next-line no-console
|
|
41
|
+
console.error(' node index.js 0x1234... 0xabcd... 32');
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const rollupAddress = EthAddress.fromString(args[0]);
|
|
46
|
+
const txHash = args[1] as Hex;
|
|
47
|
+
const targetCommitteeSize = args[2] ? parseInt(args[2], 10) : 24;
|
|
48
|
+
|
|
49
|
+
const rpcUrl = process.env.ETHEREUM_HOST || process.env.RPC_URL;
|
|
50
|
+
if (!rpcUrl) {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.error('Error: ETHEREUM_HOST or RPC_URL environment variable must be set');
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (targetCommitteeSize <= 0 || targetCommitteeSize > 256) {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.error('Error: target-committee-size must be between 1 and 256');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { rollupAddress, txHash, rpcUrl, targetCommitteeSize };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function main() {
|
|
66
|
+
const { rollupAddress, txHash, rpcUrl, targetCommitteeSize } = parseArgs();
|
|
67
|
+
|
|
68
|
+
logger.info('Calldata Retriever Test Script');
|
|
69
|
+
logger.info('===============================');
|
|
70
|
+
logger.info(`Rollup Address: ${rollupAddress.toString()}`);
|
|
71
|
+
logger.info(`Transaction Hash: ${txHash}`);
|
|
72
|
+
logger.info(`RPC URL: ${rpcUrl}`);
|
|
73
|
+
logger.info(`Target Committee Size: ${targetCommitteeSize}`);
|
|
74
|
+
logger.info('');
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
// Create viem public client
|
|
78
|
+
const publicClient = createPublicClient({
|
|
79
|
+
chain: mainnet,
|
|
80
|
+
transport: http(rpcUrl, { batch: false }),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
logger.info('Fetching transaction...');
|
|
84
|
+
const tx = await publicClient.getTransaction({ hash: txHash });
|
|
85
|
+
|
|
86
|
+
if (!tx) {
|
|
87
|
+
throw new Error(`Transaction ${txHash} not found`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
logger.info(`Transaction found in block ${tx.blockNumber}`);
|
|
91
|
+
|
|
92
|
+
// Create CalldataRetriever
|
|
93
|
+
const retriever = new CalldataRetriever(
|
|
94
|
+
publicClient as unknown as ViemPublicClient,
|
|
95
|
+
publicClient as unknown as ViemPublicDebugClient,
|
|
96
|
+
targetCommitteeSize,
|
|
97
|
+
undefined,
|
|
98
|
+
logger,
|
|
99
|
+
rollupAddress,
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Extract checkpoint number and hashes from transaction logs
|
|
103
|
+
logger.info('Decoding transaction to extract checkpoint number and hashes...');
|
|
104
|
+
const receipt = await publicClient.getTransactionReceipt({ hash: txHash });
|
|
105
|
+
|
|
106
|
+
// Look for CheckpointProposed event
|
|
107
|
+
const checkpointProposedEventAbi = getAbiItem({ abi: RollupAbi, name: 'CheckpointProposed' });
|
|
108
|
+
const checkpointProposedLog = receipt.logs.find(log => {
|
|
109
|
+
try {
|
|
110
|
+
return (
|
|
111
|
+
log.address.toLowerCase() === rollupAddress.toString().toLowerCase() &&
|
|
112
|
+
log.topics[0] === toEventSelector(checkpointProposedEventAbi)
|
|
113
|
+
);
|
|
114
|
+
} catch {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (!checkpointProposedLog || checkpointProposedLog.topics[1] === undefined) {
|
|
120
|
+
throw new Error(`Checkpoint proposed event not found`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const checkpointNumber = CheckpointNumber.fromBigInt(BigInt(checkpointProposedLog.topics[1]));
|
|
124
|
+
|
|
125
|
+
// Decode the full event to extract attestationsHash and payloadDigest
|
|
126
|
+
const decodedEvent = decodeEventLog({
|
|
127
|
+
abi: RollupAbi,
|
|
128
|
+
data: checkpointProposedLog.data,
|
|
129
|
+
topics: checkpointProposedLog.topics,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const eventArgs = decodedEvent.args as {
|
|
133
|
+
checkpointNumber: bigint;
|
|
134
|
+
archive: Hex;
|
|
135
|
+
versionedBlobHashes: Hex[];
|
|
136
|
+
attestationsHash: Hex;
|
|
137
|
+
payloadDigest: Hex;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
if (!eventArgs.attestationsHash || !eventArgs.payloadDigest) {
|
|
141
|
+
throw new Error(`CheckpointProposed event missing attestationsHash or payloadDigest`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const expectedHashes = {
|
|
145
|
+
attestationsHash: eventArgs.attestationsHash,
|
|
146
|
+
payloadDigest: eventArgs.payloadDigest,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
logger.info(`Checkpoint Number: ${checkpointNumber}`);
|
|
150
|
+
logger.info(`Attestations Hash: ${expectedHashes.attestationsHash}`);
|
|
151
|
+
logger.info(`Payload Digest: ${expectedHashes.payloadDigest}`);
|
|
152
|
+
|
|
153
|
+
logger.info('');
|
|
154
|
+
logger.info('Retrieving checkpoint from rollup transaction...');
|
|
155
|
+
logger.info('');
|
|
156
|
+
|
|
157
|
+
const result = await retriever.getCheckpointFromRollupTx(txHash, [], checkpointNumber, expectedHashes);
|
|
158
|
+
|
|
159
|
+
logger.info(' Successfully retrieved block header!');
|
|
160
|
+
logger.info('');
|
|
161
|
+
logger.info('Block Header Details:');
|
|
162
|
+
logger.info('====================');
|
|
163
|
+
logger.info(`Checkpoint Number: ${result.checkpointNumber}`);
|
|
164
|
+
logger.info(`Block Hash: ${result.blockHash}`);
|
|
165
|
+
logger.info(`Archive Root: ${result.archiveRoot.toString()}`);
|
|
166
|
+
logger.info('');
|
|
167
|
+
logger.info('Header:');
|
|
168
|
+
logger.info(` Slot Number: ${result.header.slotNumber.toString()}`);
|
|
169
|
+
logger.info(` Timestamp: ${result.header.timestamp.toString()}`);
|
|
170
|
+
logger.info(` Coinbase: ${result.header.coinbase.toString()}`);
|
|
171
|
+
logger.info(` Fee Recipient: ${result.header.feeRecipient.toString()}`);
|
|
172
|
+
logger.info(` Total Mana Used: ${result.header.totalManaUsed.toString()}`);
|
|
173
|
+
logger.info('');
|
|
174
|
+
logger.info('Attestations:');
|
|
175
|
+
logger.info(` Count: ${result.attestations.length}`);
|
|
176
|
+
logger.info(` Non-empty attestations: ${result.attestations.filter((a: any) => !a.signature.isEmpty()).length}`);
|
|
177
|
+
|
|
178
|
+
process.exit(0);
|
|
179
|
+
} catch (error) {
|
|
180
|
+
logger.error('Error retrieving block header:');
|
|
181
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
182
|
+
|
|
183
|
+
if (error instanceof Error && error.stack) {
|
|
184
|
+
logger.debug(error.stack);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Only run if this is the main module
|
|
192
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
193
|
+
void main();
|
|
194
|
+
}
|