There is a list of commands to interact with DAG:
- DAG EVENT CANCEL - removes event
- DAG EVENT SIGN - adds sign to event `
- DAG EVENT LIST - shows event list
- DAG EVENT FIND - finds event which contains specified datum
- DAG EVENT DUMP - shows dump event information
- DAG EVENT COUNT - shows counted events
- DAG ROUND COMPLETE - completes the current new round
JSON-RPC Request - DAG EVENT CANCEL
Removes event from the new forming round and puts it its datum back to mempool.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","cancel"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","cancel"],
"arguments": {
"net": "foobar",
"chain": "zerochain",
"datum": "0x22BFEF09C1254E61967259CD1245C1380594AF401194F59B946EFE0E9332D817"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Successfuly removed event (null) from the new forming round ",
"errors": null,
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT CANCEL
Removes event from the new forming round and puts it its datum back to mempool.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","cancel"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","cancel"],
"arguments": {
"net": "foobar",
"chain": "zerochain",
"datum": "0x22BFEF09C1254E61967259CD1245C1380594AF401194F59B946EFE0E9332D817"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Successfuly removed event (null) from the new forming round ",
"errors": null,
"id": 1
}
JSON-RPC Request - DAG EVENT SIGN
Adds sign to event in the round.new
.
Hash doesn’t include other signs so event hash doesn’t change upon adding signature.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","sign"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash",
"cert": "priv_cert_name"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
cert
- name of the private root certificate
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Request Structure
JSON object:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","sign"],
"arguments": {
"net": "foobar",
"chain": "zerochain",
"event": "0x43F9AAF6C632377DBC2E531FE7A706D51B574D6DB239B268F8DB566FB71E91A1 ",
"cert": "foobar.root.pvt.1"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Added new sign with cert \"foobar.root.pvt.1\", event 0x28B95D8E082CCD1D80CFBDE1499D4797F3C7889F4C56F5478EBD40B47561119C placed back in round.new\n",
"errors": null,
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT SIGN
Adds sign to event in the round.new
.
Hash doesn’t include other signs so event hash doesn’t change upon adding signature.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","sign"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash",
"cert": "priv_cert_name"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
cert
- name of the private root certificate
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Request Structure
JSON object:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","sign"],
"arguments": {
"net": "foobar",
"chain": "zerochain",
"event": "0x43F9AAF6C632377DBC2E531FE7A706D51B574D6DB239B268F8DB566FB71E91A1 ",
"cert": "foobar.root.pvt.1"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Added new sign with cert \"foobar.root.pvt.1\", event 0x28B95D8E082CCD1D80CFBDE1499D4797F3C7889F4C56F5478EBD40B47561119C placed back in round.new\n",
"errors": null,
"id": 1
}
JSON-RPC Request - DAG EVENT LIST
Shows events list.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","list"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"from": "events | events_lasts | threshold | round.new | round.<round_id_in_hex>"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
from
- ledger section, from where the events will be unloaded (events, events_lasts, threshold, round.new). Must be indicated in HEX format. Use events
as default.
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","list"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"from": "events"
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
#over 500 events missed for making this response readable
{
"EVENTS": [
{
"limit": "unlimit"
},
{
"#": "585",
"event number": 5,
"hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"ts_create": "Mon, 10 Apr 2023 15:15:40 +0000"
},
{
"#": "586",
"event number": 4,
"hash": "0x5297CB7384BF93FB76EF574341CF60E1C297736D6C780BA64C956E9F888FE964",
"ts_create": "Mon, 10 Apr 2023 15:04:41 +0000"
},
{
"#": "587",
"event number": 3,
"hash": "0xCB2C05E3601F5F835FE163F29105B10DCC5D9396E52BDCE0F127F79016F60907",
"ts_create": "Mon, 10 Apr 2023 14:53:49 +0000"
},
{
"#": "588",
"event number": 2,
"hash": "0xE94BBE15850C1DBD533BEDD8160CEE0BCF92F3EE8887CA2769C6931C570CD86B",
"ts_create": "Thu, 06 Apr 2023 16:32:00 +0000"
},
{
"#": "589",
"event number": 1,
"hash": "0xC08E77BBDB20C19E9D4A6A6F2FA0AF64990833951E24D7398C0773445898885E",
"ts_create": "Thu, 30 Mar 2023 02:19:40 +0000"
}
],
"net name": "riemann",
"chain": "zerochain",
"total events": 589
}
],
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT LIST
Shows events list.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","list"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"from": "events | events_lasts | threshold | round.new | round.<round_id_in_hex>"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
from
- ledger section, from where the events will be unloaded (events, events_lasts, threshold, round.new). Must be indicated in HEX format. Use events
as default.
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","list"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"from": "events"
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
#over 500 events missed for making this response readable
{
"EVENTS": [
{
"limit": "unlimit"
},
{
"#": "585",
"event number": 5,
"hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"ts_create": "Mon, 10 Apr 2023 15:15:40 +0000"
},
{
"#": "586",
"event number": 4,
"hash": "0x5297CB7384BF93FB76EF574341CF60E1C297736D6C780BA64C956E9F888FE964",
"ts_create": "Mon, 10 Apr 2023 15:04:41 +0000"
},
{
"#": "587",
"event number": 3,
"hash": "0xCB2C05E3601F5F835FE163F29105B10DCC5D9396E52BDCE0F127F79016F60907",
"ts_create": "Mon, 10 Apr 2023 14:53:49 +0000"
},
{
"#": "588",
"event number": 2,
"hash": "0xE94BBE15850C1DBD533BEDD8160CEE0BCF92F3EE8887CA2769C6931C570CD86B",
"ts_create": "Thu, 06 Apr 2023 16:32:00 +0000"
},
{
"#": "589",
"event number": 1,
"hash": "0xC08E77BBDB20C19E9D4A6A6F2FA0AF64990833951E24D7398C0773445898885E",
"ts_create": "Thu, 30 Mar 2023 02:19:40 +0000"
}
],
"net name": "riemann",
"chain": "zerochain",
"total events": 589
}
],
"id": 1
}
JSON-RPC Request - DAG EVENT FIND
Finds event which contains specified datum.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","find"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"datum": "datum_hash"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
datum
- hash of the datum
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","find"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"datum": "0x414C8D377E28C387FF2AB893670BEEA10F5126A8655E239E12FF348F70FB4F40"
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"Events": [
{
"event hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546"
}
],
"Total": 1
}
],
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT FIND
Finds event which contains specified datum.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","find"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"datum": "datum_hash"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
datum
- hash of the datum
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","find"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"datum": "0x414C8D377E28C387FF2AB893670BEEA10F5126A8655E239E12FF348F70FB4F40"
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"Events": [
{
"event hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546"
}
],
"Total": 1
}
],
"id": 1
}
JSON-RPC Request - DAG EVENT DUMP
Shows detailed event information.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash",
"from": "events | events_lasts | threshold | round.new | round.<round_id_in_hex>",
"H": "hex | base58"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
from
- ledger section, from where the events will be unloaded (events, events_lasts, threshold, round.new). Must be indicated in HEX format. Use events
as default.
H
- the format of the hash value for the command parameter. It can be either in HEX format: 0x4E9B6B890D5D78BB46AA5442BDEFF2FPDA8929BA9689F86235353BF784B5
or in Base58: Betcryb4arefsamtjars9dxydzasszdfkkh6
, optional
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
"method": "dag",
"subcommand": ["event","dump"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"event": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"from": "events",
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"Event hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"Header": "empty",
"version": "0x00",
"round ID": 11,
"cell_id": "0x0000000000000000",
"chain_id": "0x0000000000000000",
"ts_created": "Mon, 10 Apr 2023 15:15:40 +0000",
"hashes count": 1,
"hash": "0x5297CB7384BF93FB76EF574341CF60E1C297736D6C780BA64C956E9F888FE964",
"Datum": {
"=== Datum decree ===": "empty",
"hash": "0x414C8D377E28C387FF2AB893670BEEA10F5126A8655E239E12FF348F70FB4F40",
"size": 6696,
"type": "DECREE_TYPE_COMMON",
"subtype": "COMMON_SUBTYPE_STAKE_MIN_VALIDATORS_COUNT",
"TSD": "",
"Min signers count": "2",
"signatures": "",
"SIGNS": [
{
"sign #": 1,
"hash": "0x847991D080A242F481761321549E356517CB9024C1E204326ACB85064ED4FE29",
"type": "sig_dil",
"sign size": 2096
},
{
"sign #": 2,
"hash": "0xA9279C1CBAC80812F5E99C70B5A55E390B4334E1ACDC994BA4DC365C9F5886DF",
"type": "sig_dil",
"sign size": 2096
}
]
},
"datum_size": 6711,
"type_id": "DATUM_DECREE",
"ts_create": "Mon, 10 Apr 2023 15:15:12 +0000",
"data_size": 6696,
"signs count": 3,
"type": "sig_dil",
"pkey_hash": "0x57AF31F04D48F44682FEEF66D92578CA98CA9E682E088599727CD16EC4AF9991"
}
],
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT DUMP
Shows detailed event information.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
"event": "event_hash",
"from": "events | events_lasts | threshold | round.new | round.<round_id_in_hex>",
"H": "hex | base58"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
event
- hash of the event
from
- ledger section, from where the events will be unloaded (events, events_lasts, threshold, round.new). Must be indicated in HEX format. Use events
as default.
H
- the format of the hash value for the command parameter. It can be either in HEX format: 0x4E9B6B890D5D78BB46AA5442BDEFF2FPDA8929BA9689F86235353BF784B5
or in Base58: Betcryb4arefsamtjars9dxydzasszdfkkh6
, optional
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
"method": "dag",
"subcommand": ["event","dump"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
"event": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"from": "events",
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"Event hash": "0x5B20594334D6B94EC96CCE234CC56785376D79DCB3D7445D5C2AF4C52B225546",
"Header": "empty",
"version": "0x00",
"round ID": 11,
"cell_id": "0x0000000000000000",
"chain_id": "0x0000000000000000",
"ts_created": "Mon, 10 Apr 2023 15:15:40 +0000",
"hashes count": 1,
"hash": "0x5297CB7384BF93FB76EF574341CF60E1C297736D6C780BA64C956E9F888FE964",
"Datum": {
"=== Datum decree ===": "empty",
"hash": "0x414C8D377E28C387FF2AB893670BEEA10F5126A8655E239E12FF348F70FB4F40",
"size": 6696,
"type": "DECREE_TYPE_COMMON",
"subtype": "COMMON_SUBTYPE_STAKE_MIN_VALIDATORS_COUNT",
"TSD": "",
"Min signers count": "2",
"signatures": "",
"SIGNS": [
{
"sign #": 1,
"hash": "0x847991D080A242F481761321549E356517CB9024C1E204326ACB85064ED4FE29",
"type": "sig_dil",
"sign size": 2096
},
{
"sign #": 2,
"hash": "0xA9279C1CBAC80812F5E99C70B5A55E390B4334E1ACDC994BA4DC365C9F5886DF",
"type": "sig_dil",
"sign size": 2096
}
]
},
"datum_size": 6711,
"type_id": "DATUM_DECREE",
"ts_create": "Mon, 10 Apr 2023 15:15:12 +0000",
"data_size": 6696,
"signs count": 3,
"type": "sig_dil",
"pkey_hash": "0x57AF31F04D48F44682FEEF66D92578CA98CA9E682E088599727CD16EC4AF9991"
}
],
"id": 1
}
JSON-RPC Request - DAG EVENT COUNT
Prints events number.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"net name": "riemann",
"chain": "zerochain",
"event count in round new": 0,
"atom in events": 589,
"atom in threshold": 0
}
],
"id": 1
}
Link to original
JSON-RPC Request - DAG EVENT COUNT
Prints events number.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "network_name",
"chain": "chain_name",
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["event","count"],
"arguments": {
"net": "riemann",
"chain": "zerochain",
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"net name": "riemann",
"chain": "zerochain",
"event count in round new": 0,
"atom in events": 589,
"atom in threshold": 0
}
],
"id": 1
}
JSON-RPC Request - DAG ROUND COMPLETE
Completes the current new round, verifies it and publishes new events in the chain.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["round","complete"],
"arguments": {
"net": "network_name",
"chain": "chain_name"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Request Structure
JSON object:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["round","complete"],
"arguments": {
"net": "foobar",
"chain": "zerochain"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Completing round:\nEvent 0xEC910C7514AAE7E92D92FFC6EEC7DB88AB262625083208CCE659133EC1E60F74 verification passed\nEvent 0xEC910C7514AAE7E92D92FFC6EEC7DB88AB262625083208CCE659133EC1E60F74 added in chain successfully\n",
"errors": null,
"id": 1
}
Link to original
JSON-RPC Request - DAG ROUND COMPLETE
Completes the current new round, verifies it and publishes new events in the chain.
Request Structure
JSON object:
{
"method": "dag",
"subcommand": ["round","complete"],
"arguments": {
"net": "network_name",
"chain": "chain_name"
},
"id": "1"
}
Parameters:
net (network_name)
- name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network
folder or received using - Node Command - NET LIST
chain
- the name of chain (main
or zerochain
)
If you make a request in the Cellframe network, use parameter chain:zerochain
.
Request Structure
JSON object:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
"method": "dag",
"subcommand": ["round","complete"],
"arguments": {
"net": "foobar",
"chain": "zerochain"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Completing round:\nEvent 0xEC910C7514AAE7E92D92FFC6EEC7DB88AB262625083208CCE659133EC1E60F74 verification passed\nEvent 0xEC910C7514AAE7E92D92FFC6EEC7DB88AB262625083208CCE659133EC1E60F74 added in chain successfully\n",
"errors": null,
"id": 1
}