Creates transaction from JSON file

CLI Example

Command syntax:

tx_create_json 
-net <net_name> 
-chain <chain_name> 
-json <json_file_path>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - the name of Chain. The list of chains can be found in the directory <Config_dir> \ etc \ network \ <network_name> or by the Cellframe-Node-CLI using command - net list chains
-json - path to json file (file.json can be situated in any folder you want)
 

JSON file example:

{
    "chain": "main",
    "items": [
        {
            "addr_from": "Rj7J7MiX2bWy8sNybTStGPaBEJLjxMnyXJinDezXE8D5LGUmkQZSPfXHATXePY9PXi5qWo4NLRUWu89AjQ5QmEWCH1C9H7zYqceKHrTF",
            "token": "CELL",
            "type": "in"
        },
        {
            "addr": "Rj7J7MiX2bWy8sNya4sPJaQsAqhULtVZi51JFSpXKKx7B5JDjbGtXPjN943iLFJuaHe3PukbBWzUM5VSo6HQZ6DkLUvnKUQVQVjLAnum",
            "type": "out",
            "value": "1000000000000000000"
        },
        {
            "type": "sign",
            "wallet": "testwallet"
        },
        {
            "subtype": "fee",
            "type": "out_cond",
            "value": "500000000000000000"
        }
    ],
    "net": "Backbone"
}

JSON-file template:

{
    "chain": "name of the chain (main or zero)",
    "items": [
        {
            "type": "" ,
            "addr_from": "",
            "token": ""
        },
        {
            "type": "",
            "addr": "",
            "value": ""
        },
        {
            "type": "",
            "wallet": ""
        },
        {
            "type": "",
            "subtype": "",
            "value": ""
        }
    ],
    "net": "Name of the network"
}

Example:

Command:

cellframe-node-cli tx_create_json 
-net foobar 
-chain main 
-json /root/tx.json

Response:

Transaction 0x1CF55991C6B14B30484BCE6B2E0CBFBD4A22D6000AD725213F3E5135E1FDBB95 with 4 items created and added to mempool successfully

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect  -d '{"method":"tx_create_json", "params":["tx_create_json;-net;foobar;-chain;main;-json;/root/tx.json"], "id":"1"}'

Response:


"type": 0,
"result": "Transaction 0xFD56BBE8C7D0983C7DFCA3F7849E38571C30DB8F8E5419D793549FCD5ABD91A7 with 4 items created and added to mempool successfully", "errors": null,
"id": 1
}