*.ros file questions in recent Construction API configuration

I just saw there were some changes recently in Rosetta-Cli, it introduced *.ros file to describe the actions. I tried to adopt this change, but when I ran the check:construction, seems some issues out there. Here are logs, and my configuration files

oaded configuration file: ontology-construction2.json
badger 2020/10/13 03:21:53 INFO: All 0 tables opened in 0s
badger 2020/10/13 03:21:54 INFO: Replaying file id: 0 at offset: 0
badger 2020/10/13 03:21:54 INFO: Replay took: 2.6µs
2020/10/13 03:21:54 construction tester initialized with 0 accounts
2020/10/13 03:21:54 0 Balances Updated
2020/10/13 03:21:54 check:construction status server running on port 9090
2020/10/13 03:21:54 waiting for implementation to reach tip before testing…
[STATS] Transactions Confirmed: 0 (Created: 0, In Progress: 0, Stale: 0, Failed: 0) Addresses Created: 0
[MEMORY] Heap: 1101.739220MB Stack: 0.500000MB System: 1257.597893MB GCs: 5
2020/10/13 03:22:04 waiting for implementation to reach tip before testing…

configuration files:
{
“network”: {
“blockchain”: “ont”,
“network”: “testnet”
},
“online_url”: “”,
“data_directory”: “./ont-data”,
“http_timeout”: 300,
“max_retries”: 5,
“retry_elapsed_time”: 0,
“max_online_connections”: 0,
“max_sync_concurrency”: 0,
“tip_delay”: 60,
“log_configuration”: false,
“construction”: {
“offline_url”: “”,
“max_offline_connections”: 0,
“stale_depth”: 0,
“broadcast_limit”: 0,
“ignore_broadcast_failures”: false,
“clear_broadcasts”: false,
“broadcast_behind_tip”: false,
“block_broadcast_limit”: 0,
“rebroadcast_all”: false,
“constructor_dsl_file”: “ontology.ros”,
“end_conditions”: {
“create_account”: 10
}
},
“data”: {
“active_reconciliation_concurrency”: 0,
“inactive_reconciliation_concurrency”: 0,
“inactive_reconciliation_frequency”: 0,
“log_blocks”: false,
“log_transactions”: false,
“log_balance_changes”: false,
“log_reconciliations”: false,
“ignore_reconciliation_error”: false,
“exempt_accounts”: “”,
“bootstrap_balances”: “”,

“interesting_accounts”: “”,
“reconciliation_disabled”: false,
“inactive_discrepency_search_disabled”: false,
“balance_tracking_disabled”: false,
“coin_tracking_disabled”: false,
“end_conditions”: {
“reconciliation_coverage”: {
“coverage”:0.95,
“from_tip”: true
}
},
“results_output_file”: “”
}
}

*.ros file:

request_funds(1){
find_account{
currency = {“symbol”:“ont”, “decimals”:0};
random_account = find_balance({
“minimum_balance”:{
“value”: “0”,
“currency”: {{currency}}
},
“create_limit”:1
});
print_message({“random_account”:{{random_account.account_identifier}}});
},
// Create a separate scenario to request funds so that
// the address we are using to request funds does not
// get rolled back if funds do not yet exist.
request{
loaded_account = find_balance({
“account_identifier”: {{random_account.account_identifier}},
“minimum_balance”:{
“value”: “1”,
“currency”: {{currency}}
}
});
}
}
create_account(1){
create{
network = {“network”:“testnet”, “blockchain”:“ont”};
key = generate_key({“curve_type”: “secp256k1”});
account = derive({
“network_identifier”: {{network}},
“public_key”: {{key.public_key}}
});
print_message({“account”:{{account.account_identifier}}});
// If the account is not saved, the key will be lost!
save_account({
“account_identifier”: {{account.account_identifier}},
“keypair”: {{key}}
});
print_message(“saveAccount success!!!”);
}
}

:wave: @PatrickWu

This new status is unrelated to your use of the new Rosetta Constructor DSL. Rather, it is a result of you updating the rosetta-cli to version >=v0.5.5.

Starting in rosetta-cli@v0.5.5, we wait to start syncing blocks for Construction API testing until we are at tip to avoid syncing and storing useless data. check:construction didn’t kick off any construction flows until at tip anyways, so this change didn’t bring any loss of functionality. If you use a node that is fully synced, tests should kickoff just as you would expect!

Related Links