Skip to content
Bofu Chen edited this page Jul 22, 2022 · 8 revisions

Commit Database

Commit Database is an optional cache layer on top of the blockchains for speeding up the access of Commits. Instead of retrieving the Commits on chain directly, we provide a default Commit Database. You can also create your own by following the interface below.

Numbers Commit Database

Base URLs

  1. Mainnet: https://node.numbersprotocol.io/api/1.1/wf
  2. Testnet: https://node.numbersprotocol.io/version-test/api/1.1/wf

Endpoints

  1. commitdb_update
    1. Request Commit Database to synchronize the Commits of the given Asset CID.
  2. commitdb_amount
    1. Get the current Commit amount of the given Asset CID in the Commit Database.
  3. commitdb
    1. Write on chain Commits into the Commit Database. Only the Commit Database has the permission to call it.

Examples

  1. Update an Asset CID
curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/commitdb_update' \
--header 'Content-Type: application/json' \
--data-raw '{
  "assetCid": "bafybeie7yzw2afoi36enyuk6hdxgll3y52g3yqeuvehutoxxkxssvbzqre",
  "dbEndpointUrl": "https://node.numbersprotocol.io/version-test/api/1.1/wf/commitdb"
}'

Clone this wiki locally