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
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?
...