Publishing and Updating¶
Writing goes through the registry. graphd has no write API, so nobody who can reach it can change a graph.
The examples use registryctl from src/support/registries. R stands for your -relay flags.
Publish or replace a segment¶
registryctl publish -registry social/main $R -ack 2 -file social.graph.jsonl
Publishing a file with the same name replaces the previous segment. Use -file name=path to publish under another name. The -file flag can be repeated to publish several segments as one version.
The command uploads the bytes to the origin, signs an asset event for each file, signs a manifest that lists every current asset, and publishes the events until -ack relays accepted each one. If it is interrupted, run registryctl resume to send what is still pending.
Remove a segment¶
registryctl remove -registry social/main $R -ack 2 -name social.graph.jsonl
Withdraw everything¶
registryctl revoke -registry social/main $R -ack 2 -all
This revokes every version published so far. A later publish continues with the next version.
Keep your key and state file¶
The author key (registry.key unless -key or KEY_FILE says otherwise) is the identity of the graph. The state file (<registry name with slashes replaced by underscores>.registry.json unless -state says otherwise) records the current manifest. If the state file is lost but the key is not, rebuild it from the network:
registryctl recover -registry social/main $R
Publishing different manifests under the same version, for example from two copies of a state file, makes the registry conflicting. DataGraph then refuses new states of that graph. Publish from one place at a time.
How quickly changes appear¶
graphd synchronizes every SYNC_SECONDS (15 by default). Indexers can answer from a cache for up to 30 seconds, so allow about a minute end to end. GET /v1/graphs shows the version currently served.