Skip to content

filecoin-station/spark-rsr-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spark-rsr-contract

  • Mainnet: 0x620bfc5AdE7eeEE90034B05DC9Bb5b540336ff90
  • Calibration: 0x006fD9D10FCd2CFc830670e1c665ac23b478C252

Abi

Interface spec

Usage

Get all provider retrieval result stats CIDs:

index = 0
loop:
  try:
    cid = contract.providerRetrievalResultStats(index++)
  catch:
    if (revert):
      break

Each CID refers to a DAG-JSON object hosted on Storacha:

https://$CID.ipfs.w3s.link?format=car

You can explore data from your browser using IPLD:

https://explore.ipld.io/#/explore/$CID

Example: https://explore.ipld.io/#/explore/baguqeera27yois66ac3fq3elk6ksdswk2em7lw3252l4osiogn7m5tyxusca

Each provider retrieval result stats object is of this shape:

{
  "date": "<YYYY-MM-DD>",
  "meta": {
    "rounds": [
      {
        "index": "<roundIndex>",
        "contractAddress": "<contractAddress>",
        "details": { "/": "<cid>" }
        "measurementBatches": [{ "/": "<cid>" }, ...],
        "sparkEvaluateVersion": {
          "gitCommit": "<hash>",
        },
      },
      ...
    ]
  },
  "providerRetrievalResultStats": [
    {
      "providerId": "<providerId>",
      "successful": <n>,
      "total": <n>
    },
    ...
  ]
}

See full documentation at https://github.com/filecoin-project/service-classes/blob/main/service-level-indicators/spark-retrieval-success-rate.md#provider-retrieval-result-stats

Getters

.providerRetrievalResultStats(uint offset) -> string

Methods

new SparkRsr(address writer)

.addProviderRetrievalResultStats(address string)

May only be called by writer.

Development

This repo requires Rust, Cargo and Foundry:

Clone Repo and Install

git clone https://github.com/filecoin-station/spark-impact-evaluator.git
cd spark-impact-evaluator
git submodule update --init --recursive
forge test

Tests

forge test

Deployment

Calibration:

forge create --rpc-url https://api.calibration.node.glif.io/rpc/v0 --mnemonic secrets/mnemonic src/SparkRsr.sol:SparkRsr --constructor-args "0x..."

Mainnet:

forge create --rpc-url https://api.node.glif.io/rpc/v0 src/SparkRsr.sol:SparkRsr --ledger --constructor-args "0x..."

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published