智能合约

要直接与 KurateDAO 智能合约交互,API 如下。 智能合约可以在 Github 上找到。

数据库

mintDatabase

function mintDatabase(
    string memory title, 
    string memory description, 
    string memory curatorName, 
    string memory curatorUrl, 
    uint timeoutCrowd, 
    uint timeoutCurator, 
    uint thresholdCurator,
    string memory jsonSchema
) public payable

getDatabasesAll

function getDatabasesAll() public view returns(DatabaseSimple[] memory)

架构

JSON Schema 存储在智能合约中,以便客户端知道行是否符合数据库的结构。

{
     "$schema": "http://json-schema.org/draft-04/schema#",
     "description": "VIPs",
     "type": "object",
     "properties": {
         "name": {
             "type": "string"
         },
         "guests": {
             "type": "number"
         }
     },
     "required": ["name","guests"]
}

Last updated