There is a list of commands to interact with DAG:

Node Command - DAG EVENT CANCEL

Removes event from the new forming round and puts it its datum back to mempool.

Command syntax:

dag event cancel 
-net <net_name> 
-chain <chain_name> 
-event <event_hash>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - the name of Chain. The list of chains can be found in the directory <Config_dir> \ etc \ network \ <network_name> or by the Cellframe-Node-CLI using command - net list chains
-event - hash of the event

CLI Example

Command:

cellframe-node-cli dag event cancel 
-net foobar 
-chain zerochain 
-datum 0x771858B0FD6BB61C999C2AE26FBE3EF4BAD1E4D974A85DF5FDE3D8272340863E

Response:

Event was removed successfully (null) from the new forming round

JSON-RPC Example

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

Link to original

Node Command - 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.

Command syntax:

dag event sign 
-net <net_name> 
-chain <chain_name> 
-event <event_hash> 
-cert <priv_cert_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command
-event - hash of the event
-cert - name of the private root certificate

CLI Example

Command:

cellframe-node-cli dag event sign 
-net foobar 
-chain zerochain 
-event 0x43F9AAF6C632377DBC2E531FE7A706D51B574D6DB239B268F8DB566FB71E91A1 
-cert foobar.root.pvt.1

Response:

Added new sign with cert "foobar.root.pvt.1", event 0x8C386F7B4EF3FA736C0220D4DB193E737D869E6F4606BA48AF55B2E282EA724C placed back in round.new

JSON-RPC Example

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

Link to original

Node Command - DAG EVENT LIST

Shows events list.

Command syntax:

dag event list 
-net <net_name> 
-chain <chain_name> 
-from {events | events_lasts | threshold | round.new | round.<round_id_in_hex>}

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command
-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.

CLI Example

Command:

cellframe-node-cli dag event list 
-net riemann 
-chain zerochain 
-from events

Response:

0xC08E77BBDB20C19E9D4A6A6F2FA0AF64990833951E24D7398C0773445898885E: ts_create=Thu, 30 Mar 2023 02:19:40 +0000

        0xE94BBE15850C1DBD533BEDD8160CEE0BCF92F3EE8887CA2769C6931C570CD86B: ts_create=Thu, 06 Apr 2023 16:32:00 +0000

        0xCB2C05E3601F5F835FE163F29105B10DCC5D9396E52BDCE0F127F79016F60907: ts_create=Mon, 10 Apr 2023 14:53:49 +0000

...

        0x23F9419DBAF7B380EBE12D34565682B15C17AF2D0E5346B51948025526831B52: ts_create=Wed, 22 Nov 2023 19:02:46 +0000

riemann.zerochain have total 28 events :

JSON-RPC Example

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

Link to original

Node Command - DAG EVENT FIND

Finds event which contains specified datum.

Command syntax:

dag event find -net <net_name> [-chain <chain_name>] -datum <datum_hash>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command (optional)
-datum - hash of the datum

CLI Example

Command:

cellframe-node-cli dag event find -net riemann -datum 0x562FB0177E71EE299532467A937E181CB409714864FBC8620590CF0E62CA22C0

Response:

        Events:

                event hash: 0x6F211498A167714C55409C8563D14787013BBD0CEA6D1BEAE2681C4C3E4404AE


        Total: 1

JSON-RPC Example

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

Link to original

Node Command - DAG EVENT DUMP

Shows detailed event information.

Command syntax:

dag event dump 
-net <net_name> 
-chain <chain_name> 
-event <event_hash> 
-from {events | events_lasts | threshold | round.new  | round.<round_id_in_hex>} [-H {hex | base58(default)}]

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command
-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)

CLI Example

Command:

cellframe-node-cli dag event dump 
-net riemann 
-chain zerochain 
-event  0x8B289BF65AB053E47AA4E43AC03817802AD1FC29E381E5382681CA6867594C33 
-from events

Response:

Event 0x8B289BF65AB053E47AA4E43AC03817802AD1FC29E381E5382681CA6867594C33:
                Header:
                       version: 0
                        round ID: 24
                        cell_id: 0x0000000000000000
                        chain_id: 0x0000000000000000
                        ts_created: Tue, 04 Jul 2023 11:26:36 +0000
                        hashes: count: 1
                                hash: 0xC50AEAD64265FC5482DB916340BDAB5F89C304B2E6CA173756CD9D75AA5BB259
                datum:  datum_size: 10246
                        version:=0x00
                        type_id:=DATUM_TOKEN_EMISSION
                        ts_create=Tue, 04 Jul 2023 11:25:59 +0000
                        data_size=10231
                                signs:  count: 3
                                                type: sig_dil   pkey_hash: 0x847991D080A242F481761321549E356517CB9024C1E204326ACB85064ED4FE29
                                                type: sig_dil   pkey_hash: 0x57AF31F04D48F44682FEEF66D92578CA98CA9E682E088599727CD16EC4AF9991
                                                type: sig_dil   pkey_hash: 0xA9279C1CBAC80812F5E99C70B5A55E390B4334E1ACDC994BA4DC365C9F5886DF
emission: hash 0xD57AF6A7A8AA4BB7E792E4999CA28F89A6AF34D71333A9D3F2C7C71D8D3B3963
        10000000000000000000000000000000000000000000000.0(10000000000000000000000000000000000000000000000000000000000000000) tKEL, type: AUTH, version: 3
  to addr: o9z3wUTSTicckJuozCroUZnGMrSu9nWntsb93YaUa4ULAyxh8HJU6KkxEo2dN5ucSQPYtchniS5xhXzhnH5zqBSkxPz4D7fjEnrmLXRK
  signs_count: 3
  tsd_total_size: 0
signatures:
1) 0xE7D0E94E6792FE145A9691ECDFECA151BC1C7477C3E11979DA48E5752C14A2E1, sig_dil, 2096 bytes
2) 0x0A57D6D1F3E72E9F2D1DDA6E6089AFEB0AADB953FB347E08C7B6575D65FA6D56, sig_dil, 2096 bytes
3) 0x18A38ACF46876226F9AC130427870814503C19B00185A85F034DDC2058D699C1, sig_dil, 2096 bytes

JSON-RPC Example

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

Link to original

Node Command - DAG EVENT COUNT

Prints events number.

Command syntax:

dag event count 
-net <net_name> 
-chain <chain_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command

CLI Example

Command:

cellframe-node-cli dag event count 
-net riemann 
-chain zerochain

Response:

riemann.zerochain:

4 in round.new

28 atoms(s) in events

0 atom(s) in threshold

JSON-RPC Example

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

Link to original

Node Command - DAG ROUND COMPLETE

Completes the current new round, verifies it and publishes new events in the chain.

Command syntax:

dag round complete 
-net <net_name> 
-chain <chain_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-chain - the name of Chain. The list of chain can be found in the directory <Config_dir> \ etc \ network \ <network_name> or get the Cellframe-Node-App Net List Chains command

CLI Example

Command:

cellframe-node-cli dag round complete 
-net foobar 
-chain zerochain

Response:

Completing round:

Event 0xE75410319706F528F76244B99083EA92E87E3387C0204CC01C9B83492788E35E verification passed

Event 0xE75410319706F528F76244B99083EA92E87E3387C0204CC01C9B83492788E35E added in chain successfully

JSON-RPC Example

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

Link to original