Skip to content

Instantly share code, notes, and snippets.

@rBurgett
Last active June 9, 2023 22:52
Show Gist options
  • Save rBurgett/929fd73c8850aefaf04f222b7399e127 to your computer and use it in GitHub Desktop.
Save rBurgett/929fd73c8850aefaf04f222b7399e127 to your computer and use it in GitHub Desktop.
CC Provider API

Community Chains Provider API Documentation

This is a work in progress and subject to change.

/v1/providers/{{PROVIDER_ID}}/unlock

Authenticates the user and provides a token valid for 24 hours which can be used to make calls to the provider API.

Endpoint:

https://api.cc.nodepilot.tech/v1/providers/{{PROVIDER_ID}}/unlock

Method:

POST

Request Body:

{
  key: string              // user's API key
}

Response Body:

{
  token: string            // token that can be used to make authenticated provider API calls
  user: string             // provider id
  expiration: string       // expiration of token in ISO format
}

/v1/providers/{{PROVIDER_ID}}/general-relay-counts

Gets general relay counts for the provider over a time period.

Endpoint:

https://api.cc.nodepilot.tech/v1/providers/{{PROVIDER_ID}}/general-relay-counts

Method:

POST

Request Headers:

x-api-key=[token]

Request Body:

{
  startTime?: string       // start time of time period range in ISO format
  endTime?: string         // end time of time period range in ISO format
}

Response Body:

{
  chain: string            // chain id
  total: string            // total relays
  startTime: string        // start time of time period range in ISO format
  endTime: string          // end time of time period range in ISO format
  byRegion: {[region: string]: string} // relay counts by region
}[]

/v1/providers/{{PROVIDER_ID}}/payment-receipts

Gets provider payment receipts over a time period.

Endpoint:

https://api.cc.nodepilot.tech/v1/providers/{{PROVIDER_ID}}/payment-receipts

Method:

POST

Request Headers:

x-api-key=[token]

Request Body:

{
  startTime?: string       // start time of time period range in ISO format
  endTime?: string         // end time of time period range in ISO format
}

Response Body:

{
  id: string               // id of payment receipt
  date: string             // date of payment in ISO format
  total: string            // total provider rewards in uPOKT
  txid: string             // TXID of POKT payment (if payment tx has been submitted)
  relays: {
    chain: string          // chain id
    relays: string         // number of relays
    percent: number        // percentage used to calculate provider reward
    reward: string         // calculated provider reward in uPOKT
    breakdown: {[region: string]: string} // relay counts by region
  }[]
}[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment