There is a document that lists the intended smart contract interface that @David Gasquez and others can query for reading the “Spark SLIs” from the chain. If there are pointers to manifests, this design should cover the manifest structure as well.
We’re primarily concerned with the read side, but it is worth including the write side as well to ensure both parts line up.
ABI: https://github.com/filecoin-station/spark-rsr-contract/blob/main/out/SparkRsr.sol/SparkRsr.json
Interact with the production version on mainnet:
0x620bfc5AdE7eeEE90034B05DC9Bb5b540336ff90
Interact with the development version on calibration:
0x006fD9D10FCd2CFc830670e1c665ac23b478C252
Pseudo code for listing all commitments:
index = 0
loop:
try:
cid = contract.providerRetrievalResultStats(index++)
catch:
if (revert):
break
{
"date": "<YYYY-MM-DD>",
"meta": {
"rounds": [
{
"index": "<roundIndex>",
"contractAddress": "<contractAddress>",
"sparkEvaluateVersion": {
"gitCommit": "<hash>",
},
"measurementBatches": [{ "/": "<cid>" }, ...],
"details": { "/": "<cid>" }
},
...
]
},
"providerRetrievalResultStats": [
{
"providerId": "<providerId>",
"successful": <n>,
"total": <n>
},
...
]
}
Currently, commitments are addressed through monotonically increasing offsets in the commitments
array. This makes it easy for a consumer to download all the data.