/EVM-Gateway Explorer

EVM Gateway Operation Guide

EVM Gateway provides Ethereum compatible access to Injective through a separately operated API and persistent event index. This document target gateway v1.4.4.

1. Overview

Applications that rely on Ethereum tooling expect Ethereum JSON RPC formatted responses for blocks, transactions, receipts and event logs. While Injective nodes expose a built in JSON RPC server, querying repeated historical requests can slow a node's execution, synchronization, and state query work. Additionally, Injective's native bank and module activity eschew the ordinary EVM event feed.

EVM Gateway addresses the need to capture and describe all activity by reading committed Injective blocks and results, preparing Ethereum shaped records once, and persisting them to a local database. Applications can query that index over HTTP or WebSocket. Repeated indexed reads reuse those records, and operators can scale and maintain the serving layer separately from the node. Optional Cosmos event virtualization adds supported native bank movements to the same receipt/log interface used by Ethereum applications.

For a wallet or application, the standard mode provides a persistent EVM history service. For a team tracking INJ or bank backed tokens through both native and EVM transfers, virtualization provides native bank event coverage without building a custom Cosmos to Ethereum projection. A team already indexing CometBFT events may opt to keep that native pipeline instead while the gateway supplies the Ethereum data model and query interface.

injectived remains responsible for transaction validation, execution and chain state. The gateway depends on node services for ingestion, live state queries, simulations, broadcasts and reconstruction of missing indexed records. Teams relying on repeated indexed history reads benefit most from deploying EVM Gateway.

2. Architecture

EVM Gateway architecture: applications connect to the gateway, which stores an index and uses Injective node services for blocks, state queries and transaction broadcasts.

Run the gateway beside a local node or connect it to remote CometBFT RPC and gRPC services. An Ethereum JSON RPC URL alone cannot supply these upstream interfaces. The broadcast endpoint defaults to the primary Comet endpoint and can be configured separately to isolate submission from backfill traffic.

What EVM Gateway persists

The gateway opens the evmindexer KV database beneath WEB3INJ_DATA_DIR/data, using the configured DB backend. It does not require MongoDB or the broader Injective indexer microservice stack.

Stored dataWhat applications get from itRecovery requirement
Block metadata, hash/height pointers and transaction orderingEthereum shaped block responses without repeatedly reconstructing a committed block upstreamRestore a compatible gateway index or reindex retained source blocks/results.
Ethereum to Cosmos transaction mappings and prepared transaction payloadsLookup by Ethereum hash or block position and correlation with the native transactionPreserve mappings with the rest of the index. To retain synthetic transactions and their logs, index and restore the required history with native event virtualization enabled.
Receipts and grouped block logsReceipt polling, block receipts and address/topic filtered event scansPreserve receipts and logs for every block your application needs to query. If records are lost, rebuilding them requires upstream access to the original blocks and execution results.
Indexed range and per block mode metadataGap detection and mode aware cache readsRetain with the database. A current maximum height does not prove contiguous coverage.
Trace results keyed by trace configuration, when populatedReuse of matching transaction/block tracesOrdinary event indexing does not warm every trace. A miss needs suitable upstream execution context.

The gateway stores transaction and event history, but it does not keep a complete snapshot of chain state at every block. For example, it may return the transfer logs from an old block without being able to return an account’s balance at that block. Queries for past balances, contract data, module positions, proofs or contract call results need an upstream node that retains the required state at those heights. Historical traces may also need upstream replay support unless the requested trace is already cached. Confirm event history, historical state and trace support separately when choosing a provider or planning a backfill. Tagged storage and routing model.

How ingestion and serving interact

On startup, the gateway loads indexed ranges and computes missing intervals from WEB3INJ_EARLIEST_BLOCK to the upstream head. It fetches blocks/results, derives records and writes the KV index. With parallel tip/gap sync enabled, it follows new blocks while older intervals are still filling. Polling and indexed head/log subscriptions use that derived view.

When connected to upstream node services, the gateway uses locally stored blocks, transactions, receipts and logs where available and compatible with its virtualization setting. Some queries can retrieve missing information from the node. This means a successful historical query does not prove that the gateway has the requested data in its own database.

Block requests using latest rely on the gateway’s latest indexed block. They can return null or an error if the required indexed records are missing or incompatible.

In offline mode, the gateway serves only data already stored locally. It cannot retrieve missing history, query live balances or contract state, or submit transactions. Operating modes.

3. API

The node’s built in Ethereum RPC and EVM Gateway both support common Ethereum API methods for reading blocks, transactions, receipts and logs, querying state, and submitting externally signed transactions. They do not implement every Ethereum method or always return identical results. The standalone gateway stores indexed history separately from the node and can include supported native bank events in Ethereum responses. Its /status/sync endpoint lets operators monitor indexing progress, detect historical gaps and check whether the gateway is keeping up with new blocks. The gateway can reduce node load by serving repeated requests for stored blocks, transactions, receipts and logs. The performance improvement depends on which requests your application makes and whether the gateway has already indexed the requested history. Test your expected traffic before deciding how much infrastructure you need.

Application needGateway behavior and benefitRemaining work or limitation
Repeated full blocks and transaction lookupseth_getBlockByNumber, eth_getBlockByHash and transaction lookups reuse prepared indexed records. Serving CPU, disk and serialization move to the gatewayIngestion still loads the node. Missing ranges can trigger reconstruction and remove this benefit.
Receipt polling and event historyeth_getTransactionReceipt, eth_getBlockReceipts and eth_getLogs reuse persisted receipts/logs. Bounded scans avoid repeatedly deriving the same event dataLarge/dense ranges still require scan/filter work and response bandwidth. Validate completeness and enforce query limits.
Native bank activity through Ethereum toolingVirtualization adds supported bank logs and synthetic records to block, receipt and log APIsConsumers must decode the bank ABI and understand synthetic identities and duplicate representations.
Balances, code, storage and contract readseth_getBalance, eth_getCode, eth_getStorageAt and eth_call provide familiar accessLive state work remains upstream. The gateway event index does not supply pruned historical state.
Fees, sequence, simulation and submissionGas/fee helpers, eth_getTransactionCount, eth_estimateGas and eth_sendRawTransaction support normal client workflowsAccount/module queries, simulation, validation and execution still load node services. Fee history is a mixed workload, not a simple indexed read.
Diagnostics and correlationOptional debug tracing and inj_getTxHashByEthHashIf the requested trace is not cached, generating it requires upstream replay support and the relevant historical state. The debug namespace also exposes administrative methods, so restrict access to authorized operators.

Supported namespaces

Enable namespaces with WEB3INJ_JSONRPC_API. The Injective method glossary lists the implemented methods by namespace.

NamespaceAvailabilityWhat it provides
ethEnabled by defaultBlocks, transactions, receipts, logs, filters, state queries, calls, fee helpers and submission of signed transactions. The comparison below lists method coverage.
netEnabled by defaultNetwork identity and connectivity through net_version, net_listening and net_peerCount.
web3Enabled by defaultSoftware identification through web3_clientVersion and hashing through web3_sha3. The reviewed gateway hashes the literal input string in web3_sha3, which differs from Ethereum hex data handling. Use client side Keccak for Ethereum hashing.
debugOptionalExecution tracing through debug_traceTransaction, debug_traceCall, debug_traceBlockByNumber and debug_traceBlockByHash, plus block inspection and runtime profiling. Restrict access because this namespace includes administrative operations.
injOptionalinj_getTxHashByEthHash maps an Ethereum transaction hash to its Cosmos wrapper hash.
personal, txpool, minerOutside the supported integration profileNo keyring or signing service, functional Geth transaction pool, or Ethereum mining service. The tagged binary contains some empty or limited txpool and miner methods. Their registration does not provide those capabilities.

Ethereum method comparison

The Ethereum JSON RPC method reference describes the Ethereum interfaces. The table compares its eth method list with gateway v1.4.4. Method availability does not guarantee identical behavior or historical coverage.

Methods in the Ethereum referenceGateway support
eth_blockNumber, eth_getBlockByNumber, eth_getBlockByHash, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumberAvailable. Blocks and counts describe the gateway’s indexed view, including synthetic entries when virtualization is enabled.
eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, eth_getTransactionReceiptAvailable for transaction and receipt lookup.
eth_getLogs, eth_newFilter, eth_newBlockFilter, eth_newPendingTransactionFilter, eth_getFilterChanges, eth_getFilterLogs, eth_uninstallFilterAvailable. Observe the log completeness limitation below and replay history after reconnecting.
eth_getBalance, eth_getStorageAt, eth_getCode, eth_getTransactionCount, eth_call, eth_estimateGasAvailable through upstream state services. Balances use INJ and account sequence is shared with native transactions.
eth_sendRawTransactionAvailable. Submit bytes signed by an external wallet or signing system.
eth_gasPrice, eth_chainId, eth_syncing, eth_protocolVersionAvailable. Sync status describes the upstream node, rather than gateway index coverage. Protocol version is a compatibility value.
eth_accounts, eth_sign, eth_signTransaction, eth_sendTransactionNo supported account management or signing workflow. Use external signing and eth_sendRawTransaction.
eth_mining, eth_hashrate, eth_coinbaseCompatibility methods. Mining is false and hashrate is zero. Coinbase uses a proposer/validator lookup that can fail.
eth_getUncleByBlockHashAndIndex, eth_getUncleByBlockNumberAndIndex, eth_getUncleCountByBlockHash, eth_getUncleCountByBlockNumberReturn empty or zero results because Injective has no Ethereum uncles.

The gateway also supports Ethereum methods documented in the official Execution API specification, including eth_getBlockReceipts, eth_feeHistory, eth_maxPriorityFeePerGas and eth_getProof. It additionally provides helper methods such as eth_getTransactionLogs, eth_getPendingTransactions and eth_fillTransaction, which are outside that specification. eth_getProof returns Cosmos backed proofs rather than standard Ethereum trie proofs. Tagged Ethereum methods, filter methods.

Request limits and performance

The tagged default log cap is 10,000 logs and block range cap is 10,000 blocks (WEB3INJ_JSONRPC_LOGS_CAP / WEB3INJ_JSONRPC_BLOCK_RANGE_CAP). Providers may choose lower limits. Split bounded windows on cap errors, and advance the cursor only after verifying the complete interval.

Logs require a coverage contract. In v1.4.3/v1.4.4, certain per height bloom/log lookup failures can return accumulated partial logs without a JSON RPC error. Do not use a successful response alone as permission to advance a critical event cursor. Verify contiguous indexed coverage, test known positive boundary/interior events and reconcile at explicit heights. Qualify complete or error behavior with the implementation/provider. Smaller windows help recovery but do not resolve this behavior. Tagged range scanner.

For performance acceptance, measure repeated full blocks, selective/broad log scans, live state and missing range reconstruction separately. Record versions, hardware, virtualization mode, range/density, concurrency, response bytes, latency/errors, ingestion lag and upstream traffic. Cache counters cover selected lookup families, not every method. Define the accepted query mix, historical range and latency/error limits before go-live. No workload specific throughput multiplier is established by this guide.

4. Data modes: EVM history and native event virtualization

Standard EVM mode

With WEB3INJ_VIRTUALIZE_COSMOS_EVENTS=false, the gateway indexes EVM oriented blocks, transactions, receipts and contract logs. This supports Ethereum transaction history and event based applications. For example, a user can send native INJ from one 0x address to another on Injective using an EVM transaction, with the amount specified in the transaction’s value field. The recipient can also be a contract that accepts INJ. This produces a transaction and receipt, but the INJ movement itself does not emit an ERC20 Transfer event because it does not call an ERC20 token contract. Native INJ is held in the bank module. A native bank send or a credit during block processing does not become an ordinary EVM transaction merely because an Ethereum RPC is running.

For a token using the MultiVM Token Standard (MTS), an ERC20 transfer and a native bank send update the same underlying bank balance, but they can expose different events. An ERC20 event monitor alone can therefore miss a native bank transfer of that token. See One Token, One Balance: Creating and Bridging Under Injective’s MultiVM Token Standard for the shared balance model.

Virtualized bank event mode

With WEB3INJ_VIRTUALIZE_COSMOS_EVENTS=true, the gateway additionally reads supported events from transaction results and finalize block results and persists an Ethereum projection. It functions as a reusable event cache and query layer: consumers can scan supported native bank movements using eth_getLogs instead of fetching and decoding all raw Cosmos results themselves.

Native eventVirtual logData supplied
transferNativeBankTransferSender, recipient, bank denom and amount
coin_spentNativeBankCoinSpentSpender, bank denom and amount
coin_receivedNativeBankCoinReceivedReceiver, bank denom and amount
coinbaseNativeBankCoinbaseMinter, bank denom and amount
burnNativeBankBurnBurner, bank denom and amount

These logs use reserved emitter 0x0000000000000000000000000000000000000800. It is an event address, not the watched account or a callable ERC20. The bank event ABI uses right aligned indexed bytes32 account fields and (string denom,uint256 amount) data. Preserve full native module addresses and integer base unit amounts.

Real EVM transactions keep their Ethereum hashes, with bank side effect logs appended after real contract logs. Native transactions with tracked bank events receive a synthetic transaction/receipt identity derived from the Cosmos hash and can include virtual: true and cosmos_hash. Begin/end block activity receives deterministic synthetic identities without a source Cosmos transaction or signer. Synthetic transaction value is not the bank transfer amount. Decode the logs. Block counts and transaction/log positions can differ between modes. Tagged projection rules.

This covers bank movements such as native sends, contract related bank side effects and supported module payouts, including credits without user transactions. It does not supply a full staking/exchange ledger, classify customer deposits, prove remote chain settlement, or turn every Cosmos event into an Ethereum event. This baseline covers the five bank event families above. Qualify specialty IBC/hook builds separately.

An equivalent native pipeline can index raw CometBFT transaction and block results, normalize accounts/denoms and query module state. Running Ethereum RPC beside a transaction only Comet event index leaves block processing bank credits uncovered. The gateway performs the projection, persistence and Ethereum querying for supported events. It does not create additional underlying evidence or balances.

Configuration choices and consequences

Serving mode, data mode and history range are independent choices:

SettingChoice and consequence
WEB3INJ_VIRTUALIZE_COSMOS_EVENTSfalse: EVM view. true: add supported native bank projections. More records, decoding, storage and backfill work. Choose before indexing.
WEB3INJ_EARLIEST_BLOCKExplicit first required height. The gateway processes chain wide activity from that height, not only watched addresses. Adding an address is a consumer change if its required history is already indexed.
WEB3INJ_ENABLE_SYNC / WEB3INJ_OFFLINE_RPC_ONLYtrue/false: online ingestion and serving. false/false: no continuous ingestion, but live clients/fallbacks remain. false/true: existing index only, no live clients. Offline with sync enabled is invalid.
WEB3INJ_PARALLEL_SYNC_TIP_AND_GAPStrue: follow the tip while backfilling. false: process startup gaps before forward sync. Neither proves historical completeness.
WEB3INJ_ALLOW_GAPSDefault true can advance an unavailable start to the source's retained minimum and skip certain bad blocks. Use false for an explicitly promised complete range, and still verify coverage/errors.
WEB3INJ_FETCH_JOBS / WEB3INJ_RPC_MAX_IDLE_CONNS_PER_HOSTControl fetch concurrency/connection reuse. Tune with the source operator and observed CPU, I/O, errors and latency.
WEB3INJ_DATA_DIR / WEB3INJ_DB_BACKENDSelect persistent index storage/backend. Restore only compatible datasets. Use one writer per database.
WEB3INJ_COMET_RPC / WEB3INJ_GRPC_ADDR / WEB3INJ_COMET_BROADCAST_RPCSource blocks/results, live state/parameters, and optional separate same chain broadcast route.
WEB3INJ_JSONRPC_API and request capsControl exposed methods and cost of scans/simulations. Namespace availability is independent of data completeness.

The tagged environment reference lists the full configuration. Changing virtualization on an existing index does not rewrite history. Mode mismatch can trigger online reconstruction or offline errors. For a mode change, build a separate index in the target mode and switch after validating the required range.

Consumer accounting and replay

Equivalent inj… and 0x… encodings identify the same account. A bank backed MultiVM Token Standard (MTS) asset can appear through native and ERC20 paths while sharing one bank balance. See the MTS documentation for how this shared balance works. Choose one accounting feed per asset: for bank ledger tracking, received minus spent is useful. ERC20 Transfer and native Transfer can provide context for the same movement. Do not sum all event families or credit both representations.

Applications that use events to track balances need a recovery process for interruptions. Save each movement with enough detail to identify it uniquely, since one transaction can contain several movements. Save the events and the last fully processed block together so a restart cannot skip unsaved activity.

After reconnecting, query historical logs from the last saved block, including some previously processed blocks, and ignore events already stored. Verify that the opening balance plus received amounts minus spent amounts equals the closing bank balance at the same block. Use subscriptions to detect new activity and historical queries to recover missed activity. A WebSocket connection does not guarantee delivery of everything missed during an outage. Track assets held in staking or exchange modules separately from spendable bank balances, since moving funds into those modules does not necessarily change account ownership of the assets.

5. Operational considerations

Fresh start and new address monitoring

Use a recent explicit height when only future activity is required. Establish the address's opening balance at the preceding committed height, or an agreed zero balance baseline for a new address. The upstream needs every block/result from that start through catch up and enough retention to survive outages. Your consumer filters addresses. The gateway indexes the chain range regardless of how many addresses you watch.

If an existing address needs older activity, its onboarding becomes a historical backfill requirement. An opening balance can establish a forward ledger but does not provide a full transaction history.

Upgrade, node restore and corruption recovery

A full node restore recovers node state/data. A gateway restore recovers a separate derived index. An intact gateway index can retain old receipts/logs even if a node is replaced by a recent snapshot. That node must still supply any interval the gateway missed, plus the live/historical state promised by the API.

Preserve a consistent gateway backup, previous binary/configuration, consumer cursor and source retention record before upgrades. Treat bounded incorrect records differently from an unreadable database: targeted resync repairs specified heights. A damaged database or mode/schema change usually needs a compatible restore or rebuild in a separate directory. Do not assume an older binary can read a migrated database.

Archival backfill

To build complete event history, obtain source blocks and execution/block results across the entire agreed range, including native activity predating EVM support where required and supported. A recent full node snapshot is not evidence of archival coverage. To offer historical balances/calls/proofs as well, retain or obtain historical application state. Uncached traces require a separately qualified replay service.

Large backfills require time, storage, provider bandwidth and compatibility across chain upgrades. Probe old, intermediate, upgrade boundary and recent heights before scheduling. Historical endpoints may route different height segments to compatible node versions. A single current node must not be assumed to answer every epoch.

A third party archival provider can supply retained CometBFT/gRPC services, a compatible gateway dataset, or an already indexed API. Agree exactly which one: a raw event provider does not need its own virtualization enabled, while an already indexed API must expose the mode and history you need. Ask your integration contact for archival provider options and obtain explicit coverage/capacity commitments. Public endpoints are not a guaranteed backfill service.

Capacity and team responsibilities

Budget node blocks/results, node state, gateway index/trace cache, consumer records, replicas, backups and restore working space separately. Measure bytes per day over representative traffic in the chosen mode. Size retained data plus expected growth, compaction and recovery headroom. Compressed snapshot size is not live disk demand. There is no measured universal gateway hardware minimum in this guide.

Assign a node/upstream owner for retention and compatibility, a gateway owner for index coverage/backups/capacity, and an application owner for cursors, decoding and reconciliation. Agree outage/recovery objectives and alerts before launch. Retained source history must cover the maximum outage plus catch up time and repair margin. Test a restore before depending on that promise.

6. Operation guide: setup, recovery and archival backfill

6.1 Prepare the deployment

Prepare these components before starting ingestion:

  1. A synchronized compatible injectived node, or remote CometBFT/gRPC services with the required historical coverage. For a self hosted node, follow the network joining instructions for the selected release, genesis, peers and snapshot. Preserve required application data such as Wasm bytecode. Bare consensus state sync is not a substitute for every application dataset.
  2. A pinned gateway binary/container, persistent writable storage, a service supervisor and an ingress policy. Use the selected tag's Go toolchain for a source build, plus curl and jq for the probes below.
  3. A deployment record containing chain IDs, node/gateway versions and commits/digests, first required height, data mode/backend, upstreams, query families, limits and recovery owners.

For a source installation on the operator host:

git clone --branch v1.4.4 --depth 1 https://github.com/InjectiveLabs/evm-gateway.git
cd evm-gateway
make install
evm-gateway version

Ensure the Go binary directory is on the service user's PATH, or use the installed binary's absolute path. A verified container digest is another deployment option. Keep the deployment configuration in a managed environment file/service definition. Shell exports below demonstrate its contents.

Probe the configured Comet source at your intended start before proceeding:

: "${COMET_URL:?Set the CometBFT HTTP URL}"
: "${INDEX_START_HEIGHT:?Set the first required decimal height}"
curl -fsS "$COMET_URL/status" | jq '.result | {node_info: .node_info.network, sync_info}'
curl -fsS "$COMET_URL/block?height=$INDEX_START_HEIGHT" | jq '{error, height: .result.block.header.height}'
curl -fsS "$COMET_URL/block_results?height=$INDEX_START_HEIGHT" | jq '{error, result}'

Require the correct chain, a synchronized head and complete results at the requested height. Inspect JSON RPC error even on HTTP 200. Repeat at representative heights throughout a historical interval. The oldest advertised block alone does not establish results or state coverage. Validate gRPC connectivity/required module queries with the source operator and gateway startup. For TLS gRPC use the supported scheme, such as https://grpc-host:443. A bare host/port does not request TLS.

6.2 Fresh start: track activity from a chosen height

Use this when a new service/address needs forward monitoring, or when earlier activity is outside the agreed service scope.

  1. Agree INDEX_START_HEIGHT, opening balances, assets and virtualization mode. Choose a start no later than the first required activity and no later than the current head. A future start can leave the reviewed sync loop idle. Confirm source retention using 6.1.
  2. Allocate a new persistent data directory owned by the service account. Configure the instance. This example is for mainnet with bank event virtualization:
: "${INDEX_START_HEIGHT:?Set the first required decimal height}"
export WEB3INJ_CHAIN_ID=injective-1
export WEB3INJ_EVM_CHAIN_ID=1776
export WEB3INJ_COMET_RPC=http://127.0.0.1:26657
export WEB3INJ_GRPC_ADDR=127.0.0.1:9090
export WEB3INJ_DATA_DIR=/var/lib/evm-gateway/mainnet-bank
export WEB3INJ_DB_BACKEND=goleveldb
export WEB3INJ_EARLIEST_BLOCK="$INDEX_START_HEIGHT"
export WEB3INJ_ALLOW_GAPS=false
export WEB3INJ_VIRTUALIZE_COSMOS_EVENTS=true
export WEB3INJ_ENABLE_SYNC=true
export WEB3INJ_OFFLINE_RPC_ONLY=false
export WEB3INJ_PARALLEL_SYNC_TIP_AND_GAPS=true
export WEB3INJ_FETCH_JOBS=4
export WEB3INJ_JSONRPC_ENABLE=true
export WEB3INJ_JSONRPC_API=eth,net,web3,inj
export WEB3INJ_JSONRPC_ADDRESS=127.0.0.1:8645
export WEB3INJ_JSONRPC_WS_ADDRESS=127.0.0.1:8646
evm-gateway start

Use verified testnet chain IDs/upstreams for testnet. Set virtualization to false for an EVM only dataset. Example loopback ports avoid the node's usual development listener. Gateway defaults are 8545/8546. Configure process supervision, persistent storage and ingress/rate limits for the deployment. Add WEB3INJ_COMET_BROADCAST_RPC if submissions use another same chain node.

  1. Follow service logs and /status/sync using 6.6. Wait for the required range to be complete. A current tip during parallel backfill is insufficient. Resolve unavailable/parse error heights rather than relaxing the agreed start.
  2. Validate known EVM/native bank movements appropriate to the mode, including an interior event and a block processing credit for virtualized monitoring. Reconcile explicit height opening/closing balances before enabling the consumer cursor. Reuse existing committed records for read only checks.

For a read only virtualization check, set KNOWN_BANK_HEIGHT to a committed height containing a known supported bank event in your required range:

: "${KNOWN_BANK_HEIGHT:?Set a known bank-event height in decimal}"
BANK_HEIGHT_HEX=$(printf '0x%x' "$KNOWN_BANK_HEIGHT")
curl -fsS http://127.0.0.1:8645 -H 'content-type: application/json' \
  --data "{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"eth_getLogs\",\"params\":[{\"address\":\"0x0000000000000000000000000000000000000800\",\"fromBlock\":\"$BANK_HEIGHT_HEX\",\"toBlock\":\"$BANK_HEIGHT_HEX\"}]}"

Decode against the bank ABI and check the expected account, denom and amount. Add address topic filters for production scans. This one block probe returns all bank projections at that height. An arbitrary empty response does not validate the mode.

  1. Onboard additional addresses in the consumer. If their required height is already covered, no gateway restart or address registration is needed. For older history, use 6.4.

6.3 Upgrade or restore service

Use this after a compatible routine upgrade, node outage/restore, or suspected index corruption.

  1. Record the last verified contiguous height and consumer cursor. Stop the gateway writer before copying/restoring its DB. Take a consistent backup of the data directory and save chain IDs, versions, backend, mode, indexed intervals and checksums. Keep a rollback dataset separately.
  2. If restoring the node, follow its release specific restore procedure, then verify chain, head, gRPC and retained blocks/results over the gateway's missed interval. Leave an intact gateway index in place. If a recent node snapshot omitted that interval, obtain historical upstream access before resuming catch up.
  3. If the gateway index is lost/unreadable, restore a verified compatible gateway snapshot into a separate directory, or rebuild there. A node snapshot cannot replace it. Set the intended earliest height/mode and confirm the source covers everything missing after the restore point.
  4. For a bounded incorrect range in a readable index, stop its writer, retain the backup and verify source blocks/results before loading the same deployment environment and running:

Set the first and last blocks to repair as ordinary decimal numbers. Both endpoints are included in the repair. Replace the empty quotes below with the intended heights. The two lines beginning with : check that those values have been supplied and stop the script with a message if either is empty. They check for missing values, so verify that the heights are valid and the start is no greater than the end before proceeding.

REPAIR_START_HEIGHT='' # Enter the first block to repair.
REPAIR_END_HEIGHT=''   # Enter the last block to repair.

# Stop if either repair height is missing.
: "${REPAIR_START_HEIGHT:?Set the first decimal repair height}"
: "${REPAIR_END_HEIGHT:?Set the last decimal repair height}"
evm-gateway resync "$REPAIR_START_HEIGHT:$REPAIR_END_HEIGHT"

resync deletes/rebuilds selected height records, including their cached traces, then exits. If it fails, that interval remains unready. Do not run it alongside a process owning the same database. It does not repair node state or automatically replay the consumer's ledger. Resync behavior.

  1. For an upgrade, test the target binary against a compatible copy or separate instance first. For a data mode change, rebuild a separate dataset in the target mode. Recheck historical and recent block/receipt/log output, hash mapping, required state calls and traces.
  2. Restart under the intended online configuration, verify recovered coverage and replay the consumer from its last verified cursor with overlap/idempotency. Reconcile the affected interval before cutover. Retain the previous binary/configuration and recoverable DB until acceptance is complete.

If the index is intact during an upstream outage, an intentionally configured offline service can serve its retained records (6.5). State queries, submissions and cache misses remain unavailable. Communicate that reduced service scope.

6.4 Backfill a full historical range

Use this for existing address history, complete event history or an archival API. Agree the inclusive first required height and a verification cutoff. “full archive” must state whether it includes events, historical state and traces.

  1. Obtain historical source coverage for the entire interval. With a provider, agree blocks/results versus state/replay coverage, upgrade boundaries, rate/concurrency limits, access duration, missing segment handling and support ownership. Validate representative known positive heights before allocating a long backfill window.
  2. Allocate a separate gateway directory with enough index, compaction and restore space. Start from an empty DB or a compatible snapshot whose mode, schema/backend, chain, producing release, complete ranges and checksum are known. Provision an archival node separately if historical state is also part of your service. Use its release specific archival retention/restore procedure.
  3. Load the 6.2 environment with the historical INDEX_START_HEIGHT, the historical Comet/gRPC source and the chosen data mode. Keep WEB3INJ_ALLOW_GAPS=false. Start with WEB3INJ_FETCH_JOBS=4 or a lower provider approved value, then tune from observed throughput/errors. Use a separate broadcast node if needed. Normal start backfills to the source head and continues forward. Targeted resync START:END rebuilds a finite interval and exits.
  4. Follow gap/segment progress, logs, disk growth and provider load. Estimate completion from sustained indexed blocks/second and measured bytes/height, allowing for changing event density and upgrade epochs. Stop and resolve missing source results or parser incompatibility. Do not label skipped heights complete.
  5. Verify coverage through the agreed cutoff with known positive boundary/interior events, range versus subrange comparisons and balance reconciliation where applicable. Confirm state/trace methods independently if promised. Verify selected history using an offline copy to distinguish stored records from successful live fallback.
  6. Move steady state ingestion to the intended upstream only after confirming it retains the post cutoff interval. Preserve historical state/replay routing if still required. Cut consumers over after acceptance, then retain provider access long enough for validation and repairs. A single configured upstream must itself route the required history, or the deployment must supply that routing.

6.5 Serve a verified index offline

Use a consistent copy of a validated gateway dataset for retained history serving or cache only acceptance. Load its matching chain IDs, mode, backend, data directory and listener configuration, then set:

export WEB3INJ_CHAIN_ID=injective-1
export WEB3INJ_EVM_CHAIN_ID=1776
export WEB3INJ_ENABLE_SYNC=false
export WEB3INJ_OFFLINE_RPC_ONLY=true
export WEB3INJ_JSONRPC_ENABLE=true
evm-gateway start

This serves indexed blocks/transactions/receipts/logs and previously cached matching traces. It does not follow new blocks, broadcast, answer live state queries or fill missing records. Ordinary cache misses can return null. Interpret them against the verified range. eth_blockNumber is the indexed maximum, not proof of contiguous history.

6.6 Health, monitoring and handover

Read the index status on the HTTP JSON RPC listener:

curl -fsS http://127.0.0.1:8645/status/sync | jq .
curl -fsS http://127.0.0.1:8645 -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
curl -fsS http://127.0.0.1:8645 -H 'content-type: application/json' \
  --data '{"jsonrpc":"2.0","id":2,"method":"eth_syncing","params":[]}'

Check response bodies as well as HTTP status. Mainnet eth_chainId should match the agreed EVM ID (1776, 0x6f0). The Cosmos string chain ID is a different identifier. eth_syncing describes upstream node catch up. It can be false while the gateway still has gaps.

SignalOperational use
/status/sync: chain_head, last_synced_block, last_synced_atDetect head lag/stalled ingestion. Cross check against independent upstream status. A stopped sync loop can leave reported values stale.
earliest_block, gaps_remaining, current_segment, last_synced_segmentTrack start/range and backfill progress against the promised coverage. Summary gap counts do not independently certify every height or correct decoding.
blocks_processed, blocks_indexed, throughput and service logsInvestigate skipped/failed heights and stopped queues. The server can remain reachable after sync work stops.
cache.*.hits, misses, live_fallbacksIdentify unexpected dependence on upstream history and regression in indexed lookup reuse. Counters are process local and cover selected families.
Upstream Comet /status, retained blocks/results and gRPC probesTrack source synchronization, chain identity, retention margin and live query availability independently of the gateway.
Query latency/errors, disk/free space/I/O, CPU/RAM, WS reconnects and consumer cursor ageDetect saturation, storage exhaustion and application lag before they breach the service commitment.
Consumer reconciliation at explicit heightsDetect missing, duplicated or misclassified movements. Keep affected ranges pending when checks fail.

/status/sync is a diagnostic endpoint, not a complete readiness verdict. Build readiness from correct identity, required contiguous coverage, freshness, working required APIs and known positive/reconciliation checks. Set thresholds from the promised latency, history and recovery objectives. Status schema.

Export telemetry using the selected release's WEB3INJ_GOTRACER_* settings when a collector is available. For a plain local OTLP gRPC collector, the tagged example uses WEB3INJ_GOTRACER_COLLECTOR_ENABLE_TLS=false. Configure transport/authentication for the actual collector.

Before handover, the team should have a verified deployment record, required height/mode contract, tested backup/restore procedure, alert owners and escalation route, consumer replay/reconciliation procedure, and acceptance results for the methods it uses. Repeat the affected acceptance cases after upgrades or changes to retention, data mode or upstream provider.