Skip to content

Add contract address field to MetaboardCfg #2444

@findolor

Description

@findolor

Summary

The MetaboardCfg in the settings crate currently only stores a subgraph url for each metaboard. To support indexing MetaV1_2 events directly from the metaboard contract on-chain, the config needs to also know the contract's address.

Problem

Right now the YAML format for metaboards is a simple key-to-URL mapping:

metaboards:
  my-metaboard: https://subgraph.example.com/metaboard

This is sufficient for querying the metaboard subgraph, but it doesn't provide the on-chain contract address needed by the sync pipeline to fetch events via RPC.

Proposed Change

Add a required address field to MetaboardCfg and update the YAML format to a map:

metaboards:
  my-metaboard:
    url: https://subgraph.example.com/metaboard
    address: 0x...

The old string-only format does not need to be supported — this is a breaking change to the config format.

Scope

  • Update MetaboardCfg struct to include a required Address field
  • Update YAML parsing to expect the new map format
  • Update add_record_to_yaml() for the new format
  • Update Default, PartialEq impls
  • Update existing tests and add tests for the new format

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions