ixo CellNode

Cell Node API

Note: the legacy name for Cell Node was Project Data Store (PDS).
A Cell Node is a decentralised data processing and storage node. This has a public API and private API. Public API requests do not require cryptographic signatures. All other requests must be signed and adhere to the capabilities that have been granted to the signer.

Public API

URI: <pds server>/api/public
Request type: POST
Structure: {"jsonrpc": "2.0", "method": "<method name>", "id": <message id>, "params": <json data object> }
Variable
Description
<node server>
The URL of the server
<entity>
The entity to send the method
<method name>
The name of the method to call defined in the config file
<message id>
The message ID, used to correlate asynchronous responses
<json data object>
The parameters that are passed to the method handler

Structure of the params object

These are unsigned requests for publicly available information. A content identifier is generated and sent back to the client, to be used in retrieval of this information.
Data will be accepted any of the following encodings: "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex".
1
{
2
"jsonrpc":"2.0",
3
"method":"createPublic",
4
"id": 123,
5
"params": {
6
"data": "bob public message",
7
"contentType": "text"
8
}
9
}
Copied!
<a name="pds-createPublic-image"></a>

Upload an image

Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "createPublic",
4
"id": 3,
5
"params":
6
{
7
"data": "<base64 encoded image>",
8
"contentType": "image/png"
9
}
10
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": "<string>"
5
}
Copied!

Fetch image

Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "fetchPublic",
4
"id": 3,
5
"params": {"key": <string>}
6
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"data": "<base64 encoded image>",
6
"contentType": "image/png"
7
}
8
}
Copied!

Upload a Json file

Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "createPublic",
4
"id": 3,
5
"params":
6
{
7
"data": "<JSON string>",
8
"contentType": "application/json"
9
}
10
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": "<string>"
5
}
Copied!

Fetch Json file

Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "fetchPublic",
4
"id": 3,
5
"params": {"key": <string>}
6
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"data": "<JSON string>",
6
"contentType": "application/json"
7
}
8
}
Copied!

Private API

URI: <pds server>/api/request
Request type: POST
Structure: {"jsonrpc": "2.0", "method": "<method name>", "id": <message id>, "params": <json data object> }
Variable
Description
<node server>
The URL of the server
<entity>
The entity to send the method
<method name>
The name of the method to call defined in the config file
<message id>
The message ID, used to correlate asynchronous responses
<json data object>
The parameters that are passed to the method handler

Structure of the params object

Everything in the payload section is signed to generate a valid signature. This should be packaged using JSON.stringify() method before signing.
1
{
2
"jsonrpc":"2.0",
3
"method":"createAgent",
4
"id": 123,
5
"params": {
6
"payload": {
7
8
"template": {
9
"name": "create_agent"
10
},
11
"data": {"projectDid": "did:ixo:TknEju4pjyRQvVehivZ82x",
12
"name": "Brennon",
13
"surname": "Hampton",
14
"email": "[email protected]",
15
"agentDid": "did:sov:64",
16
"role": "SA"}
17
},
18
"signature": {
19
"type": "ed25519-sha-256",
20
"created": "2018-06-27T16:02:20Z",
21
"creator": "did:ixo:2p19P17cr6XavfMJ8htYSS",
22
"signatureValue": "A011D11A2D91A9CB03ECFFB7D9AFC1001DB56B3DABF42BDD0F4D00352A9B8E0E73E85F0B4586DA2934696C0A78602EEB047EA6B3D9096C1A0C3FB144E6A51C09"
23
}
24
}
25
}
Copied!

Create Entity

Creates a new entity.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "createProject",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<create project data>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Example:
1
{
2
"jsonrpc": "2.0",
3
"method": "createProject",
4
"id": 123,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "create_project"
9
},
10
"data": {
11
"title": "Water project",
12
"ownerName": "Don",
13
"ownerEmail": "[email protected]",
14
"shortDescription": "Project for water",
15
"longDescription": "project to save water for areas with drought",
16
"impactAction": "litres of water saved",
17
"projectLocation": "ZA",
18
"sdgs": [
19
"12.2",
20
"3",
21
"2.4"
22
],
23
"requiredClaims": 30,
24
"templates": {
25
"claim": {
26
"schema": "af175axcn6ejiuds0sh",
27
"form": "1v6v8a6woabjiuds3i9"
28
}
29
},
30
"evaluatorPayPerClaim": "0",
31
"socialMedia": {
32
"facebookLink": "https://www.facebook.com/ixofoundation/",
33
"instagramLink": "",
34
"twitterLink": "",
35
"webLink": "https://ixo.foundation"
36
},
37
"serviceEndpoint": "http://35.192.187.110:5000/",
38
"imageLink": "pc16l7yk62ejiudrox5",
39
"founder": {
40
"name": "Nic",
41
"email": "[email protected]",
42
"countryOfOrigin": "ZA",
43
"shortDescription": "primary description for founder",
44
"websiteURL": "www.water.com",
45
"logoLink": ""
46
}
47
}
48
},
49
"signature": {
50
"type": "ed25519-sha-256",
51
"created": "2018-06-05T12:35:02Z",
52
"creator": "did:ixo:2p19P17cr6XavfMJ8htYSS",
53
"signatureValue": "23EED2462B11B94C9F63A509B39F15CB9C0B2DB8C16A52A22115B755BF3F6BDF7ABB8881697AA7DB6F4AFBD7C5DE4618B403AB43B738841BB89E72C8792AC401"
54
}
55
}
56
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"__v": 0,
6
<project data>
7
"tx": "b51cd2665d146d0a0240fd2756beb4c9e9c1948275ac5d37a7ae405ab2d71a7a",
8
"_id": "5a66e09b38f45f01d90d122a",
9
}
10
}
Copied!
Example:
1
{
2
"jsonrpc": "2.0",
3
"id": 123,
4
"result": {
5
"_id": "5b32094f05aa3f0011405957",
6
"title": "Test Water project",
7
"ownerName": "Don",
8
"ownerEmail": "[email protected]",
9
"shortDescription": "Project for water",
10
"longDescription": "project to save water for areas with drought",
11
"impactAction": "litres of water saved",
12
"projectLocation": "ZA",
13
"sdgs": [
14
"12.2",
15
"3",
16
"2.4"
17
],
18
"requiredClaims": 30,
19
"templates": {
20
"claim": {
21
"schema": "af175axcn6ejiuds0sh",
22
"form": "1v6v8a6woabjiuds3i9"
23
}
24
},
25
"evaluatorPayPerClaim": "0",
26
"socialMedia": {
27
"facebookLink": "https://www.facebook.com/ixofoundation/",
28
"instagramLink": "",
29
"twitterLink": "",
30
"webLink": "https://ixo.foundation"
31
},
32
"serviceEndpoint": "http://35.192.187.110:5000/",
33
"imageLink": "pc16l7yk62ejiudrox5",
34
"founder": {
35
"name": "Nic",
36
"email": "[email protected]",
37
"countryOfOrigin": "ZA",
38
"shortDescription": "primary description for founder",
39
"websiteURL": "www.water.com",
40
"logoLink": ""
41
},
42
"txHash": "a09c8bc12a3e7cc1f859f0fc98cd37880d8c894826e0f1fa7a3f824db37941f5",
43
"__v": 0
44
}
45
}
Copied!

Create Agent

Creates a new agent.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "createAgent",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<create agent data>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"__v": 0,
6
<agent data>
7
"tx": "b51cd2665d146d0a0240fd2756beb4c9e9c1948275ac5d37a7ae405ab2d71a7a",
8
"_id": "5a66e09b38f45f01d90d122a",
9
"version": 1
10
}
11
}
Copied!

Update Agent Status

Update Agent Status
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "updateAgentStatus",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<update agent data>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"__v": 0,
6
<agent data>
7
"tx": "b51cd2665d146d0a0240fd2756beb4c9e9c1948275ac5d37a7ae405ab2d71a7a",
8
"did": <creator's did>
9
"_id": "5a66e09b38f45f01d90d122a",
10
"version": 1
11
}
12
}
Copied!

List Agents

List claims and latest status.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "listAgents",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<data to filter>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": [
5
{
6
<agent data>,
7
"currentStatus": {
8
<agent status data>
9
}
10
}
11
]
12
}
Copied!

Submit Claim

Creates a new claim.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "submitClaim",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<submit claim data>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"__v": 0,
6
<claim data>
7
"tx": "b51cd2665d146d0a0240fd2756beb4c9e9c1948275ac5d37a7ae405ab2d71a7a",
8
"_id": "5a66e09b38f45f01d90d122a"
9
}
10
}
Copied!

Evaluate Claim

Evaluate a new claim.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "evaluateClaim",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<evaluate claim data>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": {
5
"__v": 0,
6
<claim data>
7
"tx": "b51cd2665d146d0a0240fd2756beb4c9e9c1948275ac5d37a7ae405ab2d71a7a",
8
"_id": "5a66e09b38f45f01d90d122a",
9
"version": 1
10
}
11
}
Copied!

List Claim

List claims and latest status.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "listClaims",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<data to filter>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": [
5
{
6
<claim data>,
7
"evaluations": {
8
<claim status data>
9
}
10
}
11
]
12
}
Copied!

List Claim by Template ID

List claims and latest status filtered by template ID. The template ID is expected to be included in <data to filter> as claimTemplateId.
Request:
1
{
2
"jsonrpc": "2.0",
3
"method": "listClaims",
4
"id": 3,
5
"params": {
6
"payload": {
7
"template": {
8
"name": "<template to validate>"
9
},
10
"data": {
11
<data to filter>
12
}
13
},
14
"signature": {
15
"type": <signature type ECDSA or E25519>,
16
"created": <date of signature>,
17
"creator": <user did>,
18
"signatureValue": <signature in hex>
19
}
20
}
21
}
Copied!
Response:
1
{
2
"jsonrpc": "2.0",
3
"id": 3,
4
"result": [
5
{
6
<claim data>,
7
"evaluations": {
8
<claim status data>
9
}
10
}
11
]
12
}
Copied!

Health Check Functions

Cell Node Health Check

URI: <pds server>/
Request type: GET
Response:
1
API is running
Copied!
The ixo-cellNode (pds) uses JSON-RPC to receive client requests. The structure of all calls follow the same structure:
Last modified 2mo ago