Skip to content

8. Appendix: Using rosetta cli for testing

syuan100 edited this page Jul 29, 2021 · 1 revision

check:data

Command:

rosetta-cli check:data --configuration-file rosetta-cli-config/mainnet/config.json

See the readme in order to understand what Helium transactions are supported. Testing data currently tests:

  • Syncing to tip
  • Recording all transactions seen (unsupported transactions are recorded as pass-through transactions)

Historical balances and account reconciliation are currently not supported.

Output example:

Success: Tip End Condition [Tip: 941134]

+--------------------+--------------------------------+------------+
|  CHECK:DATA TESTS  |          DESCRIPTION           |   STATUS   |
+--------------------+--------------------------------+------------+
| Request/Response   | Rosetta implementation         | PASSED     |
|                    | serviced all requests          |            |
+--------------------+--------------------------------+------------+
| Response Assertion | All responses are correctly    | PASSED     |
|                    | formatted                      |            |
+--------------------+--------------------------------+------------+
| Block Syncing      | Blocks are connected into a    | PASSED     |
|                    | single canonical chain         |            |
+--------------------+--------------------------------+------------+
| Balance Tracking   | Account balances did not go    | NOT TESTED |
|                    | negative                       |            |
+--------------------+--------------------------------+------------+
| Reconciliation     | No balance discrepencies were  | NOT TESTED |
|                    | found between computed and     |            |
|                    | live balances                  |            |
+--------------------+--------------------------------+------------+

+--------------------------+--------------------------------+-----------+
|     CHECK:DATA STATS     |          DESCRIPTION           |   VALUE   |
+--------------------------+--------------------------------+-----------+
| Blocks                   | # of blocks synced             |      8014 |
+--------------------------+--------------------------------+-----------+
| Orphans                  | # of blocks orphaned           |         0 |
+--------------------------+--------------------------------+-----------+
| Transactions             | # of transaction processed     |   2337774 |
+--------------------------+--------------------------------+-----------+
| Operations               | # of operations processed      |   7180722 |
+--------------------------+--------------------------------+-----------+
| Accounts                 | # of accounts seen             |         0 |
+--------------------------+--------------------------------+-----------+
| Active Reconciliations   | # of reconciliations performed |         0 |
|                          | after seeing an account in a   |           |
|                          | block                          |           |
+--------------------------+--------------------------------+-----------+
| Inactive Reconciliations | # of reconciliations performed |         0 |
|                          | on randomly selected accounts  |           |
+--------------------------+--------------------------------+-----------+
| Exempt Reconciliations   | # of reconciliation failures   |         0 |
|                          | considered exempt              |           |
+--------------------------+--------------------------------+-----------+
| Failed Reconciliations   | # of reconciliation failures   |         0 |
+--------------------------+--------------------------------+-----------+
| Skipped Reconciliations  | # of reconciliations skipped   |         0 |
+--------------------------+--------------------------------+-----------+
| Reconciliation Coverage  | % of accounts that have been   | 0.000000% |
|                          | reconciled                     |           |
+--------------------------+--------------------------------+-----------+

check:construction

Command:

rosetta-cli check:construction --configuration-file rosetta-cli-config/mainnet/config.json

Testing construction current tests:

  • Creating new accounts
  • Transferring HNT from one account to another

* 3 accounts are created and 1 transaction

NOTE: You will need to fund the account that is created in order to complete the check:construction test. After running the command for the first time, you should see a repeat message in the output like so:

2021/07/27 19:24:10 processing workflow "request_funds" for job "1"
2021/07/27 19:24:10 looking for balance {"value":"1000000","currency":{"symbol":"HNT","decimals":8}} on account {"address":"138HSB8MShicY3Mo7YXvQ99egpTC5NWEUrfge2EojouMgPx3gDC"}

You will need to fund the address shown with at least 0.1 HNT, which is hopefully not prohibitively expensive. We are currently working on getting a testnet version implemented which should allow for more flexible testing.

Output example:

2021/07/27 19:27:01 processing workflow "transfer"
2021/07/27 19:27:01 looking for balance {"value":"1000000","currency":{"symbol":"HNT","decimals":8}}
2021/07/27 19:27:01 waiting for available jobs...
broadcast complete for job "transfer (4)" with transaction hash "ORltq85Isb3IWmYGh9iR_QH4jba3QPNmcHQ7_XFiFKY"
{"address":"138GSB8MShicY3Mo7XXvQ99egpTC4NWEUrfge2VojouMgPx3gCC"} -> -0.13703625 HNT
{"address":"14VjExLqzhFsRcaZkCsX2urEhdMvgLjK2YFR7EoCeUxeHR9VA4t"} -> 0.10637921 HNT
[MEMORY] Heap: 1160.683983MB Stack: 1.656250MB System: 1462.234535MB GCs: 11
2021/07/27 19:27:05 check:construction status server shutting down
[MEMORY] Heap: 1160.752617MB Stack: 1.656250MB System: 1462.234535MB GCs: 11
[STATS] Transactions Confirmed: 1 (Created: 1, In Progress: 0, Stale: 1, Failed: 0) Addresses Created: 3
2021/07/27 19:27:11 Added &{Index:941129 Hash:ChygS4ykP3rI8gNMNaIA-MyZV2EAj7hhh7WtcwdKfj8} to cache
2021/07/27 19:27:11 Added &{Index:941128 Hash:3xvRl0ixP7gleWare7UfCtQ5rxf4hn_wlbf_90-KiBA} to cache
2021/07/27 19:27:11 Added &{Index:941127 Hash:v-NgDNwtcwHX_w4xjiFsUDqFSihif1mRbMbuVaSLdHQ} to cache
2021/07/27 19:27:11 Added &{Index:941126 Hash:b_u-VzrFXYdu6DoKjoUnOydqzDLWbe91Uthhh77r3Lg} to cache
2021/07/27 19:27:11 Added &{Index:941125 Hash:zRY8edQ8L8F4O8Sm83REFAZIL18CLz8iabKndQTySLo} to cache
2021/07/27 19:27:11 Added &{Index:941124 Hash:frdP7UZ9bmX10XGnjeEiIbKVwVT51SBkiHO-xIL3YcY} to cache
2021/07/27 19:27:11 Added &{Index:941123 Hash:NAynOAQsz4IlPefGTja9VB6tGQ7CIomXMTRNahH-j94} to cache
2021/07/27 19:27:11 Added &{Index:941122 Hash:uKSZk8lYTdoyDQm-QBhFcaVrus8i3Kl9zwylLQ_hbjA} to cache
2021/07/27 19:27:11 Added &{Index:941121 Hash:UYZFJnOH94fuAwZ562T671UsFEgMvQBlErgwGSi8DrI} to cache
2021/07/27 19:27:11 Added &{Index:941120 Hash:Lf5pvCtAlCInlJeV1_9mZARury1pPzXVx9W10mdzczw} to cache
2021/07/27 19:27:11 Added &{Index:941119 Hash:o3Ii1ZBo6dWybs6XAtLuwbuuxkAZxrp9ZHMbeN7RIxE} to cache
2021/07/27 19:27:11 Added &{Index:941118 Hash:eskhOQpzpDoW_9o33l8oGzt8ewl-H-_yPMbB1e2fjO4} to cache
2021/07/27 19:27:11 Added &{Index:941117 Hash:HjQduARYd0Qy7EcOhrFKsKG7169rZ_m-t0iHjdqnFv0} to cache
2021/07/27 19:27:11 Added &{Index:941116 Hash:ThvDR_hbyxBrpo428pqUYSnlirsbip29cWsZlwYBv4s} to cache
2021/07/27 19:27:11 Added &{Index:941115 Hash:ltJro8RfxxWf3BTDyT9AP0dYCgpA44Zagv__SmMLu7c} to cache

Success: {"create_account":1,"transfer":1}

+--------------------------+--------------------------------+-------+
| CHECK:CONSTRUCTION STATS |          DESCRIPTION           | VALUE |
+--------------------------+--------------------------------+-------+
| Addresses Created        | # of addresses created         |     3 |
+--------------------------+--------------------------------+-------+
| Transactions Created     | # of transactions created      |     1 |
+--------------------------+--------------------------------+-------+
| Stale Broadcasts         | # of broadcasts missing after  |     1 |
|                          | stale depth                    |       |
+--------------------------+--------------------------------+-------+
| Transactions Confirmed   | # of transactions seen         |     1 |
|                          | on-chain                       |       |
+--------------------------+--------------------------------+-------+
| Failed Broadcasts        | # of transactions that         |     0 |
|                          | exceeded broadcast limit       |       |
+--------------------------+--------------------------------+-------+
+------------------------------+-------+
| CHECK:CONSTRUCTION WORKFLOWS | COUNT |
+------------------------------+-------+
| request_funds                |     1 |
+------------------------------+-------+
| create_account               |     3 |
+------------------------------+-------+
| transfer                     |     1 |
+------------------------------+-------+