BitShares Forum
Main => Technical Support => Topic started by: torkelrogstad on December 21, 2017, 12:05:38 pm
-
Hi!
I'm having trouble creating a UIA through the CLI.
Running
unlocked >>> create_asset bitspace-testcorp1 TESTBITTEST 5 { "max_supply" : 10000, "market_fee_percent" : 0.3, "max_market_fee" : 1000, "issuer_permissions" : { "charge_market_fee" : true, "white_list" : true, "override_authority" : true, "transfer_restricted" : true, "disable_force_settle" : true, "global_settle" : true, "disable_confidential" : true, "witness_fed_asset" : true, "committee_fed_asset" : true}, "flags" : { "charge_market_fee" : false, "white_list" : false, "override_authority" : false, "transfer_restricted" : false, "disable_force_settle" : false, "global_settle" : false, "disable_confidential" : false, "witness_fed_asset" : false, "committee_fed_asset" : false}, "core_exchange_rate" : {"base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399, "asset_id": "1.3.1"} }, "whitelist_authorities" : [], "blacklist_authorities" : [], "whitelist_markets" : [], "blacklist_markets" : [], "description" : "My fancy description"} {} false
create_asset bitspace-testcorp1 TESTBITTEST 5 { "max_supply" : 10000, "market_fee_percent" : 0.3, "max_market_fee" : 1000, "issuer_permissions" : { "charge_market_fee" : true, "white_list" : true, "override_authority" : true, "transfer_restricted" : true, "disable_force_settle" : true, "global_settle" : true, "disable_confidential" : true, "witness_fed_asset" : true, "committee_fed_asset" : true}, "flags" : { "charge_market_fee" : false, "white_list" : false, "override_authority" : false, "transfer_restricted" : false, "disable_force_settle" : false, "global_settle" : false, "disable_confidential" : false, "witness_fed_asset" : false, "committee_fed_asset" : false}, "core_exchange_rate" : {"base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399, "asset_id": "1.3.1"} }, "whitelist_authorities" : [], "blacklist_authorities" : [], "whitelist_markets" : [], "blacklist_markets" : [], "description" : "My fancy description"} {} false
leads to
4 parse_error_exception: Parse Error
Unexpected char '-62' in ""
{"c":-62,"s":""}
th_a json_relaxed.hpp:739 variant_from_stream
{"str":"create_asset bitspace-testcorp1 TESTBITTEST 5 { \"max_supply\" : 10000, \"market_fee_percent\" : 0.3, \"max_market_fee\" : 1000, \"issuer_permissions\" : { \"charge_market_fee\" : true, \"white_list\" : true, \"override_authority\" : true, \"transfer_restricted\" : true, \"disable_force_settle\" : true, \"global_settle\" : true, \"disable_confidential\" : true, \"witness_fed_asset\" : true, \"committee_fed_asset\" : true}, \"flags\" : { \"charge_market_fee\" : false, \"white_list\" : false, \"override_authority\" : false, \"transfer_restricted\" : false, \"disable_force_settle\" : false, \"global_settle\" : false, \"disable_confidential\" : false, \"witness_fed_asset\" : false, \"committee_fed_asset\" : false}, \"core_exchange_rate\" : {\"base\": { \"amount\": 21, \"asset_id\": \"1.3.0\"},\"quote\": { \"amount\": 76399, \"asset_id\": \"1.3.1\"} }, \"whitelist_authorities\" : [], \"blacklist_authorities\" : [], \"whitelist_markets\" : [], \"blacklist_markets\" : [], \"description\" : \"My fancy description\"} {} false�"}
th_a json.cpp:494 variants_from_string
I realize it's a bit ugly to issue an asset through cli_wallet, because of the need for handling JSON. However, the Python class described on {http://docs.bitshares.org/bitshares/tutorials/uia-create-manual.html (http://{http://docs.bitshares.org/bitshares/tutorials/uia-create-manual.html) doesn't work, and when using the API found on http://python-graphenelib.readthedocs.io/en/latest/rpc.html (http://python-graphenelib.readthedocs.io/en/latest/rpc.html) I can't connect to the testnet.
Does anyone know what I should do? Either how I should format my cli_wallet command, or how I can connect with graphenelib (URL, portnumber). Help is greatly appreciated.
-
Scroll to the right, and you'll see that you have an unrecognized character at the end of your statement. This is causing the error.
-
I removed all possible sources of trailing characters and replaced them with spaces. I now get the following error:
create_asset bitspace-testcorp1 TESTBITTEST 5 { "max_supply" : 10000, "market_fee_percent" : 0.3, "max_market_fee" : 1000, "issuer_permissions" : { "charge_market_fee" : true, "white_list" : true, "override_authority" : true, "transfer_restricted" : true, "disable_force_settle" : true, "global_settle" : true, "disable_confidential" : true, "witness_fed_asset" : true, "committee_fed_asset" : true}, "flags" : { "charge_market_fee" : false, "white_list" : false, "override_authority" : false, "transfer_restricted" : false, "disable_force_settle" : false, "global_settle" : false, "disable_confidential" : false, "witness_fed_asset" : false, "committee_fed_asset" : false}, "core_exchange_rate" : {"base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399, "asset_id": "1.3.1"} }, "whitelist_authorities" : [], "blacklist_authorities" : [], "whitelist_markets" : [], "blacklist_markets" : [], "description" : "My fancy description"} {} false
4 parse_error_exception: Parse Error
Couldn't parse uint64_t
{}
th_a string.cpp:113 to_uint64
{"i":"0.3"}
th_a string.cpp:116 to_uint64
{"*this":"0.3"}
th_a variant.cpp:405 as_uint64
It kinda seems like the parser doesn't like a non-integer market_fee_percent, so I run the following:
unlocked >>> create_asset bitspace-testcorp1 TESTBITTEST 5 { "max_supply" : 10000, "market_fee_percent" : 1, "max_market_fee" : 1000, "issuer_permissions" : { "charge_market_fee" : true, "white_list" : true, "override_authority" : true, "transfer_restricted" : true, "disable_force_settle" : true, "global_settle" : true, "disable_confidential" : true, "witness_fed_asset" : true, "committee_fed_asset" : true}, "flags" : { "charge_market_fee" : false, "white_list" : false, "override_authority" : false, "transfer_restricted" : false, "disable_force_settle" : false, "global_settle" : false, "disable_confidential" : false, "witness_fed_asset" : false, "committee_fed_asset" : false}, "core_exchange_rate" : {"base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399, "asset_id": "1.3.1"} }, "whitelist_authorities" : [], "blacklist_authorities" : [], "whitelist_markets" : [], "blacklist_markets" : [], "description" : "My fancy description"} {} false
I then get:
create_asset bitspace-testcorp1 TESTBITTEST 5 { "max_supply" : 10000, "market_fee_percent" : 1, "max_market_fee" : 1000, "issuer_permissions" : { "charge_market_fee" : true, "white_list" : true, "override_authority" : true, "transfer_restricted" : true, "disable_force_settle" : true, "global_settle" : true, "disable_confidential" : true, "witness_fed_asset" : true, "committee_fed_asset" : true}, "flags" : { "charge_market_fee" : false, "white_list" : false, "override_authority" : false, "transfer_restricted" : false, "disable_force_settle" : false, "global_settle" : false, "disable_confidential" : false, "witness_fed_asset" : false, "committee_fed_asset" : false}, "core_exchange_rate" : {"base": { "amount": 21, "asset_id": "1.3.0"},"quote": { "amount": 76399, "asset_id": "1.3.1"} }, "whitelist_authorities" : [], "blacklist_authorities" : [], "whitelist_markets" : [], "blacklist_markets" : [], "description" : "My fancy description"} {} false
7 bad_cast_exception: Bad Cast
Invalid cast from object_type to uint64
{"type":"object_type"}
th_a variant.cpp:403 as_uint64
{"*this":{"charge_market_fee":true,"white_list":true,"override_authority":true,"transfer_restricted":true,"disable_force_settle":true,"global_settle":true,"disable_confidential":true,"witness_fed_asset":true,"committee_fed_asset":true}}
th_a variant.cpp:405 as_uint64
-
The flags and permissions are bit fields, not structs.
-
What would be a valid create_asset command? I'm afraid I don't really understand the syntax.
-
See here for an example (but note that it's for an MPA, not a UIA): https://bitsharestalk.org/index.php/topic,24322.msg311164.html#msg311164