Schema requirements

The WG encourages all data collectors to contribute diverse metrics as long as the data pertain to SP reputation. That said, there are a few minimum requirements for the payload that the data collector contributes to the public database:

  • Contains a provider field that has a value of SP ID string: f0xxxxxx

  • Contains a date_stamp field that specifies the date that the data is collected and uploaded, in the ISO date format: yyyy-mm-dd

  • Limit your payload size to < 50mb total per day. There is no requirement on the size of each payload or the frequency of upload, as long as the daily total stays within 50mb.

See an example schema from a retrieval bot:

interface protocol_labs_retrieval_bot {
  id: string;
  avg_speed_bps: number;
  avg_ttfb_ms: number;
  bitswap_retrieval_success: number;
  bitswap_retrievals: number;
  date_stamp: string;
  graphsync_retrieval_success: number;
  graphsync_retrievals: number;
  http_retrieval_success: number;
  http_retrievals: number;
  provider: string;
}

⚠️ The WG encourages all new members to take your time to decide on your schema. Once you have created your collection and uploaded your first payload, it'll be a longer process to change the schema. It is much easier to maintain the database if the schema stays consistent for a data contributor over time. It is also easier for the users to query if your schema stays consistent. If you want to change your schema as an existing member, note that the process involves:

  1. the data collector posts their proposed schema changes in #reputation-dao for awareness with all working group members

  2. working group members discuss & vote to accept / deny the changes

  3. if the changes are accepted, the data collector can change their payload schema

Last updated