Multichain private blockchain network in Interactive Mode

Sourabhh Sethii
DXSYS
Published in
5 min readJul 1, 2018

Let’s explore Interactive mode for chain1 on both nodes.

multichain-cli chain1root@mutichain-instance-1:/usr/local/bin# multichain-cli chain1

MultiChain Core RPC client build 1.0 alpha 26 protocol 10006


Interactive mode

chain1: help
{"method":"help","params":[],"id":1,"chain_name":"chain1"}

== Blockchain ==
getbestblockhash
getblock hash|height ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getchaintips
getdifficulty
getmempoolinfo
getrawmempool ( verbose )
gettxout txid n ( includemempool )
gettxoutsetinfo
listassets (asset-identifier(s) verbose count start )
listpermissions ("permission(s)" "address(es)" verbose )
liststreams (stream-identifier(s) verbose count start )
verifychain ( checklevel numblocks )

== Control ==
clearmempool
getblockchainparams ( displaynames )
getinfo
help ( command )
pause "task(s)"
resume "task(s)"
setlastblock hash|height
stop

== Generating ==
getgenerate
gethashespersec
setgenerate generate ( genproclimit )

== Mining ==
getblocktemplate ( "jsonrequestobject" )
getmininginfo
getnetworkhashps ( blocks height )
prioritisetransaction txid priority-delta fee-delta
submitblock hexdata ( "jsonparametersobject" )

== Network ==
addnode "node" add|remove|onetry
getaddednodeinfo dns ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
ping

== Rawtransactions ==
appendrawchange tx-hex address ( native-fee )
appendrawdata tx-hex data-hex|object
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...} ( [data] action )
decoderawtransaction tx-hex
decodescript script-hex
getrawtransaction txid ( verbose )
sendrawtransaction tx-hex ( allowhighfees )
signrawtransaction tx-hex ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )

== Util ==
createkeypairs ( count )
createmultisig nrequired ["key",...]
estimatefee nblocks
estimatepriority nblocks
validateaddress address
verifymessage address signature "message"

== Wallet ==
addmultisigaddress nrequired ["key",...] ( "account" )
appendrawexchange hex txid vout ask-assets
backupwallet "destination"
combineunspent ( "address(es)" minconf maxcombines mininputs maxinputs maxtime )
create stream "stream-name" open ( custom-fields )
createfrom from-address stream "stream-name" open ( custom-fields )
createrawexchange txid vout ask-assets
createrawsendfrom from-address {"address":amount,...} ( [data] action )
decoderawexchange tx-hex ( verbose )
disablerawtransaction tx-hex
dumpprivkey address
dumpwallet "filename"
encryptwallet "passphrase"
getaccount address
getaccountaddress "account"
getaddressbalances address ( minconf includeLocked )
getaddresses ( verbose )
getaddressesbyaccount "account"
getaddresstransaction address txid ( verbose )
getassetbalances ( "account" minconf includeWatchonly includeLocked )
getassettransaction "asset-identifier" txid ( verbose )
getbalance ( "account" minconf includeWatchonly )
getmultibalances ( "address(es)" assets minconf includeLocked includeWatchonly )
getnewaddress ( "account" )
getrawchangeaddress
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress address ( minconf )
getstreamitem "stream-identifier" txid ( verbose )
gettotalbalances ( minconf includeWatchonly includeLocked )
gettransaction txid ( includeWatchonly )
gettxoutdata txid n ( count-bytes start-byte )
getunconfirmedbalance
getwalletinfo
getwallettransaction txid ( includeWatchonly verbose )
grant "address(es)" "permission(s)" ( native-amount "comment" "comment-to" startblock endblock )
grantfrom from-address "to-address(es)" "permission(s)" ( native-amount "comment" "comment-to" startblock endblock )
grantwithdata "address(es)" "permission(s)" data-hex|object ( native-amount startblock endblock )
grantwithdatafrom from-address "to-address(es)" "permission(s)" data-hex|object ( native-amount startblock endblock )
importaddress address(es) ( "label" rescan )
importprivkey privkey(s) ( "label" rescan )
importwallet "filename"
issue address "asset-name"|asset-params quantity ( smallest-unit native-amount custom-fields )
issuefrom from-address to-address "asset-name"|asset-params quantity ( smallest-unit native-amount custom-fields )
issuemore address "asset-identifier" quantity ( native-amount custom-fields )
issuemorefrom from-address to-address "asset-identifier" quantity ( native-amount custom-fields )
keypoolrefill ( newsize )
listaccounts ( minconf includeWatchonly)
listaddresses (address(es) verbose count start )
listaddressgroupings
listaddresstransactions address ( count skip verbose )
listassettransactions "asset-identifier" ( verbose count start local-ordering )
listlockunspent
listreceivedbyaccount ( minconf includeempty includeWatchonly )
listreceivedbyaddress ( minconf includeempty includeWatchonly )
listsinceblock ( blockhash target-confirmations includeWatchonly )
liststreamitems "stream-identifier" ( verbose count start local-ordering )
liststreamkeyitems "stream-identifier" "key" ( verbose count start local-ordering )
liststreamkeys "stream-identifier" ( key(s) verbose count start local-ordering )
liststreampublisheritems "stream-identifier" address ( verbose count start local-ordering )
liststreampublishers "stream-identifier" ( address(es) verbose count start local-ordering )
listtransactions ( "account" count from includeWatchonly )
listunspent ( minconf maxconf ["address",...] )
listwallettransactions ( count skip includeWatchonly verbose )
lockunspent unlock [{"txid":"txid","vout":n},...]
move "fromaccount" "toaccount" amount ( minconf "comment" )
preparelockunspent asset-quantities ( lock )
preparelockunspentfrom from-address asset-quantities ( lock )
publish "stream-identifier" "key" data-hex
publishfrom from-address "stream-identifier" "key" data-hex
resendwallettransactions
revoke "address(es)" "permission(s)" ( native-amount "comment" "comment-to" )
revokefrom from-address "to-address(es)" "permission(s)" ( native-amount "comment" "comment-to" )
send address amount|asset-quantities ( "comment" "comment-to" )
sendasset address "asset-identifier" asset-qty ( native-amount "comment" "comment-to" )
sendassetfrom from-address to-address "asset-identifier" asset-qty ( native-amount "comment" "comment-to" )
sendfrom from-address to-address amount|asset-quantities ( "comment" "comment-to" )
sendfromaccount "fromaccount" toaddress amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" )
sendwithdata address amount|asset-quantities data-hex|object
sendwithdatafrom from-address to-address amount|asset-quantities data-hex|object
setaccount address "account"
settxfee amount
signmessage address "message"
subscribe entity-identifier(s) ( rescan )
unsubscribe entity-identifier(s)
chain1:
chain1: getblockcount
{"method":"getblockcount","params":[],"id":1,"chain_name":"chain1"}

6152
chain1:
chain1: getchaintips
{"method":"getchaintips","params":[],"id":1,"chain_name":"chain1"}

[
{
"height" : 6174,
"hash" : "0000f9a0096d0387fa1065436ca6bf9d1d34522468bd54406b69bec690a045c5",
"branchlen" : 0,
"status" : "active"
}
]
chain1:
chain1: listpermissions
{"method":"listpermissions","params":[],"id":1,"chain_name":"chain1"}

[
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "mine",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "admin",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "activate",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "connect",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "send",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "receive",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "issue",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "create",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16parmbaW4w2AqJK1rii8H2GtVoPhXh1fJhW8S",
"for" : null,
"type" : "connect",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16parmbaW4w2AqJK1rii8H2GtVoPhXh1fJhW8S",
"for" : null,
"type" : "send",
"startblock" : 0,
"endblock" : 4294967295
},
{
"address" : "16parmbaW4w2AqJK1rii8H2GtVoPhXh1fJhW8S",
"for" : null,
"type" : "receive",
"startblock" : 0,
"endblock" : 4294967295
}
]
chain1:

Let’s explore further and create new asset and send it to nodes. On the first instance, get the address that has the permission to create assets:

chain1: listpermissions issue
{"method":"listpermissions","params":["issue"],"id":1,"chain_name":"chain1"}

[
{
"address" : "16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK",
"for" : null,
"type" : "issue",
"startblock" : 0,
"endblock" : 4294967295
}
]
chain1:

Now we would create a new asset on node 1 with 8000 units have 200 parts.

chain1: issue 16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK asset1 8000 0.02
{"method":"issue","params":["16DxLfofGLdSyMtQ9YMxCYTnPcFGYhxgNpvHsK","asset1",8000,0.02000000],"id":1,"chain_name":"chain1"}

8c10d13970b9dfe116df40f100d47955e693509a1ac64522901d72fc4a3c1798
chain1:

List Asesst on node 1.

chain1: listassets
{"method":"listassets","params":[],"id":1,"chain_name":"chain1"}

[
{
"name" : "asset1",
"issuetxid" : "8c10d13970b9dfe116df40f100d47955e693509a1ac64522901d72fc4a3c1798",
"assetref" : "6235-266-4236",
"multiple" : 50,
"units" : 0.02000000,
"open" : false,
"details" : {
},
"issueqty" : 8000.00000000,
"issueraw" : 400000,
"subscribed" : false
}
]
chain1:

Gettotalinfo.

chain1: gettotalbalances
{"method":"gettotalbalances","params":[],"id":1,"chain_name":"chain1"}

[
{
"name" : "asset1",
"assetref" : "6235-266-4236",
"qty" : 8000.00000000
}
]
chain1:

Conclusion : One has gone through the interactive mode and various available commands to explore block-chain, one has explored the way to create asset on the chain1, Mutichain blockchain network.

--

--

Sourabhh Sethii
DXSYS
Editor for

I am an author of Building Digital Experience Platform and I am passionate about emerging technologies. https://sourabhhsethii.com/