-
Notifications
You must be signed in to change notification settings - Fork 9
Design
Bofu Chen edited this page Sep 20, 2022
·
8 revisions
Nit borrows Git's design concepts, and the two core concepts are
- Asset Tree: The update of the Asset.
- Commit: An on-chain record including the reference of the linked Asset Tree.
There are some roles in Asset Tree and Commit:
- Asset Creator: Who created the asset.
- Author: Who creates the Asset Tree.
- Committer: Who registers the Commit on chain.
- Provider: The integrity service provider who provides smart contracts and APIs.
Refer to here for the latest stable schema.
Here are some commonly used licenses for creations:
licenses: {
"cc-by": {
"name": "Creative Commons Attribution 4.0 International",
"document": "https://creativecommons.org/licenses/by/4.0/"
},
"cc-by-sa": {
"name": "Creative Commons Attribution-ShareAlike 4.0 International",
"document": "https://creativecommons.org/licenses/by-sa/4.0/"
},
"cc-by-nd": {
"name": "Creative Commons Attribution-NoDerivatives 4.0 International",
"document": "https://creativecommons.org/licenses/by-nd/4.0/"
},
"cc-by-nc": {
"name": "Creative Commons Attribution-NonCommercial 4.0 International",
"document": "https://creativecommons.org/licenses/by-nc/4.0/"
},
"cc-by-nc-sa": {
"name": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International",
"document": "https://creativecommons.org/licenses/by-nc-sa/4.0/"
},
"cc-by-nc-nd": {
"name": "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International",
"document": "https://creativecommons.org/licenses/by-nc-nd/4.0/"
},
"mit": {
"name": "mit",
"document": "https://opensource.org/licenses/MIT"
},
"public": {
"name": "public-domain",
"document": "https://opensource.org/licenses/MIT"
}
}
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.
Base URLs
- Mainnet:
https://node.numbersprotocol.io/api/1.1/wf
- Testnet:
https://node.numbersprotocol.io/version-test/api/1.1/wf
Endpoints
-
commitdb_update
- Request Commit Database to synchronize the Commits of the given Asset CID.
-
commitdb_amount
- Get the current Commit amount of the given Asset CID in the Commit Database.
-
commitdb
- Write on-chain Commits into the Commit Database. Only the Commit Database has the permission to call it.
Examples
- 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"
}'