Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.55 KB

adding-a-new-indexed-chain.org

File metadata and controls

33 lines (26 loc) · 1.55 KB

Adding a new Indexed Chain

Steps:

  1. Update the Oracle’s config.toml file and include the new indexed chain under the indexed_chains table:
    [indexed_chains]
    "previous-chain-1-id" = "http://example-1.rpc"
    "previous-chain-2-id" = "http://example-2.rpc"
    "new-chain-id" = "http://new-example.rpc" # <-- new indexed chain
        

    The entry is formatted such as the key is the Network Identifier and the value is the HTTP endpoint to the respective RPC provider.

  2. Restart the block-oracle binary for configuration to be reloaded.
  3. Send a RegisterNetworks message to the DataEdge contract that reflects the newly added chain. You can use the Block Oracle Encoder for this:
    [
        {
            "add": [
                "new-chain-id"
            ],
            "message": "RegisterNetworks",
            "remove": []
        }
    ]
        

    Note that the chain ID used in the message should be exactly the same as the one included in the configuration file.

  4. The Block Oracle will only include the new indexed chain latest blocks in its SetBlockNumbersForEpochMessage when the Epoch Subgraph successfully indexes the relevant RegisterNetworks message.
  5. After the Epoch Subgraph is up to date and the new indexed chain can be queried from it, the Block Oracle will include the latest block information for that chain on every SetBlockNumbersForEpochMessage message it sends to the DataEdge contract.