Metagraph Layer 1 Data API¶
Parameters |
Description |
|---|---|
host |
Metagraph layer 1 data base url, e.g. |
client |
Non-default REST client injection of type |
Reconfigure Client and Host¶
from pypergraph import MetagraphTokenNetwork
from pypergraph.core.cross_platform.di.RESTClient
class InjectClient(RESTClient)
...
inject_client = InjectClient()
network = MetagraphTokenNetwork(...)
network.dl1_api.config(host=..., client=inject_client)
All Methods¶
- class pypergraph.network.api.metagraph_data_layer_1_api.MDL1Api(host: str, client: RESTClient | None = None, timeout: int = 25)[source]
Bases:
object- config(host: str | None = None, client: RESTClient | None = None)[source]
Reconfigure the RestAPIClient.
- async get_data() List[SignedTransaction][source]
Retrieve enqueued data update objects.
- async get_metrics() List[Dict[str, Any]][source]
Get metrics from the Metagraph data layer 1 endpoint.
- Returns:
Prometheus output as a list of dictionaries.
- async post_data(tx: Dict)[source]
Submit a data update object for processing.
- Parameters:
tx – SignedTransaction object containing data and proofs