Author Topic: Manually creating UIA through cli_wallet  (Read 2703 times)

0 Members and 1 Guest are viewing this topic.

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline torkelrogstad

  • Newbie
  • *
  • Posts: 3
    • View Profile
What would be a valid create_asset command? I'm afraid I don't really understand the syntax.

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
The flags and permissions are bit fields, not structs.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline torkelrogstad

  • Newbie
  • *
  • Posts: 3
    • View Profile
I removed all possible sources of trailing characters and replaced them with spaces. I now get the following error:

Code: [Select]
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:
Code: [Select]
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:

Code: [Select]
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

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
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.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline torkelrogstad

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hi!

I'm having trouble creating a UIA through the CLI.

Running

Code: [Select]
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

Code: [Select]
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 doesn't work, and when using the API found on 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.