Skip to content

JSON RPC

MathxH Chen edited this page May 7, 2019 · 42 revisions

JSON-RPC Document

Introduction

This is the detailed FnFn JSON-RPC commands document, includes format, params, examples, errors and so on.

commands

System

  • help: List commands, or get help for a command.
  • stop: Stop multiverse server.
  • version: Get multiverse server version.

Network

  • getpeercount: Returns the number of connections to other nodes.
  • listpeer: Returns data about each connected network node.
  • addnode: Attempts add a node into the addnode list.
  • removenode: Attempts remove a node from the addnode list.

Worldline & TxPool

  • getforkcount: Returns the number of forks.
  • listfork: If true list of all forks, or subscribed forks
  • getgenealogy: Returns the list of ancestry and subline.
  • getblocklocation: Returns the location with given block.
  • getblockcount: Returns the number of blocks in the given fork, includes extended block and vacant block
  • getblockhash: Returns a list of block hash in fork at specific height.
  • getblock: Returns details of a block with given block-hash.
  • gettxpool: Get transaction pool info
  • gettransaction: Get transaction info
  • sendtransaction: Submits raw transaction (serialized, hex-encoded) to local node and network.
  • getforkheight: Returns the number of height in the given fork.

Wallet

Util

Mint


help

Usage:

        help ("command")

List commands, or get help for a command.

Arguments:

 "command"                              (string, optional) command name

Request:

 "param" :
 {
   "command": ""                        (string, optional) command name
 }

Response:

 "result": "help"                       (string, required) help info

Examples:

>> multiverse-cli help

>> multiverse-cli help getpeercount

Errors:

	none

stop

Usage:

        stop

Stop multiverse server.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result": "result"                     (string, required) stop result

Examples:

>> multiverse-cli stop
<< multiverse server stopping

>> curl -d '{"id":1,"method":"stop","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":"multiverse server stopping"}

Errors:

	none

version

Usage:

        version

Get multiverse server version.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result": "version"                    (string, required) multiverse version

Examples:

>> multiverse-cli version
<< Multiverse server version is v0.1.0

>> curl -d '{"id":0,"method":"version","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":0,"jsonrpc":"2.0","result":"Multiverse server version is v0.1.0"}

Errors:

	none

getpeercount

Usage:

        getpeercount

Returns the number of connections to other nodes.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result": count                        (int, required) peer count

Examples:

>> multiverse-cli getpeercount
<< 0

>> curl -d '{"id":3,"method":"getpeercount","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":3,"jsonrpc":"2.0","result":0}

Errors:

	none

listpeer

Usage:

        listpeer

Returns data about each connected network node.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result" :
   [
     "peer":                            (object, required) 
     {
       "address": "",                   (string, required) peer address
       "services": "",                  (string, required) service
       "lastsend": 0,                   (int, required) last send time
       "lastrecv": 0,                   (int, required) last receive time
       "conntime": 0,                   (int, required) active time
       "version": "",                   (string, required) version
       "subver": "",                    (string, required) sub version
       "inbound": true|false,           (bool, required) accept multiple connection or not
       "height": 0,                     (int, required) starting height
       "banscore": 0                    (int, required) ban score
     }
   ]

Examples:

>> multiverse-cli listpeer
<< [{"address":"113.105.146.22","services":"0000000000000001","lastsend":1538113861,"lastrecv":1538113861,"conntime":1538113661,"version":"0.1.0","subver":"/Multiverse:0.1.0/Protocol:0.1.0/","inbound":false,"height":31028,"banscore":true}]

>> curl -d '{"id":40,"method":"listpeer","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":40,"jsonrpc":"2.0","result":[{"address":"113.105.146.22","services":"0000000000000001","lastsend":1538113861,"lastrecv":1538113861,"conntime":1538113661,"version":"0.1.0","subver":"/Multiverse:0.1.0/Protocol:0.1.0/","inbound":false,"height":31028,"banscore":true}]}

Errors:

	none

addnode

Usage:

        addnode <"node">

Attempts add a node into the addnode list.

Arguments:

 "node"                                 (string, required) node host:port

Request:

 "param" :
 {
   "node": ""                           (string, required) node host:port
 }

Response:

 "result": "result"                     (string, required) add node result

Examples:

>> multiverse-cli addnode 113.105.146.22
<< Add node successfully: 113.105.146.22

>> curl -d '{"id":3,"method":"addnode","jsonrpc":"2.0","params":{"node":"113.105.146.22:6811"}}' http://127.0.0.1:6812
<< {"id":3,"jsonrpc":"2.0","result":"Add node successfully: 113.105.146.22:6811"}

Errors:

* {"code":-206,"message":"Failed to add node."}

removenode

Usage:

        removenode <"node">

Attempts remove a node from the addnode list.

Arguments:

 "node"                                 (string, required) node host:port

Request:

 "param" :
 {
   "node": ""                           (string, required) node host:port
 }

Response:

 "result": "result"                     (string, required) remove node result

Examples:

>> multiverse-cli removenode 113.105.146.22
<< Remove node successfully: 113.105.146.22

>> curl -d '{"id":67,"method":"removenode","jsonrpc":"2.0","params":{"node":"113.105.146.22:6811"}}' http://127.0.0.1:6812
<< {"id":67,"jsonrpc":"2.0","result":"Remove node successfully: 113.105.146.22:6811"}

Errors:

* {"code":-206,"message":"Failed to remove node."}

getforkcount

Usage:

        getforkcount

Returns the number of forks.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result": count                        (int, required) fork count

Examples:

>> multiverse-cli getforkcount
<< 1

>> curl -d '{"id":69,"method":"getforkcount","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":69,"jsonrpc":"2.0","result":1}

Errors:

	none

listfork

Usage:

        listfork (-a|-noa*all*)

If true list of all forks, or subscribed forks

Arguments:

 -a|-noa*all*                           (bool, optional, default=false) list all forks or not

Request:

 "param" :
 {
   "all": true|false                    (bool, optional, default=false) list all forks or not
 }

Response:

 "result" :
   [
     "profile":                         (object, required) fork profile info
     {
       "fork": "",                      (string, required) fork id with hex system
       "name": "",                      (string, required) fork name
       "symbol": "",                    (string, required) fork symbol
       "isolated": true|false,          (bool, required) is isolated
       "private": true|false,           (bool, required) is private
       "enclosed": true|false,          (bool, required) is enclosed
       "owner": ""                      (string, required) owner's address
     }
   ]

Examples:

>> multiverse-cli listfork
<< 1

>> {"id":69,"method":"listfork","jsonrpc":"2.0","params":{}}
<< {"id":69,"jsonrpc":"2.0","result":[{"fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","name":"Fission And Fusion Network","symbol":"FnFn","isolated":true,"private":false,"enclosed":false,"owner":"1mjw7aa0s7v9sv7x3thvcexxzjz4tq82j5qc12dy29ktqy84haa0j7dwb"}]}

Errors:

	none

getgenealogy

Usage:

        getgenealogy (-f="fork")

Returns the list of ancestry and subline.

Arguments:

 -f="fork"                              (string, optional) fork hash

Request:

 "param" :
 {
   "fork": ""                           (string, optional) fork hash
 }

Response:

 "result" :
 {
   [
     "ancestry":                        (object, required) ancestry
     {
       "parent": "",                    (string, required) parent fork hash
       "height": 0                      (int, required) parent origin height
     }
   ]
   [
     "subline":                         (object, required) subline
     {
       "sub": "",                       (string, required) sub fork hash
       "height": 0                      (int, required) sub origin height
     }
   ]
 }

Examples:

>> multiverse-cli getgenealogy
<< {"ancestry":[],"subline":[]}

>> curl -d '{"id":75,"method":"getgenealogy","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":75,"jsonrpc":"2.0","result":{"ancestry":[],"subline":[]}}

>> multiverse-cli getgenealogy 1
<< {"code":-6,"message":"Unknown fork"}

>> curl -d '{"id":1,"method":"getgenealogy","jsonrpc":"2.0","params":{"fork":"1"}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","error":{"code":-6,"message":"Unknown fork"}}

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}

getblocklocation

Usage:

        getblocklocation <"block">

Returns the location with given block.

Arguments:

 "block"                                (string, required) block hash

Request:

 "param" :
 {
   "block": ""                          (string, required) block hash
 }

Response:

 "result" :
 {
   "fork": "",                          (string, required) fork hash
   "height": 0                          (int, required) block height
 }

Examples:

>> multiverse-cli getblocklocation 609a797ca28042d562b11355038c516d65ba30b91c7033d83c61b81aa8c538e3
<< {"fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","height":1}

>> curl -d '{"id":6,"method":"getblocklocation","jsonrpc":"2.0","params":{"block":"609a797ca28042d562b11355038c516d65ba30b91c7033d83c61b81aa8c538e3"}}' http://127.0.0.1:6812
<< {"id":6,"jsonrpc":"2.0","result":{"fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","height":1}}

Errors:

* {"code":-6,"message":"Unknown block."}

getblockcount

Usage:

        getblockcount (-f="fork")

Returns the number of blocks in the given fork, includes extended block and vacant block

Arguments:

 -f="fork"                              (string, optional) fork hash

Request:

 "param" :
 {
   "fork": ""                           (string, optional) fork hash
 }

Response:

 "result": count                        (int, required) block count

Examples:

>> multiverse-cli getblockcount
<< 32081

>> curl -d '{"id":4,"method":"getblockcount","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":4,"jsonrpc":"2.0","result":32081}

>> multiverse-cli getblockcount -f=a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0
<< 32081

>> curl -d '{"id":5,"method":"getblockcount","jsonrpc":"2.0","params":{"fork":"0"}}' http://127.0.0.1:6812
<< {"id":5,"jsonrpc":"2.0","result":32081}

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}

getblockhash

Usage:

        getblockhash <height> (-f="fork")

Returns a list of block hash in fork at specific height.
First of the list is the main block hash, others are extended blocks hash in order.

Arguments:

 height                                 (int, required) block height
 -f="fork"                              (string, optional) fork hash

Request:

 "param" :
 {
   "height": 0,                         (int, required) block height
   "fork": ""                           (string, optional) fork hash
 }

Response:

 "result" :
   [
     "hash": ""                         (string, required) one block hash
   ]

Examples:

>> multiverse-cli getblockhash 0
<< ["a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"]

>> curl -d '{"id":37,"method":"getblockhash","jsonrpc":"2.0","params":{"height":0}}' http://127.0.0.1:6812
<< {"id":37,"jsonrpc":"2.0","result":["a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"]}

>> multiverse-cli getblockhash 0 -f=a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}
* {"code":-6,"message":"Block number out of range."}

getblock

Usage:

        getblock <"block">

Returns details of a block with given block-hash.

Arguments:

 "block"                                (string, required) block hash

Request:

 "param" :
 {
   "block": ""                          (string, required) block hash
 }

Response:

 "result" :
 {
   "hash": "",                          (string, required) block hash
   "version": 0,                        (uint, required) version
   "type": "",                          (string, required) block type
   "time": 0,                           (uint, required) block time
   "fork": "",                          (string, required) fork hash
   "height": 0,                         (uint, required) block height
   "txmint": "",                        (string, required) transaction mint hash
   [
     "tx": ""                           (string, required) transaction hash
   ]
   "prev": ""                           (string, optional) previous block hash
 }

Examples:

>> multiverse-cli getblock ca49b8d07ac2849c455a813dd967bb0b306b48406d787259f4ddb8f6a0e0cf4c
<< {"hash":"ca49b8d07ac2849c455a813dd967bb0b306b48406d787259f4ddb8f6a0e0cf4c","version":1,"type":"primary-pow","time":1538138566,"prev":"47b86e794e7ce0546def4fe3603d58d9cc9fc87eeee676bd15ae90e45ab51f8a","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","height":31296,"txmint":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","tx":[]}

>> curl -d '{"id":10,"method":"getblock","jsonrpc":"2.0","params":{"block":"ca49b8d07ac2849c455a813dd967bb0b306b48406d787259f4ddb8f6a0e0cf4c"}}' http://127.0.0.1:6812
<< {"id":10,"jsonrpc":"2.0","result":{"hash":"ca49b8d07ac2849c455a813dd967bb0b306b48406d787259f4ddb8f6a0e0cf4c","version":1,"type":"primary-pow","time":1538138566,"prev":"47b86e794e7ce0546def4fe3603d58d9cc9fc87eeee676bd15ae90e45ab51f8a","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","height":31296,"txmint":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","tx":[]}}

Errors:

* {"code":-6,"message":"Unknown block."}

gettxpool

Usage:

        gettxpool (-f="fork") (-d|-nod*detail*)

If detail==0, returns the count and total size of txs for given fork.
Otherwise,returns all transaction ids and sizes in memory pool for given fork.

Arguments:

 -f="fork"                              (string, optional) fork hash
 -d|-nod*detail*                        (bool, optional, default=false) get detail or not

Request:

 "param" :
 {
   "fork": "",                          (string, optional) fork hash
   "detail": true|false                 (bool, optional, default=false) get detail or not
 }

Response:

 "result" :
 {
   (if detail=false)
   "count": 0,                          (uint, optional) transaction pool count
   (if detail=false)
   "size": 0,                           (uint, optional) transaction total size
   (if detail=true)
   [
     "pool":                            (object, required) pool struct
     {
       "hex": "",                       (string, required) tx pool hex
       "size": 0                        (uint, required) tx pool size
     }
   ]
 }

Examples:

>> multiverse-cli gettxpool
<< {"count":0,"size":0}

>> curl -d '{"id":11,"method":"gettxpool","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":11,"jsonrpc":"2.0","result":{"count":0,"size":0}}

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}

gettransaction

Usage:

        gettransaction <"txid"> (-s|-nos*serialized*)

Get transaction info

Arguments:

 "txid"                                 (string, required) transaction hash
 -s|-nos*serialized*                    (bool, optional, default=false) If serialized=0, returns an Object with information about <txid>.
                                        If serialized is non-zero, returns a string that is
                                        serialized, hex-encoded data for <txid>.

Request:

 "param" :
 {
   "txid": "",                          (string, required) transaction hash
   "serialized": true|false             (bool, optional, default=false) If serialized=0, returns an Object with information about <txid>.
                                        If serialized is non-zero, returns a string that is
                                        serialized, hex-encoded data for <txid>.
 }

Response:

 "result" :
 {
   (if serialized=true)
   "serialization": "",                 (string, optional) transaction hex data
   (if serialized=false)
   "transaction":                       (object, optional) transaction data
   {
     "txid": "",                        (string, required) transaction hash
     "version": 0,                      (uint, required) version
     "type": "",                        (string, required) transaction type
     "lockuntil": 0,                    (uint, required) unlock time
     "anchor": "",                      (string, required) anchor hash
     [
       "vin":                           (object, required) vin struct
       {
         "txid": "",                    (string, required) pre-vout transaction hash
         "vout": 0                      (uint, required) pre-vout number
       }
     ]
     "sendto": "",                      (string, required) send to address
     "amount": 0.0,                     (double, required) amount
     "txfee": 0.0,                      (double, required) transaction fee
     "data": "",                        (string, required) data
     "sig": "",                         (string, required) sign
     "fork": "",                        (string, required) fork hash
     "confirmations": 0                 (int, optional) confirmations
   }
 }

Examples:

>> multiverse-cli gettransaction 3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29
<< {"transaction":{"txid":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","version":1,"type":"work","lockuntil":0,"anchor":"47b86e794e7ce0546def4fe3603d58d9cc9fc87eeee676bd15ae90e45ab51f8a","vin":[],"sendto":"20g00k7pe4krdbbxpn5swgbxc0w4a54w054stt1z107d9n3sk6q7js9gw","amount":15.00000000,"txfee":0.00000000,"data":"","sig":"","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","confirmations":785}}

>> curl -d '{"id":13,"method":"gettransaction","jsonrpc":"2.0","params":{"txid":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","serialized":false}}' http://127.0.0.1:6812
<< {"id":13,"jsonrpc":"2.0","result":{"transaction":{"txid":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","version":1,"type":"work","lockuntil":0,"anchor":"47b86e794e7ce0546def4fe3603d58d9cc9fc87eeee676bd15ae90e45ab51f8a","vin":[],"sendto":"20g00k7pe4krdbbxpn5swgbxc0w4a54w054stt1z107d9n3sk6q7js9gw","amount":15.00000000,"txfee":0.00000000,"data":"","sig":"","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","confirmations":785}}}

>> multiverse-cli gettransaction -s 3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29
<< {"serialization":"01000003000000008a1fb55ae490ae15bd76e6ee7ec89fccd9583d60e34fef6d54e07c4e796eb84700020400099ece24f0d5afb6a973c82fac0708a293802933ad07e101da9a8f3335cfc0e1e4000000000000000000000000000000"}

>> curl -d '{"id":13,"method":"gettransaction","jsonrpc":"2.0","params":{"txid":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","serialized":false}}' http://127.0.0.1:6812
<< {"id":14,"method":"gettransaction","jsonrpc":"2.0","params":{"txid":"3d4ed629c594b924d72480e29a332ca91915be685c85940a8c501f8248269e29","serialized":true}}

Errors:

* {"code":-6,"message":"No information available about transaction."}

sendtransaction

Usage:

        sendtransaction <"txdata">

Submits raw transaction (serialized, hex-encoded) to local node and network.

Arguments:

 "txdata"                               (string, required) transaction binary data

Request:

 "param" :
 {
   "txdata": ""                         (string, required) transaction binary data
 }

Response:

 "result": "data"                       (string, required) transaction raw data

Examples:

>> multiverse-cli sendtransaction 01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a0860100000000000212348182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e0182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052ed494d90cd96c252446b4a10459fea8c06186154b2bee2ce2182556e9ba40e7e69ddae2501862e4251bba2abf11c90d6f1fd0dec48a1419e81bb8c7d922cf3e03
<< 0a1b944071970589aa524a6f4e40e0b50bab9a64feefc292867692bbf35442a6

>> curl -d '{"id":9,"method":"sendtransaction","jsonrpc":"2.0","params":{"txdata":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a0860100000000000212348182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e0182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052ed494d90cd96c252446b4a10459fea8c06186154b2bee2ce2182556e9ba40e7e69ddae2501862e4251bba2abf11c90d6f1fd0dec48a1419e81bb8c7d922cf3e03"}}' http://127.0.0.1:6812
<< {"id":9,"jsonrpc":"2.0","result":"0a1b944071970589aa524a6f4e40e0b50bab9a64feefc292867692bbf35442a6"}

Errors:

* {"code":-8,"message":"TX decode failed"}
* {"code":-10,"message":"Tx rejected : xxx"}

getforkheight

Usage:

        getforkheight (-f="fork")

Returns the number of height in the given fork.

Arguments:

 -f="fork"                              (string, optional) fork hash

Request:

 "param" :
 {
   "fork": ""                           (string, optional) fork hash
 }

Response:

 "result": height                       (int, required) fork height

Examples:

>> multiverse-cli getforkheight
<< 32081

>> curl -d '{"id":4,"method":"getforkheight","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":4,"jsonrpc":"2.0","result":32081}

>> multiverse-cli getforkheight -f=a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}

listkey

Usage:

        listkey

Returns Object that has pubkey as keys, associated status as values.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result" :
   [
     "pubkey":                          (object, required) public key info
     {
       "key": "",                       (string, required) public key with hex system
       "version": 0,                    (int, required) public key version
       "locked": true|false,            (bool, required) public key locked
       "timeout": 0                     (int, optional) public key timeout locked
     }
   ]

Examples:

>> multiverse-cli listkey
<< [{"key":"3d266a564ec85f3385babf615b1d7eeb01b3e4456d35174732bb9ec0fa8c8f4f","version": 1,"locked": true},{"key":"58e148d9e8610a6504c26ed346d15920c4d832cf0f03ecb8a016e0d0ec838b1b","version": 1,"locked": true}]

>> curl -d '{"id":43,"method":"listkey","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":43,"jsonrpc":"2.0","result":[{"key":"3d266a564ec85f3385babf615b1d7eeb01b3e4456d35174732bb9ec0fa8c8f4f","version": 1,"locked": true},{"key":"58e148d9e8610a6504c26ed346d15920c4d832cf0f03ecb8a016e0d0ec838b1b","version": 1,"locked": true}]}

Errors:

	none

getnewkey

Usage:

        getnewkey <"passphrase">

Returns a new pubkey for receiving payments.

Arguments:

 "passphrase"                           (string, required) passphrase

Request:

 "param" :
 {
   "passphrase": ""                     (string, required) passphrase
 }

Response:

 "result": "pubkey"                     (string, required) public key

Examples:

>> multiverse-cli getnewkey 123
<< f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9

>> curl -d '{"id":7,"method":"getnewkey","jsonrpc":"2.0","params":{"passphrase":"123"}}' http://127.0.0.1:6812
<< {"id":7,"jsonrpc":"2.0","result":"f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9"}

Errors:

* {"code":-6,"message":"Passphrase must be nonempty"}
* {"code":-401,"message":"Failed add new key."}

encryptkey

Usage:

        encryptkey <"pubkey"> <-new="passphrase"> <-old="oldpassphrase">

Changes the passphrase for <oldpassphrase> to <passphrase>

Arguments:

 "pubkey"                               (string, required) public key
 -new="passphrase"                      (string, required) passphrase of key
 -old="oldpassphrase"                   (string, required) old passphrase of key

Request:

 "param" :
 {
   "pubkey": "",                        (string, required) public key
   "passphrase": "",                    (string, required) passphrase of key
   "oldpassphrase": ""                  (string, required) old passphrase of key
 }

Response:

 "result": "result"                     (string, required) encrypt key result

Examples:

>> encryptkey f4c3babec11363be80e7b6aa1d803d63206a11f36fc99b874b63a262110a0add -new=456 -old=123
<< Encrypt key successfully: f4c3babec11363be80e7b6aa1d803d63206a11f36fc99b874b63a262110a0add

>> curl -d '{"id":5,"method":"encryptkey","jsonrpc":"2.0","params":{"pubkey":"f4c3babec11363be80e7b6aa1d803d63206a11f36fc99b874b63a262110a0add","passphrase":"456","oldpassphrase":"123"}}' http://127.0.0.1:6812
<< {"id":5,"jsonrpc":"2.0","result":"Encrypt key successfully: f4c3babec11363be80e7b6aa1d803d63206a11f36fc99b874b63a262110a0add"}

>> multiverse-cli encryptkey f4c3babec11363be80e7b6aa1d803d63206a11f36fc99b874b63a262110a0add 456 123

Errors:

* {"code":-6,"message":"Passphrase must be nonempty"}
* {"code":-6,"message":"Old passphrase must be nonempty"}
* {"code":-4,"message":"Unknown key"}
* {"code":-406,"message":"The passphrase entered was incorrect."}

lockkey

Usage:

        lockkey <"pubkey">

Removes the encryption key from memory, locking the key.
After calling this method, you will need to call unlockkey again.
before being able to call any methods which require the key to be unlocked.

Arguments:

 "pubkey"                               (string, required) pubkey or pubkey address

Request:

 "param" :
 {
   "pubkey": ""                         (string, required) pubkey or pubkey address
 }

Response:

 "result": "result"                     (string, required) lock key result

Examples:

>> multiverse-cli lockkey 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882
<< Lock key successfully: 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882

>> curl -d '{"id":1,"method":"lockkey","jsonrpc":"2.0","params":{"pubkey":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882"}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":"Lock key successfully: 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882"}

>> multiverse-cli encryptkey 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882 456 123

Errors:

* {"code":-4,"message":"Unknown key"}
* {"code":-6,"message":"This method only accepts pubkey or pubkey address as parameter rather than template address you supplied."}
* {"code":-401,"message":"Failed to lock key"}

unlockkey

Usage:

        unlockkey <"pubkey"> <"passphrase"> (-t=timeout)

If (timeout) > 0,stores the wallet decryption key in memory for (timeout) seconds.
before being able to call any methods which require the key to be locked.

Arguments:

 "pubkey"                               (string, required) pubkey or pubkey address
 "passphrase"                           (string, required) passphrase
 -t=timeout                             (int, optional) auto unlock timeout

Request:

 "param" :
 {
   "pubkey": "",                        (string, required) pubkey or pubkey address
   "passphrase": "",                    (string, required) passphrase
   "timeout": 0                         (int, optional) auto unlock timeout
 }

Response:

 "result": "result"                     (string, required) unlock key result

Examples:

>> multiverse-cli unlockkey d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07 1234
<< Unlock key successfully: d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07

>> curl -d '{"id":13,"method":"unlockkey","jsonrpc":"2.0","params":{"pubkey":"d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07","passphrase":"1234"}}' http://127.0.0.1:6812
<< {"id":13,"jsonrpc":"2.0","result":"Unlock key successfully: d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07"}

>> multiverse-cli unlockkey f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9 123 10
<< Unlock key successfully: f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9

>> curl -d '{"id":15,"method":"unlockkey","jsonrpc":"2.0","params":{"pubkey":"f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9","passphrase":"123","timeout":10}}' http://127.0.0.1:6812
<< {"id":15,"jsonrpc":"2.0","result":"Unlock key successfully: f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9"}

Errors:

* {"code":-6,"message":"Passphrase must be nonempty"}
* {"code":-4,"message":"Unknown key"}
* {"code":-409,"message":"Key is already unlocked"}
* {"code":-406,"message":"The passphrase entered was incorrect."}

importprivkey

Usage:

        importprivkey <"privkey"> <"passphrase">

Adds a private key (as returned by dumpprivkey) to your wallet.

Arguments:

 "privkey"                              (string, required) private key
 "passphrase"                           (string, required) passphrase

Request:

 "param" :
 {
   "privkey": "",                       (string, required) private key
   "passphrase": ""                     (string, required) passphrase
 }

Response:

 "result": "pubkey"                     (string, required) public key with hex number system

Examples:

>> multiverse-cli importprivkey feb51e048380c0ade1cdb60b25e9f3e05cd4507553a97faadc8a94771fcb1a5b 123
<< d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07

>> curl -d '{"id":9,"method":"importprivkey","jsonrpc":"2.0","params":{"privkey":"feb51e048380c0ade1cdb60b25e9f3e05cd4507553a97faadc8a94771fcb1a5b","passphrase":"123"}}' http://127.0.0.1:6812
<< {"id":9,"jsonrpc":"2.0","result":"d716e72ce58e649a57d54751a7707e325b522497da3a69ae8301a2cbec391c07"}

Errors:

* {"code":-6,"message":"Invalid private key"}
* {"code":-6,"message":"Passphrase must be nonempty"}
* {"code":-4,"message":"Invalid private key"}
* {"code":-401,"message":"Already have key"}
* {"code":-401,"message":"Failed to add key"}
* {"code":-401,"message":"Failed to sync wallet tx"}

importkey

Usage:

        importkey <"pubkey">

Reveals the serialized key corresponding to <pubkey>.

Arguments:

 "pubkey"                               (string, required) public key data

Request:

 "param" :
 {
   "pubkey": ""                         (string, required) public key data
 }

Response:

 "result": "pubkey"                     (string, required) public key with hex number system

Examples:

>> multiverse-cli importkey 642e19a647f9f2b795b8edf97c849ab1866855c9ac6b59d4cf2d9e63d23639de010000002f63a31bed90496a03bb58269e77b98751aa902be47ecbf9ac3adef221cbdcf6ecfba5a9c86e92323fb5af7a2df3f805caaf5dd80caf630e5eb206f0
<< de3936d2639e2dcfd4596bacc9556886b19a847cf9edb895b7f2f947a6192e64

>> curl -d '{"id":3,"method":"importkey","jsonrpc":"2.0","params":{"pubkey":"642e19a647f9f2b795b8edf97c849ab1866855c9ac6b59d4cf2d9e63d23639de010000002f63a31bed90496a03bb58269e77b98751aa902be47ecbf9ac3adef221cbdcf6ecfba5a9c86e92323fb5af7a2df3f805caaf5dd80caf630e5eb206f0"}}' http://127.0.0.1:6812
<< {"id":3,"jsonrpc":"2.0","result":"de3936d2639e2dcfd4596bacc9556886b19a847cf9edb895b7f2f947a6192e64"}

Errors:

* {"code":-32602,"message":"Failed to verify serialized key"}
* {"code":-32602,"message":"Can't import the key with empty passphrase"}
* {"code":-401,"message":"Already have key"}
* {"code":-401,"message":"Failed to add key"}
* {"code":-401,"message":"Failed to sync wallet tx"}

exportkey

Usage:

        exportkey <"pubkey">

Reveals the serialized key corresponding to <pubkey>.

Arguments:

 "pubkey"                               (string, required) public key

Request:

 "param" :
 {
   "pubkey": ""                         (string, required) public key
 }

Response:

 "result": "pubkey"                     (string, required) public key with binary system

Examples:

>> multiverse-cli exportkey de3936d2639e2dcfd4596bacc9556886b19a847cf9edb895b7f2f947a6192e64
<< 642e19a647f9f2b795b8edf97c849ab1866855c9ac6b59d4cf2d9e63d23639de010000002f63a31bed90496a03bb58269e77b98751aa902be47ecbf9ac3adef221cbdcf6ecfba5a9c86e92323fb5af7a2df3f805caaf5dd80caf630e5eb206f0

>> curl -d '{"id":13,"method":"exportkey","jsonrpc":"2.0","params":{"pubkey":"de3936d2639e2dcfd4596bacc9556886b19a847cf9edb895b7f2f947a6192e64"}}' http://127.0.0.1:6812
<< {"id":13,"jsonrpc":"2.0","result":"642e19a647f9f2b795b8edf97c849ab1866855c9ac6b59d4cf2d9e63d23639de010000002f63a31bed90496a03bb58269e77b98751aa902be47ecbf9ac3adef221cbdcf6ecfba5a9c86e92323fb5af7a2df3f805caaf5dd80caf630e5eb206f0"}

Errors:

* {"code":-4,"message":"Unknown key"}
* {"code":-401,"message":"Failed to export key"}

addnewtemplate

Usage:

        addnewtemplate <"type"> <{delegate}>|<{fork}>|<{mint}>|<{multisig}>|<{weighted}>

Returns encoded address for the given template id.

Arguments:

 "type"                                 (string, required) template type
  (if type=delegate)
 {delegate}                             (object, required) a delegate template
  (if type=fork)
 {fork}                                 (object, required) a new fork template
  (if type=mint)
 {mint}                                 (object, required) a mint template
  (if type=multisig)
 {multisig}                             (object, required) a multiple sign template
  (if type=weighted)
 {weighted}                             (object, required) a weighted multiple sign template

Request:

 "param" :
 {
   "type": "",                          (string, required) template type
   (if type=delegate)
   "delegate":                          (object, required) a delegate template
   {
     "delegate": "",                    (string, required) delegate public key
     "owner": ""                        (string, required) owner address
   }
   (if type=fork)
   "fork":                              (object, required) a new fork template
   {
     "redeem": "",                      (string, required) redeem address
     "fork": ""                         (string, required) fork hash
   }
   (if type=mint)
   "mint":                              (object, required) a mint template
   {
     "mint": "",                        (string, required) mint public key
     "spent": ""                        (string, required) spent address
   }
   (if type=multisig)
   "multisig":                          (object, required) a multiple sign template
   {
     "required": 0,                     (int, required) required weight > 0
     "pubkeys": [                       (array, required) public keys
        "",
        ""                              (string, required) public key
     ]
   }
   (if type=weighted)
   "weighted":                          (object, required) a weighted multiple sign template
   {
     "required": 0,                     (int, required) required weight
      "pubkeys": [                      (array, required) public keys
       {                                (object, required) public key
         "key": "",                     (string, required) public key
         "weight": 0                    (int, required) weight
       }
     ]
   }
 }

Response:

 "result": "address"                    (string, required) address of template

Examples:

>> multiverse-cli addnewtemplate mint '{"mint": "e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9", "spent": "1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}'
<< 20g0b87qxcd52ceh9zmpzx0hy46pjfzdnqbkh8f4tqs4y0r6sxyzyny25

>> curl -d '{"id":1,"method":"addnewtemplate","jsonrpc":"2.0","params":{"type":"mint","mint":{"mint":"e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9","spent":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":"20g0b87qxcd52ceh9zmpzx0hy46pjfzdnqbkh8f4tqs4y0r6sxyzyny25"}

>> multiverse-cli addnewtemplate delegate '{"delegate":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","owner":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq"}'

>> multiverse-cli addnewtemplate fork '{"redeem":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"}'

>> multiverse-cli addnewtemplate multisig '{"required": 1, "pubkeys": ["2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882", "f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9"]}'

>> multiverse-cli addnewtemplate weighted '{"required": 1, "pubkeys": [{"key":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882", "weight": 1},{"key": "f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9", "weight": 2}]}'

Errors:

* {"code":-6,"message":"Invalid parameters,failed to make template"}
* {"code":-401,"message":"Failed to add template"}
* {"code":-6,"message":"Invalid parameter, missing weight"}
* {"code":-6,"message":"Invalid parameter, missing redeem address"}
* {"code":-6,"message":"Invalid parameter, missing spent address"}
* {"code":-6,"message":"Invalid parameter, missing owner address"}
* {"code":-6,"message":"template type error. type: xxx"}

importtemplate

Usage:

        importtemplate <"data">

Returns encoded address for the given template.

Arguments:

 "data"                                 (string, required) template data

Request:

 "param" :
 {
   "data": ""                           (string, required) template data
 }

Response:

 "result": "address"                    (string, required) address of template

Examples:

>> multiverse-cli importtemplate 0100010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e01b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f402
<< 21w2040000000000000000000000000000000000000000000000epcek

>> curl -d '{"id":52,"method":"importtemplate","jsonrpc":"2.0","params":{"data":"0100010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e01b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f402"}}' http://127.0.0.1:6812
<< {"id":52,"jsonrpc":"2.0","result":"21w2040000000000000000000000000000000000000000000000epcek"}

Errors:

* {"code":-6,"message":"Invalid parameters,failed to make template"}
* {"code":-401,"message":"Already have this template"}
* {"code":-401,"message":"Failed to add template"}
* {"code":-401,"message":"Failed to sync wallet tx"}

exporttemplate

Usage:

        exporttemplate <"address">

Returns encoded address for the given template.

Arguments:

 "address"                              (string, required) template address

Request:

 "param" :
 {
   "address": ""                        (string, required) template address
 }

Response:

 "result": "data"                       (string, required) data of template

Examples:

>> multiverse-cli exporttemplate 2040fpytdr4k5h8tk0nferr7zb51tkccrkgqf341s6tg05q9xe6hth1m
<< 0100010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e01b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f402

>> curl -d '{"id":25,"method":"exporttemplate","jsonrpc":"2.0","params":{"address":"2040fpytdr4k5h8tk0nferr7zb51tkccrkgqf341s6tg05q9xe6hth1m4"}}' http://127.0.0.1:6812
<< {"id":25,"jsonrpc":"2.0","result":"0100010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e01b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f402"}

Errors:

* {"code":-6,"message":"Invalid address"}
* {"code":-6,"message":"Invalid address, should be template address"}
* {"code":-401,"message":"Unkown template"}

validateaddress

Usage:

        validateaddress <"address">

Return information about <address>.

Arguments:

 "address"                              (string, required) wallet address

Request:

 "param" :
 {
   "address": ""                        (string, required) wallet address
 }

Response:

 "result" :
 {
   "isvalid": true|false,               (bool, required) is valid
   (if isvalid=true)
   "addressdata":                       (object, required) address data
   {
     "address": "",                     (string, required) wallet address
     "ismine": true|false,              (bool, required) is mine
     "type": "",                        (string, required) type, pubkey or template
     (if type=pubkey)
     "pubkey": "",                      (string, required) public key
     (if type=template)
     "template": "",                    (string, required) template type name
     (if type=template && ismine=true)
     "templatedata":                    (object, required) template data
     {
       "type": "",                      (string, required) template type
       "hex": "",                       (string, required) temtplate data
       (if type=delegate)
       "delegate":                      (object, required) delegate template struct
       {
         "delegate": "",                (string, required) delegate public key
         "owner": ""                    (string, required) owner address
       }
       (if type=fork)
       "fork":                          (object, required) fork template struct
       {
         "redeem": "",                  (string, required) redeem address
         "fork": ""                     (string, required) fork hash
       }
       (if type=mint)
       "mint":                          (object, required) mint template struct
       {
         "mint": "",                    (string, required) mint public key
         "spent": ""                    (string, required) spent address
       }
       (if type=multisig)
       "multisig":                      (object, required) multisig template struct
       {
         "sigsrequired": 0,             (int, required) required weight
         [
           "key": ""                    (string, required) public key
         ]
       }
       (if type=weighted)
       "weighted":                      (object, required) weighted template struct
       {
         "sigsrequired": 0,             (int, required) required weight
         [
           "pubkey":                    (object, required) public key
           {
             "key": "",                 (string, required) public key
             "weight": 0                (int, required) weight
           }
         ]
       }
     }
   }
 }

Examples:

>> multiverse-cli validateaddress 20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26
<< {"isvalid":true,"addressdata":{"address":"20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26","ismine":true,"type":"template","template":"mint"}}

>> curl -d '{"id":2,"method":"validateaddress","jsonrpc":"2.0","params":{"address":"20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26"}}' http://127.0.0.1:6812
<< {"id":2,"jsonrpc":"2.0","result":{"isvalid":true,"addressdata":{"address":"20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26","ismine":true,"type":"template","template":"mint"}}}

>> multiverse-cli validateaddress 123
<< {"isvalid":false}

>> curl -d '{"id":3,"method":"validateaddress","jsonrpc":"2.0","params":{"address":"123"}}' http://127.0.0.1:6812
<< {"id":3,"jsonrpc":"2.0","result":{"isvalid":false}}

Errors:

	none

resyncwallet

Usage:

        resyncwallet ("address")

If (address) is not specified, resync wallet's tx for each address.
If (address) is specified, resync wallet's tx for the address.

Arguments:

 "address"                              (string, optional) tx address

Request:

 "param" :
 {
   "address": ""                        (string, optional) tx address
 }

Response:

 "result": "result"                     (string, required) resync wallet result

Examples:

>> multiverse-cli resyncwallet
<< Resync wallet successfully.

>> curl -d '{"id":38,"method":"resyncwallet","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":38,"jsonrpc":"2.0","result":"Resync wallet successfully."}

>> multiverse-cli resyncwallet 1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq

Errors:

* {"code":-6,"message":"Invalid address"}
* {"code":-401,"message":"Failed to resync wallet tx"}

getbalance

Usage:

        getbalance (-f="fork") (-a="address")

Get balance of address.
If (address) is not specified, returns the balance for wallet's each address.
If (address) is specified, returns the balance in the address.

Arguments:

 -f="fork"                              (string, optional) fork hash
 -a="address"                           (string, optional) wallet address

Request:

 "param" :
 {
   "fork": "",                          (string, optional) fork hash
   "address": ""                        (string, optional) wallet address
 }

Response:

 "result" :
   [
     "balance":                         (object, required) balance info
     {
       "address": "",                   (string, required) wallet address
       "avail": 0.0,                    (double, required) balance available amount
       "locked": 0.0,                   (double, required) locked amount
       "unconfirmed": 0.0               (double, required) unconfirmed amount
     }
   ]

Examples:

>> multiverse-cli getbalance
<< [{"address":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","avail":30.00000000,"locked":0.00000000,"unconfirmed":0.00000000}]

>> curl -d '{"id":1,"method":"getbalance","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":[{"address":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","avail":30.00000000,"locked":0.00000000,"unconfirmed":0.00000000}]}

>> multiverse-cli getbalance -a=20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm
<< [{"address":"20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm","avail":58.99990000,"locked":0.00000000,"unconfirmed":13.99990000}]

>> curl -d '{"id":20,"method":"getbalance","jsonrpc":"2.0","params":{"address":"20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm"}}' http://127.0.0.1:6812
<< {"id":20,"jsonrpc":"2.0","result":[{"address":"20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm","avail":58.99990000,"locked":0.00000000,"unconfirmed":13.99990000}]}

Errors:

* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}
* {"code":-6,"message":"Invalid address"}

listtransaction

Usage:

        listtransaction (-n=count) (-o=offset)

If (offset) < 0,returns last (count) transactions,
If (offset) >= 0,returns up to (count) most recent transactions skipping the first (offset) transactions.

Arguments:

 -n=count                               (uint, optional) transaction count. If not set, return 10 tx
 -o=offset                              (int, optional) query offset. If not set, from 0

Request:

 "param" :
 {
   "count": 0,                          (uint, optional) transaction count. If not set, return 10 tx
   "offset": 0                          (int, optional) query offset. If not set, from 0
 }

Response:

 "result" :
   [
     "transaction":                     (object, required) wallet transaction data
     {
       "txid": "",                      (string, required) transaction hash
       "fork": "",                      (string, required) fork hash
       "type": "",                      (string, required) transaction type
       "send": true|false,              (bool, required) is from me
       "to": "",                        (string, required) to address
       "amount": 0.0,                   (double, required) transaction amount
       "fee": 0.0,                      (double, required) transaction fee
       "lockuntil": 0,                  (uint, required) lockuntil
       "blockheight": 0,                (int, optional) block height
       "from": ""                       (string, optional) from address
     }
   ]

Examples:

>> multiverse-cli listtransaction
<< [{"txid":"4a8e6035b575699cdb25d45beadd49f18fb1303f57ec55493139e65d811e74ff","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":31296,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0},{"txid":"0aa6954236382a6c1c46cce7fa3165b4d1718f5e03ca67cd5fe831616a9000da","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":31297,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0}]

>> curl -d '{"id":2,"method":"listtransaction","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":2,"jsonrpc":"2.0","result":[{"txid":"4a8e6035b575699cdb25d45beadd49f18fb1303f57ec55493139e65d811e74ff","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":31296,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0},{"txid":"0aa6954236382a6c1c46cce7fa3165b4d1718f5e03ca67cd5fe831616a9000da","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":31297,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0}]}

>> multiverse-cli listtransaction 1 -1
<< [{"txid":"5a1b7bf5e32a77ecb3c53782a8e06f2b12bdcb73b677d6f89b6f82f85f14373a","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":32086,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0}]

>> curl -d '{"id":0,"method":"listtransaction","jsonrpc":"2.0","params":{"count":1,"offset":-1}}' http://127.0.0.1:6812
<< {"id":0,"jsonrpc":"2.0","result":[{"txid":"5a1b7bf5e32a77ecb3c53782a8e06f2b12bdcb73b677d6f89b6f82f85f14373a","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","blockheight":32086,"type":"work","send":false,"to":"20g098nza351f53wppg0kfnsbxqf80h3x8fwp9vdmc98fbrgbv6mtjagy","amount":15.00000000,"fee":0.00000000,"lockuntil":0}]}

>> listtransaction -n=1 -o=-1

Errors:

* {"code":-6,"message":"Negative, zero or out of range count"}
* {"code":-401,"message":"Failed to list transactions"}

sendfrom

Usage:

        sendfrom <"from"> <"to"> <$amount$> ($txfee$) (-f="fork") (-d="data")

<amount> and <txfee> are real and rounded to the nearest 0.000001
Returns transaction id

Arguments:

 "from"                                 (string, required) from address
 "to"                                   (string, required) to address
 $amount$                               (double, required) amount
 $txfee$                                (double, optional) transaction fee
 -f="fork"                              (string, optional) fork hash
 -d="data"                              (string, optional) output data

Request:

 "param" :
 {
   "from": "",                          (string, required) from address
   "to": "",                            (string, required) to address
   "amount": 0.0,                       (double, required) amount
   "txfee": 0.0,                        (double, optional) transaction fee
   "fork": "",                          (string, optional) fork hash
   "data": ""                           (string, optional) output data
 }

Response:

 "result": "transaction"                (string, required) transaction hash

Examples:

>> multiverse-cli sendfrom 20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm 1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q 1
<< 01a9f3bb967f24396293903c856e99896a514756a220266afa347a8b8c7f0038

>> curl -d '{"id":18,"method":"sendfrom","jsonrpc":"2.0","params":{"from":"20g0944xkyk8ybcmzhpv86vb5777jn1sfrdf3svzqn9phxftqth8116bm","to":"1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q","amount":1.00000000}}' http://127.0.0.1:6812
<< {"id":18,"jsonrpc":"2.0","result":"01a9f3bb967f24396293903c856e99896a514756a220266afa347a8b8c7f0038"}

>> multiverse-cli sendfrom 20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26 1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q 1 0.1 -f=a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0
<< 8f92969642024234481e104481f36145736b465ead2d52a6657cf38bd52bdf59

>> curl -d '{"id":53,"method":"sendfrom","jsonrpc":"2.0","params":{"from":"20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26","to":"1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q","amount":1.00000000,"txfee":0.10000000,"fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"}}' http://127.0.0.1:6812
<< {"id":53,"jsonrpc":"2.0","result":"8f92969642024234481e104481f36145736b465ead2d52a6657cf38bd52bdf59"}

Errors:

* {"code":-6,"message":"Invalid from address"}
* {"code":-6,"message":"Invalid to address"}
* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}
* {"code":-401,"message":"Failed to create transaction"}
* {"code":-401,"message":"Failed to sign transaction"}
* {"code":-401,"message":"The signature is not completed"}
* {"code":-10,"message":"Tx rejected : xxx"}

createtransaction

Usage:

        createtransaction <"from"> <"to"> <$amount$> ($txfee$) (-f="fork") (-d="data")

<amount> and <txfee> are real and rounded to the nearest 0.000001.
Returns serialized tx.

Arguments:

 "from"                                 (string, required) from address
 "to"                                   (string, required) to address
 $amount$                               (double, required) amount
 $txfee$                                (double, optional) transaction fee
 -f="fork"                              (string, optional) fork hash
 -d="data"                              (string, optional) output data

Request:

 "param" :
 {
   "from": "",                          (string, required) from address
   "to": "",                            (string, required) to address
   "amount": 0.0,                       (double, required) amount
   "txfee": 0.0,                        (double, optional) transaction fee
   "fork": "",                          (string, optional) fork hash
   "data": ""                           (string, optional) output data
 }

Response:

 "result": "transaction"                (string, required) transaction data

Examples:

>> multiverse-cli createtransaction 20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26 1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q 1 0.1 -f=a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0 -d=12345
<< 01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400

>> curl -d '{"id":59,"method":"createtransaction","jsonrpc":"2.0","params":{"from":"20g0753dp5b817d7v0hbag6a4neetzfdgbcyt2pkx93hrzn97epzbyn26","to":"1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q","amount":1.00000000,"txfee":0.10000000,"fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","data":"12345"}}' http://127.0.0.1:6812
<< {"id":59,"jsonrpc":"2.0","result":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400"}

Errors:

* {"code":-6,"message":"Invalid from address"}
* {"code":-6,"message":"Invalid to address"}
* {"code":-6,"message":"Invalid fork"}
* {"code":-6,"message":"Unknown fork"}
* {"code":-401,"message":"Failed to create transaction"}

signtransaction

Usage:

        signtransaction <"txdata">

Returns json object with keys:
hex : raw transaction with signature(s) (hex-encoded string)
complete : true if transaction has a complete set of signature (false if not)

Arguments:

 "txdata"                               (string, required) transaction data(hex string)

Request:

 "param" :
 {
   "txdata": ""                         (string, required) transaction data(hex string)
 }

Response:

 "result" :
 {
   "hex": "",                           (string, required) hex of transaction data
   "complete": true|false               (bool, required) transaction completed or not
 }

Examples:

>> multiverse-cli signtransaction 01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400
<< {"hex":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a0860100000000000212348182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e0182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052ed494d90cd96c252446b4a10459fea8c06186154b2bee2ce2182556e9ba40e7e69ddae2501862e4251bba2abf11c90d6f1fd0dec48a1419e81bb8c7d922cf3e03","complete":true}

>> curl -d '{"id":62,"method":"signtransaction","jsonrpc":"2.0","params":{"txdata":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400"}}' http://127.0.0.1:6812
<< {"id":62,"jsonrpc":"2.0","result":{"hex":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a0860100000000000212348182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e0182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052ed494d90cd96c252446b4a10459fea8c06186154b2bee2ce2182556e9ba40e7e69ddae2501862e4251bba2abf11c90d6f1fd0dec48a1419e81bb8c7d922cf3e03","complete":true}}

Errors:

* {"code":-8,"message":"TX decode failed"}
* {"code":-401,"message":"Failed to sign transaction"}

signmessage

Usage:

        signmessage <"pubkey"> <"message">

Sign a message with the private key of an pubkey

Arguments:

 "pubkey"                               (string, required) public key
 "message"                              (string, required) message to be signed

Request:

 "param" :
 {
   "pubkey": "",                        (string, required) public key
   "message": ""                        (string, required) message to be signed
 }

Response:

 "result": "signature"                  (string, required) signature of message

Examples:

>> multiverse-cli signmessage 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882 123456
<< 045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707

>> curl -d '{"id":4,"method":"signmessage","jsonrpc":"2.0","params":{"pubkey":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","message":"123456"}}' http://127.0.0.1:6812
<< {"id":4,"jsonrpc":"2.0","result":"045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707"}

Errors:

* {"code":-4,"message":"Unknown key"}
* {"code":-405,"message":"Key is locked"}
* {"code":-401,"message":"Failed to sign message"}

listaddress

Usage:

        listaddress

List all of addresses from pub keys and template ids

Arguments:

	none

Request:

 "param" : {}

Response:

 "result" :
   [
     "addressdata":                     (object, required) address data
     {
       "type": "",                      (string, required) type, pubkey or template
       "address": "",                   (string, required) public key or template address
       (if type=pubkey)
       "pubkey": "",                    (string, required) public key
       (if type=template)
       "template": "",                  (string, required) template type name
       (if type=template)
       "templatedata":                  (object, required) template data
       {
         "type": "",                    (string, required) template type
         "hex": "",                     (string, required) temtplate data
         (if type=delegate)
         "delegate":                    (object, required) delegate template struct
         {
           "delegate": "",              (string, required) delegate public key
           "owner": ""                  (string, required) owner address
         }
         (if type=fork)
         "fork":                        (object, required) fork template struct
         {
           "redeem": "",                (string, required) redeem address
           "fork": ""                   (string, required) fork hash
         }
         (if type=mint)
         "mint":                        (object, required) mint template struct
         {
           "mint": "",                  (string, required) mint public key
           "spent": ""                  (string, required) spent address
         }
         (if type=multisig)
         "multisig":                    (object, required) multisig template struct
         {
           "sigsrequired": 0,           (int, required) required weight
           [
             "key": ""                  (string, required) public key
           ]
         }
         (if type=weighted)
         "weighted":                    (object, required) weighted template struct
         {
           "sigsrequired": 0,           (int, required) required weight
           [
             "pubkey":                  (object, required) public key
             {
               "key": "",               (string, required) public key
               "weight": 0              (int, required) weight
             }
           ]
         }
       }
     }
   ]

Examples:

>> multiverse-cli listaddress
<< [{"type":"pubkey","address":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","pubkey":"182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e"},{"type":"template","address":"208043ht3c51qztrdfa0f3349pe2m8ajjw1mdb2py68fbckaa2s24tq55","template":"multisig","templatedata":{"type":"multisig","hex":"0200010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052eb9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f4","multisig":{"sigsrequired":1,"addresses":["1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q"]}}},{"type":"template","address":"20g0b87qxcd52ceh9zmpzx0hy46pjfzdnqbkh8f4tqs4y0r6sxyzyny25","template":"mint","templatedata":{"type":"mint","hex":"0400f9b4af95bec6c5d504366245e0420bc3c5c78cd05ea68e4ad85a4d770e77e3e801f9b4af95bec6c5d504366245e0420bc3c5c78cd05ea68e4ad85a4d770e77e3e8","mint":{"mint":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1","spent":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}}}]

>> curl -d '{"id":1,"method":"listaddress","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":0,"jsonrpc":"2.0","result":[{"type":"pubkey","address":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","pubkey":"182e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052e"},{"type":"template","address":"208043ht3c51qztrdfa0f3349pe2m8ajjw1mdb2py68fbckaa2s24tq55","template":"multisig","templatedata":{"type":"multisig","hex":"0200010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052eb9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f4","multisig":{"sigsrequired":1,"addresses":["1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q"]}}},{"type":"template","address":"20g0b87qxcd52ceh9zmpzx0hy46pjfzdnqbkh8f4tqs4y0r6sxyzyny25","template":"mint","templatedata":{"type":"mint","hex":"0400f9b4af95bec6c5d504366245e0420bc3c5c78cd05ea68e4ad85a4d770e77e3e801f9b4af95bec6c5d504366245e0420bc3c5c78cd05ea68e4ad85a4d770e77e3e8","mint":{"mint":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1","spent":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}}}]}

Errors:

	none

exportwallet

Usage:

        exportwallet <"path">

Export all of keys and templates from wallet to a specified file in json format.

Arguments:

 "path"                                 (string, required) save file path

Request:

 "param" :
 {
   "path": ""                           (string, required) save file path
 }

Response:

 "result": "result"                     (string, required) export result

Examples:

>> multiverse-cli exportwallet /Users/Loading/a.txt
<< Wallet file has been saved at: /Users/Loading/a.txt

>> {"id":4,"method":"exportwallet","jsonrpc":"2.0","params":{"path":"/Users/Loading/a.txt"}}
<< {"id":4,"jsonrpc":"2.0","result":"Wallet file has been saved at: /Users/Loading/a.txt"}

Errors:

* {"code":-6,"message":"Invalid template address"}
* {"code":-401,"message":"Must be an absolute path."}
* {"code":-401,"message":"Cannot export to a folder."}
* {"code":-401,"message":"File has been existed."}
* {"code":-401,"message":"Failed to create directories."}
* {"code":-401,"message":"Failed to export key"}
* {"code":-401,"message":"Unkown template"}
* {"code":-401,"message":"filesystem_error"}

importwallet

Usage:

        importwallet <"path">

Import keys and templates from archived file in json format to wallet.

Arguments:

 "path"                                 (string, required) save file path

Request:

 "param" :
 {
   "path": ""                           (string, required) save file path
 }

Response:

 "result": "result"                     (string, required) export result

Examples:

>> multiverse-cli importwallet /Users/Loading/a.txt
<< Imported 0 keys and 0 templates.

>> {"id":5,"method":"importwallet","jsonrpc":"2.0","params":{"path":"/Users/Loading/a.txt"}}
<< {"id":5,"jsonrpc":"2.0","result":"Imported 0 keys and 0 templates."}

Errors:

* {"code":-6,"message":"Invalid parameters,failed to make template"}
* {"code":-401,"message":"Must be an absolute path."}
* {"code":-401,"message":"File has been existed."}
* {"code":-401,"message":"Filesystem_error - failed to read."}
* {"code":-401,"message":"Wallet file exported is invalid, check it and try again."}
* {"code":-401,"message":"Data format is not correct, check it and try again."}
* {"code":-401,"message":"Failed to add key"}
* {"code":-401,"message":"Failed to sync wallet tx"}
* {"code":-401,"message":"Failed to add template"}
* {"code":-401,"message":"Failed to sync wallet tx"}
* {"code":-32602,"message":"Failed to verify serialized key"}
* {"code":-32602,"message":"Can't import the key with empty passphrase"}

makeorigin

Usage:

        makeorigin <"prev"> <"owner"> <$amount$> <"name"> <"symbol"> <$reward$> (-i|-noi*isolated*) (-p|-nop*private*) (-e|-noe*enclosed*)

Return hex-encoded block.

Arguments:

 "prev"                                 (string, required) prev block hash
 "owner"                                (string, required) owner address
 $amount$                               (double, required) amount
 "name"                                 (string, required) unique fork name
 "symbol"                               (string, required) fork symbol
 $reward$                               (double, required) mint reward
 -i|-noi*isolated*                      (bool, optional, default=true) is isolated
 -p|-nop*private*                       (bool, optional, default=false) is private
 -e|-noe*enclosed*                      (bool, optional, default=false) is enclosed

Request:

 "param" :
 {
   "prev": "",                          (string, required) prev block hash
   "owner": "",                         (string, required) owner address
   "amount": 0.0,                       (double, required) amount
   "name": "",                          (string, required) unique fork name
   "symbol": "",                        (string, required) fork symbol
   "reward": 0.0,                       (double, required) mint reward
   "isolated": true|false,              (bool, optional, default=true) is isolated
   "private": true|false,               (bool, optional, default=false) is private
   "enclosed": true|false               (bool, optional, default=false) is enclosed
 }

Response:

 "result" :
 {
   "hash": "",                          (string, required) block hash
   "hex": ""                            (string, required) block data hex
 }

Examples:

>> multiverse-cli makeorigin a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0 1p2e0yjz5y1ga705csrzpsp1wre1vjqepkbwnpchyx2vay86wf01pz3qs 1500 test-fork POW 1.0
<< {"hash" : "327ec1ffabeae75295401ec69591f845e6025c24d31ae07d9f6e9dec3462bd7a","hex" : "010000ffc06f585ac0afdc176980a0a1ebe849d09b51e4b4c1dd46fb939579d71bdc55809d6f3da600000000000000000000000000000000000000000000000000000000000000004c8001000000e109746573742d666f726be203504f574301a46400000000000000a540420f0000000000e62101b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803010000010000000000000000000000000000000000000000000000000000000000000000000000000001b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803002f685900000000000000000000000009746573742d666f726b000040f253de866a5357b5a11e493162885f4b8a34e94279e29b8354b237aaec650af420b61d24721b4e5e3a4096e9370c77f7dad6c05ced6eedcb2229958671620c05"}

>> curl -d '{"id":4,"method":"makeorigin","jsonrpc":"2.0","params":{"prev":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","owner":"1p2e0yjz5y1ga705csrzpsp1wre1vjqepkbwnpchyx2vay86wf01pz3qs","amount":1500,"name":"test-fork","symbol":"POW","reward":1,"isolated":true,"private":false,"enclosed":false}}' http://127.0.0.1:6812
<< {"id":4,"jsonrpc":"2.0","result":{"hash":"327ec1ffabeae75295401ec69591f845e6025c24d31ae07d9f6e9dec3462bd7a","hex":"010000ffc06f585ac0afdc176980a0a1ebe849d09b51e4b4c1dd46fb939579d71bdc55809d6f3da600000000000000000000000000000000000000000000000000000000000000004c8001000000e109746573742d666f726be203504f574301a46400000000000000a540420f0000000000e62101b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803010000010000000000000000000000000000000000000000000000000000000000000000000000000001b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803002f685900000000000000000000000009746573742d666f726b000040f253de866a5357b5a11e493162885f4b8a34e94279e29b8354b237aaec650af420b61d24721b4e5e3a4096e9370c77f7dad6c05ced6eedcb2229958671620c05"}}

>> multiverse-cli makeorigin a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0 1p2e0yjz5y1ga705csrzpsp1wre1vjqepkbwnpchyx2vay86wf01pz3qs 1500 test-fork POW 1.0 -i -nop -e
<< {"hash":"ade2a8f61082cc0b8e98581e013c52126989d5c15e5c4c6b882f76c98bc68025","hex":"010000ffc06f585ac0afdc176980a0a1ebe849d09b51e4b4c1dd46fb939579d71bdc55809d6f3da600000000000000000000000000000000000000000000000000000000000000004c8001000000e109746573742d666f726be203504f574305a46400000000000000a540420f0000000000e62101b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803010000010000000000000000000000000000000000000000000000000000000000000000000000000001b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803002f685900000000000000000000000009746573742d666f726b00004078bbc21e237d727a58de54e14a19d0244e9dd27ce7d55dfca891158913068185f3dc5b98d4e11500b7512bc8d0e8aa136b34f22f16c16be45e9650e15253980e"}

>> {"id":2,"method":"makeorigin","jsonrpc":"2.0","params":{"prev":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0","owner":"1p2e0yjz5y1ga705csrzpsp1wre1vjqepkbwnpchyx2vay86wf01pz3qs","amount":1500,"name":"test-fork","symbol":"POW","reward":1,"isolated":true,"private":false,"enclosed":true}}
<< {"id":2,"jsonrpc":"2.0","result":{"hash":"ade2a8f61082cc0b8e98581e013c52126989d5c15e5c4c6b882f76c98bc68025","hex":"010000ffc06f585ac0afdc176980a0a1ebe849d09b51e4b4c1dd46fb939579d71bdc55809d6f3da600000000000000000000000000000000000000000000000000000000000000004c8001000000e109746573742d666f726be203504f574305a46400000000000000a540420f0000000000e62101b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803010000010000000000000000000000000000000000000000000000000000000000000000000000000001b09c0f4be5f060a380acce3f6cd83cc383b95dd69af95b323ee8b6af20dc7803002f685900000000000000000000000009746573742d666f726b00004078bbc21e237d727a58de54e14a19d0244e9dd27ce7d55dfca891158913068185f3dc5b98d4e11500b7512bc8d0e8aa136b34f22f16c16be45e9650e15253980e"}}

Errors:

* {"code":-4,"message":"Owner' address should be pubkey address"}
* {"code":-4,"message":"Unknown key"}
* {"code":-6,"message":"Unknown prev block"}
* {"code":-6,"message":"Invalid owner"}
* {"code":-6,"message":"Invalid amount"}
* {"code":-6,"message":"Invalid name or symbol"}
* {"code":-6,"message":"Prev block should not be extended/vacant block"}
* {"code":-405,"message":"Key is locked"}
* {"code":-401,"message":"Failed to sign message"}

verifymessage

Usage:

        verifymessage <"pubkey"> <"message"> <"sig">

Verify a signed message

Arguments:

 "pubkey"                               (string, required) public key
 "message"                              (string, required) message to be verified
 "sig"                                  (string, required) sign

Request:

 "param" :
 {
   "pubkey": "",                        (string, required) public key
   "message": "",                       (string, required) message to be verified
   "sig": ""                            (string, required) sign
 }

Response:

 "result": result                       (bool, required) message verified result.

Examples:

>> multiverse-cli verifymessage 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882 123456 045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707
<< true

>> curl -d '{"id":5,"method":"verifymessage","jsonrpc":"2.0","params":{"pubkey":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","message":"123456","sig":"045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707"}}' http://127.0.0.1:6812
<< {"id":5,"jsonrpc":"2.0","result":true}

>> multiverse-cli verifymessage 2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882 12345 045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707
<< false

>> curl -d '{"id":6,"method":"verifymessage","jsonrpc":"2.0","params":{"pubkey":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","message":"12345","sig":"045977f8c07e6d846d6055357f36a70c16c071cb85115e3ffb498e171a9ac3f4aed1292203a0c8e42c4becafad3ced0d9874abd2a8b788fda9f07099a1e71707"}}' http://127.0.0.1:6812
<< {"id":6,"jsonrpc":"2.0","result":false}

Errors:

* {"code":-6,"message":"Invalid pubkey"}
* {"code":-6,"message":"Invalid message"}
* {"code":-6,"message":"Invalid sig"}

makekeypair

Usage:

        makekeypair

Make a public/private key pair.

Arguments:

	none

Request:

 "param" : {}

Response:

 "result" :
 {
   "privkey": "",                       (string, required) private key
   "pubkey": ""                         (string, required) public key
 }

Examples:

>> multiverse-cli makekeypair
<< {"privkey":"833a5d51d2db84debc0eb3a40d7d41b2723452d211d7e81ce489a95ef48b2324","pubkey":"e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9"}

>> curl -d '{"id":42,"method":"makekeypair","jsonrpc":"2.0","params":{}}' http://127.0.0.1:6812
<< {"id":42,"jsonrpc":"2.0","result":{"privkey":"833a5d51d2db84debc0eb3a40d7d41b2723452d211d7e81ce489a95ef48b2324","pubkey":"e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9"}}

Errors:

	none

getpubkeyaddress

Usage:

        getpubkeyaddress <"pubkey">

Returns encoded address for the given pubkey.

Arguments:

 "pubkey"                               (string, required) public key

Request:

 "param" :
 {
   "pubkey": ""                         (string, required) public key
 }

Response:

 "result": "address"                    (string, required) address of public key

Examples:

>> multiverse-cli getpubkeyaddress e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9
<< 1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1

>> curl -d '{"id":44,"method":"getpubkeyaddress","jsonrpc":"2.0","params":{"pubkey":"e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9"}}' http://127.0.0.1:6812
<< {"id":44,"jsonrpc":"2.0","result":"1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}

Errors:

* {"code":-6,"message":"Invalid pubkey"}

gettemplateaddress

Usage:

        gettemplateaddress <"tid">

Returns encoded address for the given template id.

Arguments:

 "tid"                                  (string, required) template id

Request:

 "param" :
 {
   "tid": ""                            (string, required) template id
 }

Response:

 "result": "address"                    (string, required) address of template

Examples:

>> multiverse-cli gettemplateaddress 2040fpytdr4k5h8tk0nferr7zb51tkccrkgqf341s6tg05q9xe6hth1m4
<< 21w2040000000000000000000000000000000000000000000000epcek

>> curl -d '{"id":53,"method":"gettemplateaddress","jsonrpc":"2.0","params":{"tid":"2040fpytdr4k5h8tk0nferr7zb51tkccrkgqf341s6tg05q9xe6hth1m4"}}' http://127.0.0.1:6812
<< {"id":53,"jsonrpc":"2.0","result":"21w2040000000000000000000000000000000000000000000000epcek"}

Errors:

* {"code":-6,"message":"Invalid tid"}

maketemplate

Usage:

        maketemplate <"type"> <{delegate}>|<{fork}>|<{mint}>|<{multisig}>|<{weighted}>

Returns encoded address for the given template id.

Arguments:

 "type"                                 (string, required) template type
  (if type=delegate)
 {delegate}                             (object, required) a delegate template
  (if type=fork)
 {fork}                                 (object, required) a new fork template
  (if type=mint)
 {mint}                                 (object, required) a mint template
  (if type=multisig)
 {multisig}                             (object, required) a multiple sign template
  (if type=weighted)
 {weighted}                             (object, required) a weighted multiple sign template

Request:

 "param" :
 {
   "type": "",                          (string, required) template type
   (if type=delegate)
   "delegate":                          (object, required) a delegate template
   {
     "delegate": "",                    (string, required) delegate public key
     "owner": ""                        (string, required) owner address
   }
   (if type=fork)
   "fork":                              (object, required) a new fork template
   {
     "redeem": "",                      (string, required) redeem address
     "fork": ""                         (string, required) fork hash
   }
   (if type=mint)
   "mint":                              (object, required) a mint template
   {
     "mint": "",                        (string, required) mint public key
     "spent": ""                        (string, required) spent address
   }
   (if type=multisig)
   "multisig":                          (object, required) a multiple sign template
   {
     "required": 0,                     (int, required) required weight > 0
     [
       "key": ""                        (string, required) public key
     ]
   }
   (if type=weighted)
   "weighted":                          (object, required) a weighted multiple sign template
   {
     "required": 0,                     (int, required) required weight
     [
       "pubkey":                        (object, required) public key
       {
         "key": "",                     (string, required) public key
         "weight": 0                    (int, required) weight
       }
     ]
   }
 }

Response:

 "result" :
 {
   "address": "",                       (string, required) address of template
   "hex": ""                            (string, required) template data hex string
 }

Examples:

>> multiverse-cli maketemplate multisig '{"required": 1, "pubkeys": ["2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882", "f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9"]}'
<< {"address":"208043ht3c51qztrdfa0f3349pe2m8ajjw1mdb2py68fbckaa2s24tq55","hex":"0200010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052eb9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f4"}

>> curl -d '{"id":54,"method":"maketemplate","jsonrpc":"2.0","params":{"type":"multisig","multisig":{"required":1,"pubkeys":["2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9"]}}}' http://127.0.0.1:6812
<< {"id":54,"jsonrpc":"2.0","result":{"address":"208043ht3c51qztrdfa0f3349pe2m8ajjw1mdb2py68fbckaa2s24tq55","hex":"0200010282e8a36441d116ce7a97f9a216d43a3dfc4280295874007b8ff5fd45eec9052eb9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f4"}}

>> multiverse-cli maketemplate delegate '{"delegate":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882","owner":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq"}'

>> multiverse-cli maketemplate fork '{"redeem":"1gbma6s21t4bcwymqz6h1dn1t7qy45019b1t00ywfyqymbvp90mqc1wmq","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"}'

>> multiverse-cli maketemplate mint '{"mint": "e8e3770e774d5ad84a8ea65ed08cc7c5c30b42e045623604d5c5c6be95afb4f9", "spent": "1z6taz5dyrv2xa11pc92y0ggbrf2wf36gbtk8wjprb96qe3kqwfm3ayc1"}'

>> multiverse-cli maketemplate weighted '{"required": 1, "pubkeys": [{"key":"2e05c9ee45fdf58f7b007458298042fc3d3ad416a2f9977ace16d14164a3e882", "weight": 1},{"key": "f4124c636d37b1308ba95c14b2487134030d5817f7fa93f11bcbc616aab7c3b9", "weight": 2}]}'

Errors:

* {"code":-6,"message":"Invalid parameters, failed to make template"}
* {"code":-6,"message":"Invalid parameter, missing weight"}
* {"code":-6,"message":"Invalid parameter, missing redeem address"}
* {"code":-6,"message":"Invalid parameter, missing spent address"}
* {"code":-6,"message":"Invalid parameter, missing owner address"}
* {"code":-6,"message":"template type error. type: xxx"}

decodetransaction

Usage:

        decodetransaction <"txdata">

Return a JSON object representing the serialized, hex-encoded transaction.

Arguments:

 "txdata"                               (string, required) transaction raw data

Request:

 "param" :
 {
   "txdata": ""                         (string, required) transaction raw data
 }

Response:

 "result" :
 {
   "txid": "",                          (string, required) transaction hash
   "version": 0,                        (uint, required) version
   "type": "",                          (string, required) transaction type
   "lockuntil": 0,                      (uint, required) unlock time
   "anchor": "",                        (string, required) anchor hash
   [
     "vin":                             (object, required) vin struct
     {
       "txid": "",                      (string, required) pre-vout transaction hash
       "vout": 0                        (uint, required) pre-vout number
     }
   ]
   "sendto": "",                        (string, required) send to address
   "amount": 0.0,                       (double, required) amount
   "txfee": 0.0,                        (double, required) transaction fee
   "data": "",                          (string, required) data
   "sig": "",                           (string, required) sign
   "fork": "",                          (string, required) fork hash
   "confirmations": 0                   (int, optional) confirmations
 }

Examples:

>> multiverse-cli decodetransaction 01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400
<< {"txid":"b492ea1de2d540288f6e45fd21bc4ac2cd2fcfeb63ec43c50acdb69debfad10a","version":1,"type":"token","lockuntil":0,"anchor":"25439b778af5e310a13f2310b48ecb329674ba1dc2054affccef8b73247e742b","vin":[{"txid":"8119097ebc65abd55889e90be6de69c218082d05299951573a455701e55bf40e","vout":0}],"sendto":"1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q","amount":1.00000000,"txfee":0.10000000,"data":"1234","sig":"","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"}

>> curl -d '{"id":1,"method":"decodetransaction","jsonrpc":"2.0","params":{"txdata":"01000000000000002b747e24738befccff4a05c21dba749632cb8eb410233fa110e3f58a779b4325010ef45be50157453a57519929052d0818c269dee60be98958d5ab65bc7e0919810001b9c3b7aa16c6cb1bf193faf717580d03347148b2145ca98b30b1376d634c12f440420f0000000000a08601000000000002123400"}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":{"txid":"b492ea1de2d540288f6e45fd21bc4ac2cd2fcfeb63ec43c50acdb69debfad10a","version":1,"type":"token","lockuntil":0,"anchor":"25439b778af5e310a13f2310b48ecb329674ba1dc2054affccef8b73247e742b","vin":[{"txid":"8119097ebc65abd55889e90be6de69c218082d05299951573a455701e55bf40e","vout":0}],"sendto":"1q71vfagprv5hqwckzbvhep0d0ct72j5j2heak2sgp4vptrtc2btdje3q","amount":1.00000000,"txfee":0.10000000,"data":"1234","sig":"","fork":"a63d6f9d8055dc1bd7799593fb46ddc1b4e4519bd049e8eba1a0806917dcafc0"}}

Errors:

* {"code":-8,"message":"TX decode failed"}
* {"code":-6,"message":"Unknown anchor block"}

getwork

Usage:

        getwork ("prev")

If (prev hash) is matched with the current primary chain,returns true
If next block is not generated by proof-of-work,return false
Otherwise, returns formatted proof-of-work parameters to work on:
"prevblockhash" : prevblock hash
"prevblocktime" : prevblock timestamp
"algo" : proof-of-work algorithm: blake2b=1,...
"bits" : proof-of-work difficulty nbits
"data" : work data

Arguments:

 "prev"                                 (string, optional) prev block hash

Request:

 "param" :
 {
   "prev": ""                           (string, optional) prev block hash
 }

Response:

 "result" :
 {
   (if prev is matched or block is not generated by POW)
   "result": true|false,                (bool, optional) result
   (if next block is generated by POW)
   "work":                              (object, optional) work data
   {
     "prevblockhash": "",               (string, required) prev block hash
     "prevblocktime": 0,                (uint, required) prev block time
     "algo": 0,                         (int, required) algo
     "bits": 0,                         (int, required) bits
     "data": ""                         (string, required) work data
   }
 }

Examples:

>> multiverse-cli getwork 7ee748e9a827d476d1b4ddb77dc8f9bad779f7b71593d5c5bf73b535e1cc2446
<< {"work":{"prevblockhash":"f734bb6bc12ab4058532113cfe6a3412d1036eae25f60a97ee1b17effc6e74de","prevblocktime":1538142032,"algo":1,"bits":25,"data":"01000100822fae5bde746efcef171bee970af625ae6e03d112346afe3c11328505b42ac16bbb34f74300000000000000000000000000000000000000000000000000000000000000000001190000000000000000000000000000000000000000000000000000000000000000"}}

>> curl -d '{"id":1,"method":"getwork","jsonrpc":"2.0","params":{"prev":"7ee748e9a827d476d1b4ddb77dc8f9bad779f7b71593d5c5bf73b535e1cc2446"}}' http://127.0.0.1:6812
<< {"id":1,"jsonrpc":"2.0","result":{"work":{"prevblockhash":"f734bb6bc12ab4058532113cfe6a3412d1036eae25f60a97ee1b17effc6e74de","prevblocktime":1538142032,"algo":1,"bits":25,"data":"01000100822fae5bde746efcef171bee970af625ae6e03d112346afe3c11328505b42ac16bbb34f74300000000000000000000000000000000000000000000000000000000000000000001190000000000000000000000000000000000000000000000000000000000000000"}}}

Errors:

* {"code" : -32603, "message" : "The primary chain is invalid."}

submitwork

Usage:

        submitwork <"data"> <"spent"> <"privkey">

Attempts to construct and submit new block to network
Return hash of new block.

Arguments:

 "data"                                 (string, required) work data
 "spent"                                (string, required) spent address
 "privkey"                              (string, required) private key

Request:

 "param" :
 {
   "data": "",                          (string, required) work data
   "spent": "",                         (string, required) spent address
   "privkey": ""                        (string, required) private key
 }

Response:

 "result": "hash"                       (string, required) block hash

Examples:

>> multiverse-cli submitwork 01000100502fae5b4624cce135b573bfc5d59315b7f779d7baf9c87db7ddb4d176d427a8e948e77e43000000000000000000000000000000000000000000000000000000000000000000011acfff020000000000000000000000000000000000000000000000000000000000 1dj5qcjst7eh4tems36n1m500hhyba3vx436t4a8hgdm7r7jrdbf2yqp9 41a9f94395ced97d5066e2d099df4f1e2bd96057f9c38e8ea3f8a02eccd0a98e
<< f734bb6bc12ab4058532113cfe6a3412d1036eae25f60a97ee1b17effc6e74de

>> curl -d '{"id":2,"method":"submitwork","jsonrpc":"2.0","params":{"data":"01000100502fae5b4624cce135b573bfc5d59315b7f779d7baf9c87db7ddb4d176d427a8e948e77e43000000000000000000000000000000000000000000000000000000000000000000011acfff020000000000000000000000000000000000000000000000000000000000","spent":"1dj5qcjst7eh4tems36n1m500hhyba3vx436t4a8hgdm7r7jrdbf2yqp9","privkey":"41a9f94395ced97d5066e2d099df4f1e2bd96057f9c38e8ea3f8a02eccd0a98e"}}' http://127.0.0.1:6812
<< {"id":2,"jsonrpc":"2.0","result":"f734bb6bc12ab4058532113cfe6a3412d1036eae25f60a97ee1b17effc6e74de"}

Errors:

* {"code" : -4, "message" : "Invalid spent address"}
* {"code" : -4, "message" : "Invalid private key"}
* {"code" : -4, "message" : "Invalid mint template"}
* {"code" : -6, "message" : "Block rejected : operation failed"}
* {"code" : -6, "message" : "Block rejected : block proof-of-work is invalid"}

Command Line

command line format:

Usage:
        multiverse-cli (OPTIONS) COMMAND

Run multiverse RPC client

Options:
  -help                                 Get more information
  -daemon                               Run server in background
  -debug                                Run in debug mode
  -datadir=<path>                       Root directory of resources
  -conf=<file>                          Configuration file name
  -testnet                              Use the test network
  -nowallet                             Launch server without wallet
  -version                              Get multiverse version
  -purge                                Purge database and blockfile
  -rpcport=port                         Listen for JSON-RPC connections on <port> (default: 6812 or testnet: 6814))
  -rpcuser=<user>                       <user> name for JSON-RPC connections
  -rpcpassword=<password>               <password> for JSON-RPC connections
  -rpcssl                               Use OpenSSL (https) for JSON-RPC connections or not (default false)
  -norpcsslverify                       Verify SSL or not (default yes)
  -rpccafile=<file.cert>                SSL CA file name (default ca.crt)
  -rpccertfile=<file.cert>              Server certificate file (default: server.cert)
  -rpcpkfile=<file.pem>                 Server private key (default: server.pem)
  -rpcciphers=<ciphers>                 Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)
  -rpchost=<ip>                         Send commands to node running on <ip> (default: 127.0.0.1)
  -rpctimeout=<time>                    Connection timeout <time> seconds (default: 120)

command param format rule

  • optional tag:\<required\>, (optional)
  • data type tag:integer, $double$, \*bool\*, "str", {object}, [array]
  • option(optional):
    • -opt|-noopt: bool option, -no means false, or means true
    • -opt=xxx: other type option
  • every param is composed of optional tag + option + data type tag + name
  • example:multiverse-cli cmd <p1> <$p2$> <*p3*> <{p4}> ("p5") ([p6]) (-s|-nos*p7*) (-t="p8")
    • multiverse-cli cmd is command
    • <p1> is int64 required param.
    • <$p2$> is double required param.
    • <*p3*> is bool required param.
    • <{p4}> is object required param.
    • ("p5") is string optional param.
    • ([p6]) is string array optional param.
    • (-s|-nos*p7*) is bool optional param with option -s|-nos.
    • (-t="p8") is string optional param with option -t.

Error Code

Standard JSON-RPC 2.0 errors

  • -32600: Invalid request
  • -32601: Method not found
  • -32602: Invalid params
  • -32603: Internal error
  • -32700: Parse error

General application defined errors

  • -1: std::exception thrown in command handling
  • -2: Server is in safe mode, and command //!< is not allowed in safe mode
  • -3: Unexpected type was passed as parameter
  • -4: Invalid address or key
  • -5: Ran out of memory during operation
  • -6: Invalid, missing or duplicate parameter
  • -7: Database error
  • -8: Error parsing or validating structure in raw format
  • -9: General error during transaction or block submission
  • -10: Transaction or block was rejected by network rules
  • -11: Transaction already in chain
  • -12: Client still warming up
  • -13: Request id is missing when get response

P2P client errors

  • -201: Bitcoin is not connected
  • -202: Still downloading initial blocks
  • -203: Node is already added
  • -204: Node has not been added before
  • -205: Node to disconnect not found in connected nodes
  • -206: Invalid IP/Subnet
  • -207: No valid connection manager instance found

Wallet errors

  • -401: Unspecified problem with wallet (key not found etc.)
  • -402: Not enough funds in wallet or account
  • -403: Invalid account name
  • -404: Keypool ran out, call keypoolrefill first
  • -405: Enter the wallet passphrase with walletpassphrase first
  • -406: The wallet passphrase entered was incorrect
  • -407: Command given in wrong wallet encryption state (encrypting an //!< encrypted wallet etc.)
  • -408: Failed to encrypt the wallet
  • -409: Wallet is already unlocked
  • -410: Invalid label name
  • -411: Invalid passphrase

Workflow

Create Key

Create Transaction

  1. If no key, Create Key
  2. If key is locked, unlockkey
  3. If no public key address, getpubkeyaddress
  4. Create transaction:

Create template

Create fork

  1. Create fork data: makeorigin, will return a new fork origin BLOCK HASH and a DATA
  2. Create fork template: Create template(type = "fork", fork = BLOCK HASH in step 1), will return a TEMPLATE ADDRESS
  3. Create transaction: Create Transaction(to = TEMPLATE ADDRESS in step 2, data = DATA in step 1)

Create DPOS

  1. Create a new key by getnewkey called DPOS OWNER KEY
  2. Create a pair of key by makekeypair called DPOS SIGNATURE KEY
  3. If DPOS OWNER KEY is locked, unlockkey
  4. Get address of DPOS OWNER KEY by getpubkeyaddress called DPOS OWNER ADDRESS
  5. In multiverse.conf or your custom config file, set mpvsskey = the private key of DPOS SIGNATURE KEY in step 2, mpvssaddress = DPOS OWNER ADDRESS in step 4(NOTICE: mpvsskey must not be the private key of mpvssaddress)
  6. Create delegate template: Create template(type = "delegate", delegate = the public key of DPOS SIGNATURE KEY in step 2, owner = DPOS OWNER ADDRESS in step 4), will return a TEMPLATE ADDRESS
  7. Create transaction: Create Transaction(from = DPOS OWNER ADDRESS in step 2, to = TEMPLATE ADDRESS in step 5, amount >= 2% of 745000000)

Create multisig

  1. Prepare at least two public key by Create Key or from other wallet, called KEY SET
  2. Create multisig template: Create template(type = "multisig", required = a number means how many weight of signature at least could send a transaction(the number is between 1 and min(255, the sum of KEY SET)), pubkeys = array of KEY SET in step 1), will return a TEMPLATE ADDRESS(NOTICE: the weight of every key in KEY SET is step 1)
  3. Send a transaction to the TEMPLATE ADDRESS like common transaction.
  4. Send a transaction from the TEMPLATE ADDRESS:
    4.1 Create a transaction by createtransaction(from = TEMPLATE ADDRESS), will return a TRANSACTION RAW DATA
    4.2 Ensure there exists at least one key of KEY SET in wallet, and unlocked. Sign the transaction by signtransaction(txdata = TRANSACTION RAW DATA), will return a SIGNED TRANSACTION RAW DATA and bool value COMPLATE means the sum of signed keys weight is equal or greater than required of template. 4.3 If COMPLATE is false, take SIGNED TRANSACTION RAW DATA as TRANSACTION RAW DATA to another wallet which exists another key of KEY SET to repeat from previous step. If COMPLATE is true, send transaction by sendtransaction(txdata = SIGNED TRANSACTION RAW DATA)

Create weighted-multisig

  1. like step 1 of Create multisig
  2. Create weighed template: Create template(type = "weighted", required like the step 2 of Create multisig, pubkeys = array of key(in KEY SET in step 1) and it's weighted(between [1, 255]), will return a TEMPLATE ADDRESS
  3. like step 3 of Create multisig
  4. like step 4 of Create multisig
Clone this wiki locally