diff --git a/indexers-v2/main.py b/indexers-v2/main.py index 2cf0a677..e1c9a4ce 100644 --- a/indexers-v2/main.py +++ b/indexers-v2/main.py @@ -102,7 +102,7 @@ def load_network_config(path): message = f"Network '{network_name}' not found in {path}/network_config.yaml" raise Exception(message) network_id = network_params["network_id"] - archive_url = network_params["archive_url"] + archive_url = network_params.get("archive_url", "None") # Load custom config custom_config = config_file["configs"][config_name] diff --git a/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch b/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch index 2593dd32..2341d64d 100644 --- a/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch +++ b/indexers-v2/patches/@subsquid+squid-gen-evm+1.2.1.patch @@ -25,6 +25,19 @@ index 2839b6f..e751702 100644 this.out.block(`for (let log of block.logs)`, () => { for (let contract of this.options.contracts) { this.out.block(`if (log.address === '${contract.address}')`, () => { +diff --git a/node_modules/@subsquid/squid-gen-evm/lib/interfaces.d.ts b/node_modules/@subsquid/squid-gen-evm/lib/interfaces.d.ts +index 0d82fa8..cb0e924 100644 +--- a/node_modules/@subsquid/squid-gen-evm/lib/interfaces.d.ts ++++ b/node_modules/@subsquid/squid-gen-evm/lib/interfaces.d.ts +@@ -22,7 +22,7 @@ export interface SquidContract { + } + export interface SquidArchive { + value: string; +- kind: 'url' | 'name'; ++ kind: 'url' | 'name' | 'None'; + } + export type SquidChainRpc = string | { + url: string; diff --git a/node_modules/@subsquid/squid-gen-evm/lib/mappings.js b/node_modules/@subsquid/squid-gen-evm/lib/mappings.js index f427ab2..4ad7c89 100644 --- a/node_modules/@subsquid/squid-gen-evm/lib/mappings.js @@ -39,3 +52,35 @@ index f427ab2..4ad7c89 100644 else { return `e[${i}]`; } +diff --git a/node_modules/@subsquid/squid-gen-evm/lib/processor.js b/node_modules/@subsquid/squid-gen-evm/lib/processor.js +index 6b2ba62..52c2902 100644 +--- a/node_modules/@subsquid/squid-gen-evm/lib/processor.js ++++ b/node_modules/@subsquid/squid-gen-evm/lib/processor.js +@@ -21,7 +21,10 @@ class ProcessorCodegen { + this.out.indentation(() => { + this.out.line(`.setDataSource({`); + this.out.indentation(() => { +- if (this.options.archive.kind === 'name') { ++ if (this.options.archive.kind === 'None') { ++ // do nothing ++ } ++ else if (this.options.archive.kind === 'name') { + this.useArchiveRegistry(); + this.out.line(`archive: lookupArchive('${this.options.archive.value}', {type: 'EVM'}),`); + } +diff --git a/node_modules/@subsquid/squid-gen-evm/lib/util.js b/node_modules/@subsquid/squid-gen-evm/lib/util.js +index 48689cf..e9da291 100644 +--- a/node_modules/@subsquid/squid-gen-evm/lib/util.js ++++ b/node_modules/@subsquid/squid-gen-evm/lib/util.js +@@ -47,7 +47,10 @@ function getArchive(str) { + }; + } + else { +- throw new Error(`Invalid archive "${str}"`); ++ return { ++ value: 'None', ++ kind: 'None', ++ }; + } + } + exports.getArchive = getArchive;