Manifest

https://github.com/datafast-network/datafast-runtime/blob/main/src/components/manifest/mod.rs

The Manifest component is responsible for loading subgraph output manifest - which can be generated by @graph-protocol/cli graph build command.

The manifest bundle of subgraph handled by Manifest includes subgraph's version, datastore schema, wasm modules etc.

#[derive(Debug, Default)]
pub struct ManifestBundle {
    subgraph_yaml: SubgraphYaml,
    templates: DatasourceBundles,
    abis: ABIs,
    wasms: WASMs,
    schema: Schemas,
    datasources: DatasourceBundles,
    block_ptr: BlockPtr,
    templates_address_filter: HashMap<String, HashSet<String>>,
}

#[derive(Clone, Default)]
pub struct ManifestAgent(Rc<RefCell<ManifestBundle>>);

Manifest component when initialized collects subgraph's info by first reading subgraph.yaml file. If the file is correct, Manifest will continue to load all the contracts' ABIs & wasm modules into the memory. It also reads the graphql.schema to initialise the Schemas of output data models.

Currently, Manifest component only load manifest bundle found in local disk, but it can be extended to load bundles from IPFS just like GraphNode.

More details about manifest bundle's data format can be found in https://github.com/datafast-network/datafast-runtime/blob/main/src/common/base.rs

The manifest bundle's modules are also extended with supporting methods to help with the integrations, which can be found in https://github.com/datafast-network/datafast-runtime/blob/main/src/common/base_extended.rs.

Configuration

Manifest's configuration requires 3 values, placed at top level in the config.toml file

subgraph_name = "my-subgraph"
subgraph_id = "any-id-that-you-want-to-distinguish"
subgraph_dir = "/Users/vutran/Works/my-subgraph/build"

Last updated