Issuing an Asset for reissue

0 votes

I've been trying to issue an asset on the latest alpha-19 version of multi chain for re-issue and getting the following error:

 issue 14j1k337VfvQF9ZTAxwaD96Ve43WUUqfjx '{"name":"asset1","open":true}' 10000

{"method":"issue","params":["14j1k337VfvQF9ZTAxwaD96Ve43WUUqfjx",{"name":"asset1","open":true},10000],"id":1,"chain_name":"test-chain"}

error code: -8
error message:
Asset name should be string

 

I just can't see what's wrong with that??

 

Marty

asked Apr 22, 2016 by Marty
What happens with this on the latest alpha 20?
Yes, it's working as expected.  The issue may not have been in the alpha-19 build at all......  

My build drops in a custom params.dat file for some tweaks to the default behaviour, and this had the protocol version pegged at 10003.  Changing this to 10005 sorted the issue.

Apologies for the red-herring

Marty
Great, thanks for the update!

1 Answer

0 votes

Is it possible that you are using an older version of MultiChain for the multichaind daemon without realising it? You can look at the version field of the response to getinfo to make sure.

answered Apr 22, 2016 by MultiChain
no, it looks K.....infact I went and rebuilt the docker containers just to be sure.......here's the response from getinfo:

{
    "version" : "1.0 alpha 19",
    "protocolversion" : 10003,
    "chainname" : "test-chain",
    "description" : "MultiChain test-chain",
    "protocol" : "multichain",
    "port" : 4791,
    "setupblocks" : 60,
    "nodeaddress" : "test-chain@172.19.0.2:4791",
    "burnaddress" : "1XXXXXXXXXXXXXXXXXXXXXXXXXXYd6Aru",
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 342,
    "timeoffset" : 0,
    "connections" : 3,
    "proxy" : "",
    "difficulty" : 0.00001526,
    "testnet" : false,
    "keypoololdest" : 1461330806,
    "keypoolsize" : 2,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00000000,
    "errors" : ""
}
OK. Did you ever have an older version of MultiChain installed?
yea......loads :)

But when I upgrade I generate a new docker image with your new tar, so it shouldn't be picking up and older version as it's not part of the image build.
What happens if you run this in full on the command line:

multichain-cli [your chain name] issue 14j1k337VfvQF9ZTAxwaD96Ve43WUUqfjx '{"name":"asset1","open":true}' 10000
Same response

error code: -8
error message:
Asset name should be string
And if you just run multichain-cli with no parameters, the output version is also alpha 19?
Weirdly, I dropped the multichain version down to multichain-1.0-alpha-18.tar.gz  and it now works, but now I can't do a re-issue?
Went back to 19 build and it breaks again with the -8 error code.

As an aside.......I tried issuing the asset using raw transactions following the instructions on this page:

http://www.multichain.com/developers/raw-transactions/

On the alpha-19 version this creates the asset, but even though you pass in open:true as detailed on the page:

appendrawmetadata [paste-hex-blob] '{"name":"asset7","multiple":10,"open":true,"details":{"origin":"uk","stage":"one"}}'

The asset gets created with open set to false which explains why you can't then issue more assets.

One other point, when you issue a transaction this way, you get an exception in the explorer that I captured below:

mutlichain-explorer_1 | Failed to catch up {'blkfile_offset': 804, 'blkfile_number': 100000, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/root/.multichain/test-chain', 'id': 1}
mutlichain-explorer_1 | Traceback (most recent call last):
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2825, in catch_up
mutlichain-explorer_1 |     if not store.catch_up_rpc(dircfg):
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 3057, in catch_up_rpc
mutlichain-explorer_1 |     store.import_block(block, chain = chain)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 1177, in import_block
mutlichain-explorer_1 |     tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0, chain)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 2153, in import_and_commit_tx
mutlichain-explorer_1 |     tx_id = store.import_tx(tx, is_coinbase, chain)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 1965, in import_tx
mutlichain-explorer_1 |     (new_asset_id, tx_id, chain.id, store.binin(""), 0, val, prefix ))
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/DataStore.py", line 247, in sql
mutlichain-explorer_1 |     store._sql.sql(stmt, params)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/SqlAbstraction.py", line 426, in sql
mutlichain-explorer_1 |     sql._execute(cached, params)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/SqlAbstraction.py", line 407, in _execute
mutlichain-explorer_1 |     sql.cursor().execute(stmt, params)
mutlichain-explorer_1 | IntegrityError: UNIQUE constraint failed: asset.tx_id
mutlichain-explorer_1 | Traceback (most recent call last):
mutlichain-explorer_1 |   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
mutlichain-explorer_1 |     self.result = application(self.environ, self.start_response)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/abe.py", line 306, in __call__
mutlichain-explorer_1 |     handler(page)
mutlichain-explorer_1 |   File "/usr/local/lib/python2.7/dist-packages/Mce/abe.py", line 1625, in handle_assetref
mutlichain-explorer_1 |     address_from = issuetx['vout'][2]['scriptPubKey']['addresses'][0]
mutlichain-explorer_1 | KeyError: 'addresses'

This results is the asset being listed in the explorer but with no holdings.  The explorer crashes if you try to click through on the asset link.

Marty
Hi, what does the JSON output for the asset look like?
multichain-cli [chain name] listassets asset7
I had changed the name from asset7 to my-coin.  Here is the resultant json.

{
      "name": "my-coin",
      "issuetxid": "12ea84dcaa5493c0c0575671d75bd28bfe9a6975b28f7e1401a24ac52b49106e",
      "assetref": "1307-266-59922",
      "multiple": 1,
      "units": 1,
      "open": false,
      "details": {
        "issue-id": "1000000"
      },
      "issueqty": 3000,
      "issueraw": 3000
    }
Guys, have you had any further thoughts on this?
...