Documentation 5.1







Daemon


Introduction


How to Run


Configuration Options


Commands


HTTP RPC


JSON RPC





SimpleWallet


Introduction


How to Run


Configuration Options


Commands


JSON RPC





Walletd


Introduction


How to Run


Configuration Options


JSON RPC





Miscellaneous


Glossary


Disclaimer











Daemon Introduction



The Cash2 daemon cash2d is a command line program that synchronizes your Cash2 blockchain with the Cash2 blockchains of other computers.


These other computers are called peer nodes, and they are also running the Cash2 daemon.



The Cash2 daemon stores the blockchain information in the following directories :











How to Run the Daemon



You can run the Cash2 daemon from the command line by doing the following :




It is recommended that you protect your daemon from unwanted outside remote procedure calls (RPCs) by using the restricted-rpc option:




You will have to wait for your local copy of the blockchain to fully synchronize with the network.


This can take several days depending on the speed of your computer and internet connection.


When you have finished synchronizing, you will see a message similar to this :


[99.111.67.122:12275 OUT] SYNCHRONIZED OK










Daemon Configuration Options



You can control how your Cash2 daemon will run by sepcifiying command line options when you start the daemon:




You can specify a single option or multiple options.


Each option must be proceeded with a --.


For example cash2d.exe --help.


In this section, we discuss all the available options for you to configure your Cash2 daemon.




Available Daemon Configuration Options











add-exclusive-node
(Daemon Configuration Option)




Connect your daemon to only a given list of peer nodes.


If this option is used, the options add-priority-node and seed-node are ignored.




Example


cash2d.exe --add-exclusive-node=99.111.67.121:12275


To add multiple peer nodes, use the option several times :

cash2d.exe --add-exclusive-node=99.111.67.121:12275 --add-exclusive-node=99.111.67.122:12275










add-peer
(Daemon Configuration Option)




Manually add a peer to your peerlist.




Example


cash2d.exe --add-peer=99.111.67.121:12275










add-priority-node
(Daemon Configuration Option)




Connect your daemon to only a given list of peers and attempt to keep the connection open.




Example


cash2d.exe --add-priority-node=99.111.67.121:12275


To add multiple peer nodes, use the option several times :

cash2d.exe --add-priority-node=99.111.67.121:12275 --add-priority-node=99.111.67.122:12275










allow-local-ip
(Daemon Configuration Option)




Allow your local IP address to be added to your daemon's peer list.


This allows you to run multiple daemons on a single machine, which is mostly used for debuging purposes.




Example


cash2d.exe --allow-local-ip










config-file
(Daemon Configuration Option)




Specify the full path to the configuration file.


The default configuration file is named "cash2.conf" located in the Cash2 data directory.




Example


cash2d.exe --config-file=file_path\cash2.conf










data-dir
(Daemon Configuration Option)




Specify the full path to the directory where the blockchain, logs, and peer list information are stored.


The default data directory is.





Example


cash2d.exe --data-dir=C:\Users\username\AppData\Roaming\cash2Test










enable-cors
(Daemon Configuration Option)




Adds header Access-Control-Allow-Origin to all Daemon RPC responses.


Use * for all.


This is useful if you want to use Cash2 Daemon RPCs directly from a web browser via JavaScript.




Example


cash2d.exe --enable-cors=*










extra-messages-file
(Daemon Configuration Option)




Specify a file for extra messages to include into coinbase transactions.


Used for mining.




Example


cash2d.exe --extra-messages-file=path_to_file/filename.txt










help
(Daemon Configuration Option)




Shows all possible command line options with a description of each.




Example


cash2d.exe --help










hide-my-port
(Daemon Configuration Option)




Do not announce yourself as a peerlist candidate.


You will still connect to other nodes, but those other nodes will not send your IP address to other nodes.




Example


cash2d.exe --hide-my-port









log-file
(Daemon Configuration Option)





Specify the full path to a log file to store output from the daemon.




Example


cash2d.exe --log-file=C:\Users\aphivantrakul\AppData\Roaming\cash2.log









log-level
(Daemon Configuration Option)




Specify the level of detail of logging messages shown by the daemon.


The default value is 2.


Possible values are 0-4.




Example


cash2d.exe --log-level=3









mining-threads
(Daemon Configuration Option)




Specify the number of threads used for mining.


By default, only 1 thread is used for mining.




Example


cash2d.exe --mining-threads=4









no-console
(Daemon Configuration Option)





Disable daemon console commands.




Example


cash2d.exe --no-console









os-version
(Daemon Configuration Option)




Shows the Cash2 software version and the OS version.




Example


cash2d.exe --os-version










p2p-bind-ip
(Daemon Configuration Option)




Specify the network interface to bind to for p2p network protocol.


The default value is 0.0.0.0 which binds to all network interfaces.




Example


cash2d.exe --p2p-bind-ip=99.111.67.121










p2p-bind-port
(Daemon Configuration Option)




TCP port to listen for P2P network protocol.


The default value is 12275.




Example


cash2d.exe --p2p-bind-port=12277










p2p-external-port
(Daemon Configuration Option)




External port for P2P network protocol (if port forwarding used with NAT).


The default value is 0.




Example


cash2d.exe --p2p-external-port=12277










print-genesis-tx
(Daemon Configuration Option)




Prints the genesis block's coinbase transaction as hexidecimal to insert into configuration file.




Example


cash2d.exe --print-genesis-tx









restricted-rpc
(Daemon Configuration Option)




Restrict Daemon RPC commands to view only commands to prevent abuse.




Example


cash2d.exe --restricted-rpc










rpc-bind-ip
(Daemon Configuration Option)




IP address to listen for RPC commands from.


The computer at the IP address will be able to remotely control your daemon through RPC commands.


The default value is localhost or 127.0.0.1 to prevent abuse.


Set the IP address to 0.0.0.0 to listen for RPC commands from any computer.




Example


cash2d.exe --rpc-bind-ip=0.0.0.0










rpc-bind-port
(Daemon Configuration Option)




TCP port to listen for RPC commands.


The default value is 12276.




Example


cash2d.exe --rpc-bind-port=12278










seed-node
(Daemon Configuration Option)




Connect to a seed node to retrieve peer addresses and disconnect.




Example


cash2d.exe --seed-node










start-mining
(Daemon Configuration Option)




Specify a wallet address for mining.




Example


cash2d.exe --start-mining=22cpHpaAGzGgUYyEgi75vy69zdhk6SMttPKEKF62BA9YZjNRQJAvrLiedFGAaaWuF7LcdP9yGnFTBZbzQK24fWYx9f6djyT










testnet
(Daemon Configuration Option)




Run the daemon in testnet mode.


Checkpoints and hardcoded seeds are ignored and the network id is changed.


Use it with --data-dir option.


The wallet mustt be launched with --testnet option.




Example


cash2d.exe --testnet --data-dir=pathToNewBlockchainFolder










version
(Daemon Configuration Option)




Prints out the Cash2 software version.




Example


cash2d.exe --version










Daemon Commands



Cash2 daemon commands allow you to get information from the daemon or to make the daemon perform certain tasks.


You can run Cash2 daemon commands only after you have started the Cash2 daemon.


You can find instructions on how to run the Cash2 daemon here




Available Daemon Commands











exit
(Daemon Command)




Saves all blockchain information and safely shuts down the daemon.


Always use this command to close the daemon or your blockchain files may become corrupt.




Example


exit



Output


None










help
(Daemon Command)




Shows all availabe commands and a description of each.




Example


help



Output



  Commands:
  exit            Shutdown the daemon
  help            Show this help
  hide_hr         Stop showing hash rate
  print_bc        Print blockchain info in a given blocks range, print_bc  []
  print_block     Print block, print_block  | 
  print_cn        Print connections
  print_pl        Print peer list
  print_pool      Print transaction pool (long format)
  print_pool_sh   Print transaction pool (short format)
  print_tx        Print transaction, print_tx 
  set_log         set_log  - Change current log level,  is a number 0-4
  show_hr         Start showing hash rate
  start_mining    Start mining for specified address, start_mining  [threads=1]
  stop_mining     Stop mining
  











hide_hr
(Daemon Command)




Stop showing the hashrate.


Used when mining.




Example


hide_hr



Output


none









print_block
(Daemon Command)




Prints detailed information about a block.




Format


print_block [height]

or


print_block [hash]




Example


print_block 2216871

or


print_block d525b10fdf79052a83d08d082c3e2ed53bc1af10dad24f5146aaf72fdf961beb




Output



  block_id: 5d1f54d8256351aca0d18b9d6da24d34c50952b17a6201f500b395d3b3c39f49
  {
    "merkle_root":"7b0dcdac5b2980d0f6a2ef46ebad2d4c4bfeee763bde967a5adf45862f777692",
    "miner_tx":
    {
      "extra":"01ef07623972ed54809101bf6df8295a65afd1671880e9360c2e28182012691914021000033535710d00000000000000000000",
      "unlock_time":2217271,
      "version":1,
      "vin":
      [
        {
          "type":"ff",
          "value":{"height":2216871}
        }
      ],
      "vout":
      [
        {"amount":2,"target":{"data":{"key":"b80d2c05f77db4f27fd01400c73b5d01acd8e92a0fb68d9509a6f4284c89e4ca"},"type":"02"}},
        {"amount":500,"target":{"data":{"key":"2e54fcd7d1e9217dbf714f266a12e75bf183695074bf58884c27f862e2aef2ec"},"type":"02"}},
        {"amount":3000,"target":{"data":{"key":"a3b671b4f74dfdd4559c9a09d81b1000ab1c0eb375ae229fb2443765e36e9a54"},"type":"02"}},
        {"amount":400000,"target":{"data":{"key":"5efc5617a8c408d5408fa786a0361471b9796c7b047129f662d242b5edc54785"},"type":"02"}},
        {"amount":3000000,"target":{"data":{"key":"b20f55a1eb28ed4451475c00bf42e380422e44b7a105ca1a3626c48602524548"},"type":"02"}},
        {"amount":80000000,"target":{"data":{"key":"2d07fff64a61c6ce2dead562eaa1be0283878551c45c19f979fa11780bde3ea4"},"type":"02"}},
        {"amount":700000000,"target":{"data":{"key":"2b054e5fc447e2c158867138233bb96c42f97936f013404f8ddd7e392bb2f1a0"},"type":"02"}}
      ]
    },
    "nonce":"fb2fdf8a00000000",
    "prev_id":"d525b10fdf79052a83d08d082c3e2ed53bc1af10dad24f5146aaf72fdf961beb",
    "timestamp":"d0384b5d00000000",
    "tx_hashes":[]
  }
  











print_cn
(Daemon Command)




Prints the connections your daemon has to other nodes in the Cash2 network.




Example


print_cn



Output



  14:50:47.866267 INFO Connections:
  14:50:47.866267 INFO Remote Host              Peer id             Recv/Sent (inactive,sec) State                    Lifetime(seconds)
  [OUT]162.42.205.220:12275 355ee58d5f897001    state_normal             588
  [OUT]162.42.205.214:12275 7c5ecccb41cb7ada    state_normal             550
  [OUT]99.111.67.121:12275  6a389c2c29471c23    state_normal             560
  [OUT]99.76.169.137:12275  b9852470df980b5f    state_normal             518
  









print_pl
(Daemon Command)




Prints a list of peer nodes that your daemon knows about.




Example


print_pl



Output



  14:54:02.016998 INFO Peerlist white:
  14:54:02.016998 INFO 355ee58d5f897001   162.42.205.220:12275    last_seen: d0.h0.m0.s6
  7c5ecccb41cb7ada        162.42.205.214:12275    last_seen: d0.h0.m0.s7
  b9852470df980b5f        99.76.169.137:12275     last_seen: d0.h0.m0.s7
  6a389c2c29471c23        99.111.67.121:12275     last_seen: d0.h0.m0.s7

  ...

  14:54:02.016998 INFO Peerlist gray:
  14:54:02.016998 INFO 73e87b15ed245ba    77.250.104.203:12275    last_seen: d0.h0.m0.s56
  71155fedf0820b  54.167.198.20:12275     last_seen: d3.h22.m17.s57
  b3d2d8132442cb63        186.14.66.57:12275      last_seen: d20.h0.m57.s28
  b3d2d8132442cb63        186.14.70.37:12275      last_seen: d20.h15.m42.s59

  ...
  










print_pool
(Daemon Command)




Print transaction pool (long format).




Example


print_pool



Output


14:55:05.053011 INFO Pool state:










print_pool_sh
(Daemon Command)




Prints the mempool (short format).




Example


print_pool_sh



Output


14:55:05.053011 INFO Pool state:










print_tx
(Daemon Command)




Prints a transaction given the hash of the transaction.




Example


print_tx 85a4eeaa7bb89d62cd8806b965aa64591af5453024369dfacff1fc718101961e



Output



  {
    "extra":"01a4aae5e67517067aea404297217de19c57e77242c4df32d0ce5494416feca90e021000011342373700000000000000000000",
    "unlock_time":2073769,
    "version":1,
    "vin":
    [
      {
        "type":"ff",
        "value":
        {
          "height":2073369
        }
      }
    ],
    "vout":
    [
      {
        "amount":4,
        "target":
        {
          "data":
          {
            "key":"9120c699d71ee2699fc74531ecbef5dee8cf203be92d97f79c1ad9b31b7d731b"
          },
          "type":"02"
        }
      },
      {
        "amount":90,
        "target":
        {
          "data":
          {
            "key":"e12fc47e4c900687002da50be5e30127e817cc9bea1fb3f1e33fc8e2c57abae6"
          },
          "type":"02"
        }
      },
      {
        "amount":900,
        "target":
        {
          "data":
          {
            "key":"ef9d65ba4d66a5b2a545708d9fe62f38f0f39d24cf51e5095ca18c713c7d4fd4"
          },
          "type":"02"
        }
      },
      {
        "amount":2000,
        "target":
        {
          "data":
          {
            "key":"3be8c677ff17119e008914a2f1dc9c5cd9ad57a6797359200f223659aa727bfe"
          },
          "type":"02"
        }
      },
      {
        "amount":30000,
        "target":
        {
          "data":
          {
            "key":"f21f6bf92b23e177b18bef715f5c4461d0934cfb991c8a330248d9070daed7af"
          },
          "type":"02"
        }
      },
      {
        "amount":100000,
        "target":
        {
          "data":
          {
            "key":"1afcf3385807c442beadb2b3cb3c8e05de9f6848f10bc7698ef1cef77fd1bf38"
          },
          "type":"02"
        }
      },
      {
        "amount":90000000,
        "target":
        {
          "data":
          {
            "key":"bd95e56a07d608d47d37720cf01bc9ea859ace58bd89cf1679545d757e0049f8"
          },
          "type":"02"
        }
      },
      {
        "amount":700000000,
        "target":
        {
          "data":
          {
            "key":"03ae9c7c3620e76a3f390b3fb5ea81fdcaadd2f22ced24dbf52fe167b8b8b5ce"
          },
          "type":"02"
        }
      }
    ]
  }
  












set_log
(Daemon Command)




Change the current log level.




Example


set_log 4



Output


none










show_hr
(Daemon Command)




Start showing the hashrate.


Used during mining.




Example


show_hr



Output


Mining is not started, you need to start mining before you can see the hash rate.










start_mining
(Daemon Command)




Start mining in the daemon.




Example


start_mining 29T1BSUYkYpQnbP9xXuex62yBoPZZe7whZn99ngSqP476PLYoN4WewTFxDx2Gc4k2xDXWh1sYqCkhZpAdrwPVFkKRTCMzky



Output


Miner thread was started [0]. Mining has started with 1 threads, good luck!










stop_mining
(Daemon Command)




Stop mining in the daemon.




Example


stop_mining



Output


Miner thread stopped [0]. Mining has been stopped, 0 finished










Daemon HTTP RPC



The Daemon HTTP RPC is an HTTP server that provides information about a node in the Cash2 network.



The default way to start the Cash2 Daemon RPC server is to run cash2d.exe --restricted-rpc.



You can specify the IP address of the Daemon RPC server by running cash2d.exe --restricted-rpc --rpc-bind-ip=your_ip_address.



You can run cash2d.exe --restricted-rpc --rpc-bind-ip=0.0.0.0 to allow your Daemon RPC server to be accessed by other people.


You can specify the port of the Daemon RPC server by running cash2d.exe --restricted-rpc --rpc-bind-port=your_port_number.



You can specify the IP address and the port of the Daemon RPC server by running cash2d.exe --restricted-rpc --rpc-bind-ip=your_ip_address --rpc-bind-port=your_port_number.






Available Daemon HTTP RPC Methods











getheight
(Daemon HTTP RPC)




Returns the current blockchain height.




URL


http://localhost:12276/getheight



Output



  {
    "height":1910821,
    "status":"OK"
  }
  










getinfo
(Daemon HTTP RPC)




Returns information about the Cash2 network.




URL


http://localhost:12276/getinfo



Output



  {
    "alt_blocks_count":0,
    "circulating_supply":"1614723.717563120",
    "difficulty":2581,
    "dust_threshold":0,
    "grey_peerlist_size":199,
    "height":1910839,
    "incoming_connections_count":0,
    "last_known_block_index":1910838,
    "min_tx_fee":10000000,
    "outgoing_connections_count":5,
    "status":"OK",
    "tx_count":309814,
    "tx_pool_size":0,
    "white_peerlist_size":10
  }
  










gettransactions
(Daemon HTTP RPC)




Returns a list of missed transactions.




URL


http://localhost:12276/gettransactions



Output



  {
    "missed_tx":[],
    "status":"OK",
    "txs_as_hex":[]
  }
  










Daemon JSON RPC



Introduction


The Daemon JSON RPC is an HTTP server that provides a JSON 2.0 RPC interface for interacting with a node in the Cash2 network.


Start the Cash2 daemon cash2d.exe --rpc-bind-ip=0.0.0.0 --rpc-bind-port=12276.


Access the Daemon JSON RPC server at http://localhost:12276/json_rpc or http://[your ip address]:12276/json_rpc using Postman.





Available Daemon JSON RPC Methods











check_tx_key
(Daemon JSON RPC)




Tells whether a transaction was successfully sent.


Useful for the block explorers.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"check_tx_key",
    "params":{
      "txid": "9734d2b730075dc5425a05111d9ef9fa930d96c5be65af902686ceb98689a403",
      "txkey": "3f334ae764643ff29c1a681d09822d2f94e5975af8e13f9d0cb1656b67e21166",
      "address":"2AgytUhQX77aSAFdUxEABrFSymTaM9uwyPty1wJu6DcTTvEZNHdJ1JkTDpnjKkyPpfRb2tzxVRLPgUWsXYpJiocnNvWUikb" 
    }
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "amount": 1000000000,
      "outputs": [
        {
          "amount": 5000000000,
          "target": {
            "data": {
              "key": "1bfc041a3e5f2b0b9f65db3f7fa9ccc36077d43c327561871ba3865f310dd429"
            },
            "type": "02"
          }
        }
      ],
      "status": "OK"
    }
  }
  










f_block_json
(Daemon JSON RPC)




Returns information about a block given the block hash.


Useful for the block explorers.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"f_block_json",
    "params":{
      "hash":"dec33c2877d51af99ddaaab93d060e4a0a33afdb569447942e90d758c0c47bbb"
    }
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "block": {
        "alreadyGeneratedCoins": "1620179725975105",
        "alreadyGeneratedTransactions": 2227826,
        "baseReward": 797499482,
        "blockSize": 465,
        "depth": 296,
        "difficulty": 2543,
        "effectiveSizeMedian": 140696951834568,
        "hash": "dec33c2877d51af99ddaaab93d060e4a0a33afdb569447942e90d758c0c47bbb",
        "height": 1917678,
        "merkle_root": "c4e87dc21af10c5399689da2a164058560cdab700db211f0ff6b93936888c9de",
        "nonce": 935965606,
        "orphan_status": false,
        "penalty": 0,
        "prev_hash": "6567d47b1dbebb90a4c9d12bb03324f095f03139b51dc369001cb87b18c4ca28",
        "reward": 797499482,
        "sizeMedian": 1077703335680,
        "timestamp": 1562519256,
        "totalFeeAmount": 0,
        "transactions": [
          {
            "amount_out": 797499482,
            "fee": 0,
            "hash": "23a39057255250d956f57159968b275c78cb3f0c68b500623c209731f67373fc",
            "size": 384
          }
        ],
        "transactionsCumulativeSize": 384
      },
      "status": "OK"
    }
  }
  










f_blocks_list_json
(Daemon JSON RPC)




Returns information of the previous 30 blocks starting from the block at the specified height.


Useful for the block explorers.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"f_blocks_list_json",
    "params":{
      "height":1917708
    }
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "blocks": [
        {
          "cumul_size": 430,
          "difficulty": 2544,
          "hash": "fd6a2f2d1e4af1ede5559ee950d0bb378ae15f6727a978df5040922cc16ead31",
          "height": 1917708,
          "min_tx_fee": 10000000,
          "timestamp": 1562519591,
          "tx_count": 1
        },
        {
          "cumul_size": 430,
          "difficulty": 2544,
          "hash": "43fa1d97c69ac017745b74ec8cb0b44bc5c9eaf59c15447828cbc11e8d6c3378",
          "height": 1917707,
          "min_tx_fee": 10000000,
          "timestamp": 1562519580,
          "tx_count": 1
        },
        {
          "cumul_size": 464,
          "difficulty": 2543,
          "hash": "4a9bced7eb8ad5b9c7af0c9626d4dc5a6613bf2141fcb2e99da153e7418a3d02",
          "height": 1917706,
          "min_tx_fee": 10000000,
          "timestamp": 1562519578,
          "tx_count": 1
        },

        [ 28 more blocks omitted ]

      ],
      "status": "OK"
    }
  }
  










f_mempool_json
(Daemon JSON RPC)




Returns information about mempool.


Useful for the block explorers.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"f_mempool_json"
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "mempool": [
        {
          "amount_out": 13634820631,
          "fee": 50000000,
          "hash": "4561b9f642b1ad3da4220546bfd21c425878899173ed3085c49ed183d5ad8b43",
          "keptByBlock": false,
          "last_failed_height": 0,
          "last_failed_id": "0000000000000000000000000000000000000000000000000000000000000000",
          "max_used_block_height": 1918226,
          "max_used_block_id": "391545a4cc78005a0e3b83dedb54065e06cd8e74c437546d93568aadc36abcc9",
          "receiveTime": 1562526625,
          "size": 22651
        }
      ],
      "status": "OK"
    }
  }
  










f_transaction_json
(Daemon JSON RPC)




Returns information about a transaction given the transaction hash.


Useful for the block explorers.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"f_transaction_json",
    "params":{
      "hash":"dec33c2877d51af99ddaaab93d060e4a0a33afdb569447942e90d758c0c47bbb"
    }
  }

  



Output



  {
  "jsonrpc": "2.0",
  "result": {
    "block": {
      "cumul_size": 430,
      "difficulty": 1,
      "hash": "fd6a2f2d1e4af1ede5559ee950d0bb378ae15f6727a978df5040922cc16ead31",
      "height": 1917708,
      "min_tx_fee": 34,
      "timestamp": 1562519591,
      "tx_count": 1
    },
    "status": "OK",
    "tx": {
      "extra": "0132bd77eb67747315f77f3429f870a5a8c4a8ce18fdc6bd6e2a3dfc62fb3cdb3d021000012334380900000000000000000000",
      "unlock_time": 1918108,
      "version": 1,
      "vin": [
        {
          "type": "ff",
          "value": {
            "height": 1917708
          }
        }
      ],
      "vout": [
        {
          "amount": 6,
          "target": {
            "data": {
              "key": "c58ec937c99bb6e6134205d4b61116e9c0ffbec94dff73c7e6b769fc5b3e74b0"
            },
            "type": "02"
          }
        },
        {
          "amount": 50,
          "target": {
            "data": {
              "key": "58046b444cef4b52cbc1b684cb5642f136b1820623d0d714272c412a0c1b7647"
            },
            "type": "02"
          }
        },
        {
          "amount": 8000,
          "target": {
            "data": {
              "key": "6756f6628d5425389451aeef7697673325c22d990f591da92b6061f05dec7988"
            },
            "type": "02"
          }
        },
        {
          "amount": 90000,
          "target": {
            "data": {
              "key": "d1c26df68751678a140e2709bca266e5ffa9ca6eda65dd538080ff248f1d1a99"
            },
            "type": "02"
          }
        },
        {
          "amount": 400000,
          "target": {
            "data": {
              "key": "a53ea8fa7709b9bb000d128cf5ca231f7c6f7ea1a367f94fb473089f9ec569c2"
            },
            "type": "02"
          }
        },
        {
          "amount": 7000000,
          "target": {
            "data": {
              "key": "e70f3f0e07d8e66b5aa60cc356eb814eaa66551ca6e367f2f7ca15a2e54c52df"
            },
            "type": "02"
          }
        },
        {
          "amount": 90000000,
          "target": {
            "data": {
              "key": "b2219e39caa34d468647af93efc1f6d3199d008ce94fdec2769978cc1819e6f5"
            },
            "type": "02"
          }
        },
        {
          "amount": 700000000,
          "target": {
            "data": {
              "key": "059989cb3ea20539ead3c36c5c47febf182fe5ee85140b51719b38f602846740"
            },
            "type": "02"
          }
        }
      ]
    },
    "txDetails": {
      "amount_out": 797498056,
      "fee": 0,
      "hash": "60521e4881aed1af3f44c02acae579ad8b9d789fdcc8737b0a50bf779c924e57",
      "mixin": 0,
      "paymentId": "",
      "size": 349
    }
  }
  










getblockcount
(Daemon JSON RPC)




Returns the current blockchain height.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getblockcount",
    "params":{}
  }
  



Output



  {
    "height":1910821,
    "status":"OK"
  }
  










getblockheaderbyhash
(Daemon JSON RPC)




Returns a block's header information given the block's hash.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getblockheaderbyhash",
    "params":{
      "hash":"cf26d26d9bde6aa68f1829e0e36df1b61f37c925c8fcade429554b375078b738"
    }
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "block_header": {
        "depth": 1863747,
        "difficulty": 1,
        "hash": "cf26d26d9bde6aa68f1829e0e36df1b61f37c925c8fcade429554b375078b738",
        "height": 0,
        "merkle_root": "a68e7307c49afc4aaf9cf797e5550e6ca3cf2e0c23a95f05df01a3bf9276f680",
        "nonce": 0,
        "orphan_status": false,
        "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
        "reward": 894069671,
        "timestamp": 0
      },
      "status": "OK"
    }
  }
  










getblockheaderbyheight
(Daemon JSON RPC)




Returns a block's header information given the block's height.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getblockheaderbyheight",
    "params":{
      "height":0
    }
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "block_header": {
        "depth": 1863747,
        "difficulty": 1,
        "hash": "cf26d26d9bde6aa68f1829e0e36df1b61f37c925c8fcade429554b375078b738",
        "height": 0,
        "merkle_root": "a68e7307c49afc4aaf9cf797e5550e6ca3cf2e0c23a95f05df01a3bf9276f680",
        "nonce": 0,
        "orphan_status": false,
        "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
        "reward": 894069671,
        "timestamp": 0
      },
      "status": "OK"
    }
  }
  










getblocktemplate
(Daemon JSON RPC)




Returns a block template to be used for mining.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getblocktemplate",
    "params":{
      "reserve_size" : 60,
      "wallet_address" : "25ekxezbYiydhjdz8akuuTQ1cVsfSNFAgZEx2sb5en4HVyeJrX2Uv6yNoV18bpb3sPC1vdKRyJMihNpQjXmtMXpj4SoV39b"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "blocktemplate_blob": "031563708bbb5d725044b3cc420e8ee7272af5f5b3641038cac0fe02dd9f79e1000000000000000080b61a5d00000000d824bc27aeccdcce9950df91f668f72c696ea98c2ce0d95efefbc5d390b1bbf801e5e27101ffd5df7106050272136c32f07929ab024c93bf8e703f0430bd07921b23254ca3dbcbdfb9163246280258a38193f64006636b256fcd959ad1e2e2c5f993c7aaf0ec1494028f8950bbe3900302681825041ac9bf600921de8c0ca31b8574f22311b9ecb64b7bec49ee403fd49ed00f02a18ef4212a7052db4b310389767c1cdd5aa10eafc284f3cd5317857c511f8585f0a20402f645639f72c584a2068da504b7fcb8f21c21f73279c3f9d92c675d30fdf5c03c8090bcfd0202ec3ca1f0e71002a568c92ac99681c420f8ae7b54ebf4b5f899c95d23dbb3e3735f01df5181d34fc128d4a19140d743e67611c801979669c177a5993a66ef9faac1d9023c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "coinbase_tx": "01e5e27101ffd5df7106050272136c32f07929ab024c93bf8e703f0430bd07921b23254ca3dbcbdfb9163246280258a38193f64006636b256fcd959ad1e2e2c5f993c7aaf0ec1494028f8950bbe3900302681825041ac9bf600921de8c0ca31b8574f22311b9ecb64b7bec49ee403fd49ed00f02a18ef4212a7052db4b310389767c1cdd5aa10eafc284f3cd5317857c511f8585f0a20402f645639f72c584a2068da504b7fcb8f21c21f73279c3f9d92c675d30fdf5c03c8090bcfd0202ec3ca1f0e71002a568c92ac99681c420f8ae7b54ebf4b5f899c95d23dbb3e3735f01df5181d34fc128d4a19140d743e67611c801979669c177a5993a66ef9faac1d9023c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "difficulty": 2571,
      "height": 1863637,
      "reserved_offset": 339,
      "status": "OK",
      "transaction_hashes": [
        "4aa6769601b78d6b85c6a7d3005358d083117dd410ff8b303101f5476d166b96"
      ]
    }
  }
  










getcurrencyid
(Daemon JSON RPC)




Returns the hash of the genesis block.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getcurrencyid"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "currency_id_blob": "cf26d26d9bde6aa68f1829e0e36df1b61f37c925c8fcade429554b375078b738"
    }
  }
  










getlastblockheader
(Daemon JSON RPC)




Returns the hash of most recent block in the blockchain.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"getlastblockheader"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "block_header": {
        "depth": 0,
        "difficulty": 2568,
        "hash": "03dcce225b4b5a59258bb69a44c8b5627f1760736bdf7036cbfcc159625374c2",
        "height": 1863715,
        "merkle_root": "69ea764c25c9ad565499aca90dd5186def8cbc5ad6337d0f561ced2e0b9a0532",
        "nonce": 1412096920,
        "orphan_status": false,
        "prev_hash": "0b468f6f965ae224afa1c531b1e38640a34c625c5db9322da529d36baed0baec",
        "reward": 800068725,
        "timestamp": 1562032365
      },
      "status": "OK"
    }
  }
  










submitblock
(Daemon JSON RPC)




Submits a block to be added to the blockchain.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"submitblock",
    "params":[
      "031563708bbb5d725044b3cc420e8ee7272af5f5b3641038cac0fe02dd9f79e1000000000000000080b61a5d00000000d824bc27aeccdcce9950df91f668f72c696ea98c2ce0d95efefbc5d390b1bbf801e5e27101ffd5df7106050272136c32f07929ab024c93bf8e703f0430bd07921b23254ca3dbcbdfb9163246280258a38193f64006636b256fcd959ad1e2e2c5f993c7aaf0ec1494028f8950bbe3900302681825041ac9bf600921de8c0ca31b8574f22311b9ecb64b7bec49ee403fd49ed00f02a18ef4212a7052db4b310389767c1cdd5aa10eafc284f3cd5317857c511f8585f0a20402f645639f72c584a2068da504b7fcb8f21c21f73279c3f9d92c675d30fdf5c03c8090bcfd0202ec3ca1f0e71002a568c92ac99681c420f8ae7b54ebf4b5f899c95d23dbb3e3735f01df5181d34fc128d4a19140d743e67611c801979669c177a5993a66ef9faac1d9023c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    ]
  }

  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "status" : "OK"
    }
  }
  










Walletd Introduction



The Cash2 Walletd allows you to run a wallet on one computer and remotely control that wallet from another computer using a JSON 2.0 RPC interface.


Please write down and keep safe the spend private keys and view private keys of each wallet continaer file you generate as well as any additional addresses you create inside the wallet container file. Wallet files can become corrupted, and the only way to recover the funds will be with the private keys.











How to Run the Walletd



Start the Cash2 daemon (detailed instructions here) :

cash2d.exe --restricted-rpc



Generate a new wallet container :

walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --generate-container



Start Walletd :

walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --daemon-port=12276










Walletd Configuration Options



You can control how the Cash2 Walletd will run by sepcifiying certain options :




You can specify a single option or multiple options.


In this section, we discuss all the available options for you to configure Walletd.




Available Options











add-exclusive-node
(Walletd Configuration Option)




Specify peers nodes you only want your daemon to connect to.


If this option is given the options add-priority-node and seed-node are ignored.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --add-exclusive-node=99.111.67.121:12275
  










add-peer
(Walletd Configuration Option)




Manually add a peer to your peerlist.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --add-peer=99.111.67.121:12275
  










add-priority-node
(Walletd Configuration Option)




Specify peer nodes to connect to and attempt to keep the connection open.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --add-priority-node=99.111.67.121:12275
  










address
(Walletd Configuration Option)




Prints all addresses in the wallet container.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --address
  










allow-local-ip
(Walletd Configuration Option)




Allow local IP address to be added to the peer list.


Used mostly for debugging purposes.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --allow-local-ip
  










bind-address
(Walletd Configuration Option)




Payment service bind IP address.


Default value is 0.0.0.0.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --bind-address=99.76.169.138
  










bind-port
(Walletd Configuration Option)




This is the port you will use to interact remotely with Walletd.


The default port is 12277


Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --bind-port=12278
  










config
(Walletd Configuration Option)




Specify a configuration file.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --config=file_path\walletd.conf
  










container-file
(Walletd Configuration Option)




Specify a name for your wallet container file.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword
  










container-password
(Walletd Configuration Option)




Specify a password for your wallet container file.


You will need this password to open you wallet container file in the future.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword
  










daemon
(Walletd Configuration Option)




Run as daemon in Unix or as service in Windows.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --daemon
  










daemon-address
(Walletd Configuration Option)




Specify the IP adddress of the computer running the daemon your Walletd will connect to.


In most cases, your daemon and RPC wallet will be running on the same machine.


The default value for daemon-address is localhost.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --daemon-address=99.111.67.121
  










daemon-port
(Walletd Configuration Option)




The port that Walletd will use to connect to the daemon.


The default value for daemon-address is 12276.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --daemon-port=12278
  










data-dir
(Walletd Configuration Option)




Specify the full path to a directory where the blockchain, logs, and peer list information are stored.


The default data directory is.





Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --data-dir=C:\Users\username\AppData\Roaming\cash2Test
  










generate-container
(Walletd Configuration Option)




Generate a new wallet container file and exit.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword  --generate-container
  










help
(Walletd Configuration Option)




Shows all Cash2 RPC wallet configuration options and a description of each.




Input


walletd.exe --help



Output



  Common Options:
    -c [ --config ] arg                   configuration file
    -h [ --help ]                         produce this help message and exit
    --local                               start with local node (remote is
                                          default)
    --testnet                             testnet mode

  ...
  










hide-my-port
(Walletd Configuration Option)




Do not announce yourself as a peerlist candidate.


You will still connect to other nodes, but those other nodes will not send your IP address to other nodes.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword  --hide-my-port
  










local
(Walletd Configuration Option)




Start with local daemon (remote daemon is the default).




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --local
  










log-file
(Walletd Configuration Option)




Specify the full path to a log file to store output from the daemon.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --log-file=C:\Users\aphivantrakul\AppData\Roaming\cash2.log
  










log-level
(Walletd Configuration Option)




Specify the level logging detail produced by the daemon.


The default value is 2


Possible values are 0-4 with 4 being the most detailed.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --log-level=4
  










p2p-bind-ip
(Walletd Configuration Option)




Specify the network interface to bind to for p2p network protocol.


The default value is 0.0.0.0 which binds to all network interfaces.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --p2p-bind-ip=99.111.67.121
  










p2p-bind-port
(Walletd Configuration Option)




Specify the TCP port to listen for P2P network protocol.


The default value is 12275.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --p2p-bind-port=12277
  










p2p-external-port
(Walletd Configuration Option)




External port for P2P network protocol (if port forwarding used with NAT).


The default value is 0


Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --p2p-external-port=12277
  










seed-node
(Walletd Configuration Option)




Connect to a seed node to retrieve peer addresses and disconnect.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --seed-node
  










spend-private-key
(Walletd Configuration Option)




Allows you to restore a wallet from private keys.


Must specify both the spend private key and view private key.


Must also include the --generate-container flag.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --spend-private-key=6aca22914034a8868ce455eaad7b90aaae02dfbfb5e5e562d8cdc4c273625243 --view-private-key=106efffb0777f9e68138e07cb5500fcfe7af9a8c1d1dd00c0c8ffd46dab0d212 --generate-container
  










testnet
(Walletd Configuration Option)




Run Walletd in testnet mode.


Checkpoints and hardcoded seed nodes are ignored and the network id is changed.


Use it with --data-dir option.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --testnet --data-dir=pathToNewBlockchainFolder
  










view-private-key
(Walletd Configuration Option)




Restore a wallet from private keys.


Must specify both the spend private key and view private key.


Must also include the --generate-container flag.




Input



  walletd.exe --container-file=myWalletContainer --container-password=myWalletContainerPassword --spend-private-key=6aca22914034a8868ce455eaad7b90aaae02dfbfb5e5e562d8cdc4c273625243 --view-private-key=106efffb0777f9e68138e07cb5500fcfe7af9a8c1d1dd00c0c8ffd46dab0d212 --generate-container
  









Walletd JSON RPC



Introduction


The Walletd JSON RPC is an HTTP server that provides a JSON 2.0 RPC interface for interacting remotely with a Cash2 wallet


Start the Cash2 daemon cash2d.exe --rpc-bind-ip=0.0.0.0 --rpc-bind-port=12276


Generate a new wallet container walletd.exe -w myWalletContainer -p myPassword -g


Start the wallet container walletd.exe -w myWalletContainer -p myPassword --daemon-port 12276


Access the Daemon HTTP RPC server at http://localhost:8070/json_rpc or http://[your ip address]:8070/json_rpc using Postman




Available Walletd JSON RPC Methods











createAddress
(Walletd JSON RPC)




Creates an additional address in your RPC wallet container


The new address has the same view private key as your RPC wallet container but a different spend private key


Please write down and keep safe the spend private key and view private key of every address you create. Wallet files can become corrupted, and the only way to recover the funds will be with the private keys.




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"createAddress"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "address": "2Ao5ezDqPXmj6w9JqBDQkeD3R3yD6XdmiL9P9YCasUoXLuhoJ6cJK3d9C7YnASH6p6S8sizsWayLhNmrscnDWN8MKAKgz5o"
    }
  }
  










createDelayedTransaction
(Walletd JSON RPC)




Creates a delayed transaction




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"createDelayedTransaction",
    "params":{  
      "anonymity":3,
      "fee":10000000,
      "unlockTime":0,
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ],
      "transfers":[  
        {  
          "amount":3000000000,
          "address":"27YZbjsyYo3M42dhWVZ6pbF89cUoofxorLuwzVaSbBC6GjAywv8y7Mh9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK8kTssA"
        }
      ],
      "changeAddress":"26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transactionHash": "a5783b5c92ad04fdd0f588f6986712dac21bdbad5845937af3aad87bc8d6ea06"
    }
  }
  










deleteAddress
(Walletd JSON RPC)




Deletes an address from your RPC wallet container




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"deleteAddress",
    "params":{  
      "address":"29aVgyGuRrDMqAgQyCCcR9HYC8hej9NbkMznZnke7wq3TwA3t111rHM9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK8a92CZ"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









deleteDelayedTransaction
(Walletd JSON RPC)




Deletes a delayed transaction




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"deleteDelayedTransaction",
    "params":{  
      "transactionHash":"fc059b7293bf7dc4570986b96399e829474083062d213c70474d08d76756a519"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









getAddresses
(Walletd JSON RPC)




Returns all the addresses in the RPC wallet container




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getAddresses"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "addresses": [
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  










getBalance
(Walletd JSON RPC)




Returns the balance for a specified address in terms of the smallest unit


For example, a returned balance of 10000000000 is equivalent to 10 CASH2 because Cash2 uses 9 decimal places


If an address is not specified, returns the total balance of all addresses in the RPC wallet container




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getBalance"
  }
  


or




  {  
    "method":"getBalance",
    "params":{  
      "address":"26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "availableBalance": 10000000000,
      "lockedAmount": 0
    }
  }
  










getBlockHashes
(Walletd JSON RPC)




Returns block hashes starting from a specific height and going upwards




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"getBlockHashes",
    "params":{  
      "blockCount":5,
      "firstBlockIndex":0
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "blockHashes": [
        "cf26d26d9bde6aa68f1829e0e36df1b61f37c925c8fcade429554b375078b738",
        "114201ae0751311ef8789b5c681829c51fd9a30116501326ebb45460f617e4e4",
        "a022eac003ff6e237ec5450ce254d4360ce3fe3254c1357680312ba844088926",
        "bf61497e4e84a9b3bf288bef245ed63860f1ac59c2f45100ed7f07dfb7c62a11",
        "ee0b9306e2ed198dd95a5c465bffb4cbf5f10acf031d038a1e3f1fb510f6e97e"
      ]
    }
  }
  










getDelayedTransactionHashes
(Walletd JSON RPC)




Returns the hash of a delayed transaction




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getDelayedTransactionHashes"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transactionHashes": [
        "301d5ddfa3549f4f321afc11ed5fad48b56518d05d6dfa46a9fdeb1617355d3b"
      ]
    }
  }
  










getSpendKeys
(Walletd JSON RPC)




Returns the spend public key and the spend private key of an address in your RPC wallet container




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"getSpendKeys",
    "params":{  
      "address":"26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "spendPublicKey": "be1b259c221df8c294903b1bd074b6b123133bf5b4e29fc22a234ecd6db586f1",
      "spendSecretKey": "c6f22fdd8729a35293ccae336299723d544842b759d580ac1b4ae385c0eb0b49"
    }
  }
  










getStatus
(Walletd JSON RPC)




Returns information about the current RPC wallet state




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getStatus"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "blockCount": 1898482,
      "knownBlockCount": 1898482,
      "lastBlockHash": "acf0b5465bbf97b34bed96e9845fc228469537ed5d996420cb7c3b9d3cb3a958",
      "peerCount": 5
    }
  }
  










getTransaction
(Walletd JSON RPC)




Returns information about a transaction given the hash of the transaction




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getTransaction",
    "params":{  
      "transactionHash":"de59ba060e4b516377ce60f5cd6f8f0307ac145aac4168aca33db32c1b37be32"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transaction": {
        "amount": -10000000,
        "blockIndex": 1899553,
        "extra": "015954530934aa32528cfab75451cd8cf7d8b1cb2539358760aada548c87605940",
        "fee": 10000000,
        "isBase": false,
        "paymentId": "",
        "state": 0,
        "timestamp": 1562356690,
        "transactionHash": "de59ba060e4b516377ce60f5cd6f8f0307ac145aac4168aca33db32c1b37be32",
        "transfers": [
          {
            "address": "21F1cNkFJMuSdkhhaSFEex6pXSFEmAFEUb4LBHZpNGE662Hw4FjQCEb9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK8eZhs6",
            "amount": 2000000000,
            "type": 0
          },
          {
            "address": "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6",
            "amount": 7990000000,
            "type": 2
          },
          {
            "address": "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6",
            "amount": -10000000000,
            "type": 0
          }
        ],
        "unlockTime": 0
      }
    }
  }
  










getTransactionHashes
(Walletd JSON RPC)




Returns an array of block and transaction hashes given a specific criteria




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"getTransactionHashes",
    "params":{  
      "blockCount":1,
      "firstBlockIndex":1899553,
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  


or




  {  
    "method":"getTransactionHashes",
    "params":{  
      "blockCount":1,
      "blockHash":"d20f501a16cf1ea3268d47e8119303200ca8301479e30cc33fb086ef529373a3",
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  


or




  {  
    "method":"getTransactionHashes",
    "params":{  
      "blockCount":1,
      "firstBlockIndex":1899553,
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ],
      "paymentId":"319a2bea4e97218681428d39a1a61672cfbe12ac3ba1697c170012032e224b4c"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "items": [
        {
          "blockHash": "d20f501a16cf1ea3268d47e8119303200ca8301479e30cc33fb086ef529373a3",
          "transactionHashes": [
            "de59ba060e4b516377ce60f5cd6f8f0307ac145aac4168aca33db32c1b37be32"
          ]
        }
      ]
    }
  }
  










getTransactions
(Walletd JSON RPC)




Returns an array of block hashes and transaction information given a specific criteria




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"getTransactions",
    "params":{  
      "blockCount":1,
      "firstBlockIndex":1899553,
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  


or




  {  
    "method":"getTransactions",
    "params":{  
      "blockCount":1,
      "blockHash":"d20f501a16cf1ea3268d47e8119303200ca8301479e30cc33fb086ef529373a3",
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  


or




  {  
    "method":"getTransactions",
    "params":{  
      "blockCount":1,
      "firstBlockIndex":1899553,
      "paymentId":"319a2bea4e97218681428d39a1a61672cfbe12ac3ba1697c170012032e224b4c"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "items": [
        {
          "blockHash": "d20f501a16cf1ea3268d47e8119303200ca8301479e30cc33fb086ef529373a3",
          "transactions": [
            {
              "amount": -10000000,
              "blockIndex": 1899553,
              "extra": "015954530934aa32528cfab75451cd8cf7d8b1cb2539358760aada548c87605940",
              "fee": 10000000,
              "isBase": false,
              "paymentId": "",
              "state": 0,
              "timestamp": 1562356690,
              "transactionHash": "de59ba060e4b516377ce60f5cd6f8f0307ac145aac4168aca33db32c1b37be32",
              "transfers": [
                {
                  "address": "21F1cNkFJMuSdkhhaSFEex6pXSFEmAFEUb4LBHZpNGE662Hw4FjQCEb9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK8eZhs6",
                  "amount": 2000000000,
                  "type": 0
                },
                {
                  "address": "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6",
                  "amount": 7990000000,
                  "type": 2
                },
                {
                  "address": "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6",
                  "amount": -10000000000,
                  "type": 0
                }
              ],
              "unlockTime": 0
            }
          ]
        }
      ]
    }
  }
  










getUnconfirmedTransactionHashes
(Walletd JSON RPC)




Returns hashes of unconfirmed transactions in the mempool for specified addresses




URL


http://localhost:8070/json_rpc



Input



  {  
    "method":"getUnconfirmedTransactionHashes",
    "params":{  
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ]
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transactionHashes": [
        "7306197178d39f8a503b13c54e233c282278e3e0e041c6055857b9282560baae"
      ]
    }
  }
  










getViewKey
(Walletd JSON RPC)




Returns the view private key for the RPC wallet container


All addresses in the RPC wallet container have the same view private key but have different spend private keys





URL


http://localhost:8070/json_rpc



Input



  {
    "method":"getViewKey"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "viewSecretKey": "864efbb71c4038a1156362139c2f3dc4c3ba78c557e5d7d62f77f676ef257e37"
    }
  }
  










reset
(Walletd JSON RPC)




Allows you to resynchronize your wallet




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"reset"
  }
  


or




  {
    "method":"reset",
    "params":{
      "viewSecretKey":"eaad1e1dd6168635b56814c1f574553f328bf9aecf2e7da8251c238960225784"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









sendDelayedTransaction
(Walletd JSON RPC)




Sends a delayed transaction




URL


http://localhost:8070/json_rpc



Input



  {
    "method":"sendDelayedTransaction",
    "params":{  
       "transactionHash":"593ab9cbfd7ab6ac7c2a248fdd0c2b67e48703d4831919d4c0ac9bc5a556502e"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









sendTransaction
(Walletd JSON RPC)




Sends a transaction





URL


http://localhost:8070/json_rpc



Input



  {
    "method":"sendTransaction",
    "params":{  
      "anonymity":3,
      "fee":10000000,
      "unlockTime":0,
      "addresses":[  
        "26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
      ],
      "transfers":[  
        {  
          "amount":2000000000,
          "address":"21F1cNkFJMuSdkhhaSFEex6pXSFEmAFEUb4LBHZpNGE662Hw4FjQCEb9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK8eZhs6"
        }
      ],
      "changeAddress":"26UHcCfQFYLeR3C1nJcztPCDBmu1NbhMv6hdwmDb5tSqHPyg19QwYRm9C7YnASH6p6S8sizsWayLhNmrscnDWN8MK4ibNY6"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transactionHash": "8c15032a75c350fd4878bbd521d8660fc4ab003e3d7096e2a240ea2d59a7b56c",
      "transactionSecretKey": "c639543080844bab98dac07342e3d3c8163123583c36420b16df0284a0842b2d"
    }
  }
  










SimpleWallet Introduction



Introduction


The Cash2 SimpleWallet is a command line program that allows you to check your balance, send money, receive money, and view your transaction history.


SimpleWallet must be connected to a Cash2 daemon that is fully synchronized before it will work properly.


You can connect SimpleWallet to a local Cash2 daemon or to a remote node.


Please write down and keep safe the spend private key and view private key of each wallet you create. Wallet files can become corrupted, and the only way to recover the funds will be with the private keys.



Local Daemon


The recommended way to use SimpleWallet is to connect it to a Cash2 daemon running locally on your computer.


To do this, you must first run the Cash2 daemon cash2d and wait for your copy of the blockchain to fully synchronize.


This means that you will have to keep a copy of the entire Cash2 blockchain on your computer.


The instructions on how to run the Cash2 daemon can be found here


After the blockchain is fully synchronized, you are ready to run SimpleWallet (How to run SimpleWallet).



Remote Node


SimpleWallet can also connect to a Cash2 daemon running on a remote computer.


The remote computer is usually already synchronized and allow you to use SimpleWallet quickly.


The remote Cash2 daemon and peer will not have access to your SimpleWallet private keys.


This means that you can connect SimpleWallet to a remote node without the risk of your funds being stolen.


However, this is less private than if you were to connect to your own local Cash2 daemon, which is the recommended way.











How to Run SimpleWallet



You can run the Cash2 SimpleWallet from the command line by doing the following :











SimpleWallet Configuration Options



You can configure how SimpleWallet will run by sepcifiying certain options :




You can specify a single option or multiple options.


You must include -- before each option name. For example simplewallet.exe --help.


In this section, we discuss all the available options for you to configure SimpleWallet.




Available SimpleWallet Options











daemon-address
(SimpleWallet Configuration Option)




Connect the wallet to a remote Cash2 daemon.


Must specify the remote daemon's IP address and the daemon's port.


By default, the Cash2 wallet connects to your local daemon, and the default IP address is 127.0.0.1 and the default port is 12276.




Input


simplewallet.exe --daemon-address=wallet.cash2.org:12276










daemon-host
(SimpleWallet Configuration Option)




Specify the IP address of the remote daemon to connect your wallet to.


Must also specify the remote daemon's port using the option --daemon-port.




Input


simplewallet.exe --daemon-host=wallet.cash2.org --daemon-port=12276










daemon-port
(SimpleWallet Configuration Option)




Specify the IP address of the remote daemon to connect your wallet to.


Must also specify the remote daemon's IP address using the option --daemon-host.




Input


simplewallet.exe --daemon-host=wallet.cash2.org --daemon-port=12276










generate-new-wallet
(SimpleWallet Configuration Option)




Create a new wallet by specifying the name of your new wallet.


You will then be asked to provide a password for your new wallet.




Input


simplewallet.exe --generate-new-wallet=myNewWallet










help
(SimpleWallet Configuration Option)




Shows all availabe wallet configuration options and a description of each.




Input


simplewallet.exe --help



Output



  Usage:
  simplewallet [--wallet-file=<file>|--generate-new-wallet=<file>] [--daemon-address=<host>:<port>] [<COMMAND>]

  General options:
    --help                          Produce help message
    --version                       Output version information

  Wallet options:
    --wallet-file arg               Use wallet 
    --generate-new-wallet arg       Generate new wallet and save it to 
    --password arg                  Wallet password

  ...
  










password
(SimpleWallet Configuration Option)




Specify the password for the wallet you want to open.


Should also be used with the option --wallet-file.




Input


simplewallet.exe --wallet-file=myNewWallet --password=myNewWalletPassword










set_log
(SimpleWallet Configuration Option)




Change the current log level of the wallet.




Input


simplewallet.exe --set_log=2










testnet
(SimpleWallet Configuration Option)




Run the wallet in testnet mode.


Used for testing and debugging purposes.


Must also run the daemon in testnet mode as shown here




Input


simplewallet.exe --testnet










version
(SimpleWallet Configuration Option)




Prints the Cash2 software version.




Input


simplewallet.exe --version



Output


cash2 wallet v5.1(0.1-g8edd998304)










wallet-file
(SimpleWallet Configuration Option)




Specify the wallet file that you want to open.




Input


simplewallet.exe --wallet-file=myNewWallet










SimpleWallet Commands



Cash2 wallet commands allow you to check your wallet's balance, send and receive money, and view your wallet's transaction history using the command line.


You can run the Cash2 wallet commands only after you have started the Cash2 wallet.


You can find instructions on how to start the Cash2 command line wallet here




Available SimpleWallet Commands












address
(SimpleWallet Command)




Shows the wallet address.




Input


address



Output


2286mf5HNAKiZXAxmbNsxcbVU4pQxHeL5Lh1WBfbvRrBdec3QyTenLPY74f7TuoeaLWpTscWF7GUmQakMYAPa1RN62TFCwe










allTransactions
(SimpleWallet Command)




Shows all incoming and outgoing transactions to and from the wallet.


Incoming transactions are green and outgoing transactions are red.




Input


allTransactions



Output


  
  
  Received : 1.000000000
  Timestamp : 2018-12-10 03:45:23
  Transaction ID : 83fdd773fa8f7b1c5e6f3d4a978db4ebf2495298f3f75a928f64c47aeaaf54b6
  Fee : 0.000000000
  Block Height : 46211


  Received : 9.000000000
  Timestamp : 2019-01-15 20:03:28
  Transaction ID : 317fd32421361164a50aa13467df269c9d5cb12fbfe97b09713508f637d1bdd4
  Fee : 0.000000000
  Block Height : 309686
  

  Sent
  Timestamp : 2019-02-24 01:04:35
  Transaction ID : a668243012169d400e4ad92ce8990d4754020d3a5ecbb7b8848be2a3265e963b
  Transaction Secret Key : 530cbaf119e285c821748f9bd2c0b0a95e3a1bc58c1edcc45f5d02a7f3806293
  Fee : 0.000000000
  Block Height : 634779


  Sent
  Timestamp : 2019-03-01 00:03:40
  Transaction ID : 91290e8b9aa0563407e4d69c8a5c3102e7dff644eb349a6e6024a89b433c60bd
  Transaction Secret Key : eabdf6d6fc2690a6236781db5b5020f6d9ee276fb677937e0c7ba2af3579d535
  Fee : 0.000000000
  Block Height : 682146

  ...
  










balance
(SimpleWallet Command)




Shows the wallet balance.




Input


balance



Output


available balance: 1.836543211, locked amount: 0.000000000










blockchainHeight
(SimpleWallet Command)




Shows the height of your local copy of the blockchain.




Input


blockchainHeight



Output


2089810










exit
(SimpleWallet Command)




Saves your wallet file and exits the wallet program.


Closing the wallet program without the exit command could cause corruption of your wallet file.




Input


exit



Output


Wallet closed










getTxKey
(SimpleWallet Command)




Get the transaction private key of a transaction given the transaction hash.




Format


getTxKey [transaction_hash]



Input


getTxKey bf4351e9085e76c35d30db60bc55e660ca51866804da0d333a5f122681035e2c



Output


transaction secret key : 361945e41912da5c6d88a997c7a6426c4e6beb475808d2a895ba918094324ebc










help
(SimpleWallet Command)




Shows all possible wallet commands with a description of each.




Input


help



Output



  Commands:
  address                Show wallet address
  allTransactions        Show all transactions
  balance                Show wallet balance
  blockchainHeight       Show blockchain height
  exit                   Close wallet
  getTxKey               getTxKey <transaction_id>, Get the transaction secret key of a transaction
  help                   Show this help
  incomingTransactions   Show incoming transaction
  outgoingTransactions   Show outgoing transactions
  payments               payments <payment_id_1> [<payment_id_2> ... <payment_id_N>] - Show payments <payment_id_1>, ... <payment_id_N>
  reset                  Discard cache data and start synchronizing from the start
  save                   Save wallet synchronized data
  setLog                 set_log <level> - Change log level, <level> is a number 0-4
  spendPrivateKey        Show wallet spend private key
  startMining            start_mining [<number_of_threads>] - Start mining
  stopMining             Stop mining
  transfer               transfer <privacy_level> <adreess> <amount> [-f fee], transfer amount to address with privicy level, <privacy_level> is the number of decoy transactions (0, 1, 2, or 3)
  viewPrivateKey         Show wallet view private key
  










incomingTransactions
(SimpleWallet Command)




Shows all incoming transactions.


Incoming transactions data is stored in the wallet file and not on the blockchain.


If the wallet file is corrupted or deleted, the transaction history will be lost.




Input


incomingTransactions



Output


  
  Received : 5.000000000 CASH2
  Timestamp : 2019-02-09 01:04:35
  Transaction ID : 944793b643b46632119f014f8a18ff6d711a90d772544abd0db97a68af27c312
  Fee : 0.000000000 CASH2
  Block Height : 634750
  
  










outgoingTransactions
(SimpleWallet Command)




Shows all outgoing transactions.


Outgoing transactions data is stored in the wallet file and not on the blockchain.


If the wallet file is corrupted or deleted, the transaction history will be lost.




Input


outgoingTransactions



Output



  Sent
  Timestamp : 2019-03-07 12:54:23
  Transaction ID : 0fed04c0b67710099f8453dcaea30c16a7c94c38ff1dd3fb8917ea75b285df04
  Transaction Secret Key : 1649830ef835e1100f49f11632f41b10a0c1e91c783763fdce58e069d7cff402
  Fee : 0.010000000 CASH2
  Block height : 2143553
  Receiver's address : 29LQfnPnYmVMk7LytDjKQGPZcPfLpmgUW9qqAT7BWpX5KHXZhFSdNoXSELQ3iLdEWwgiPhJaCdXxFGmeVo7MiYwYKh6dozs
  Amount : 1.000000000 CASH2
  










payments
(SimpleWallet Command)




Get information about an incoming transaction given the transaction's payment identifier.


Only shows transactions that sent money to your wallet.




Format


payments [payment_id]



Input


payments ea46004c09d6ccfcc6e4b7f7c097281771fcad963351c5204eca1d775e89882d



Output



                              payment                                                               transaction                                     height               amount
ea46004c09d6ccfcc6e4b7f7c097281771fcad963351c5204eca1d775e89882d                5e3cd68b41ccd4562213f2503e08aa3634f7665a95e0f53c1f9d0c55becde973 1026856                  1.000000000
  










rest
(SimpleWallet Command)




Discards the wallet data and starts synchronizing from the beginning.




Input


reset



Output


Reset completed successfully.










save
(SimpleWallet Command)




Saves the wallet's data to file.




Input


save



Output


Wallet data saved










setLog
(SimpleWallet Command)




Change the log level.




Format


setLog [level]



Input


setLog 4



Output


None










spendPrivateKey
(SimpleWallet Command)




Shows the wallet's spend private key.




Input


spendPrivateKey



Output


9a4cd6b73706699cbc0c087abd87eb8850918f40a1d40167ff049b05fe7887d6










startMining
(SimpleWallet Command)




Begin mining Cash2 on your computer.


Since specialized mining equipment called ASICs are mining Cash2, mining on your computer is generally not recommended.




Format


startMining [threads]



Input


startMining



Output


Mining started in daemon










stopMining
(SimpleWallet Command)




Stop mining Cash2 on your computer.


If mining was started, must called stopMining before exiting SimpleWallet or mining will continue even after SimpleWallet is closed.




Input


stopMining



Output


Mining stopped in daemon










transfer
(SimpleWallet Command)




Send money from your wallet to another person's wallet.


You specify the amount, the receiver's address, the privacy level, the fee, and the payment ID.




Format


transfer [privacy_level] [adreess] [amount] [-p payment_id] [-f fee]



Input



  transfer 3 29vTyGg312ma95waXHKLxXi3AkXX4pNt3BbTC9GqdHXSDgk4FnK77nseiAQU9T4nStKNDsrXL8uhtN45GCQzaovcENeRqAH 10
  


or



Specify a payment ID
  
  transfer 3 29vTyGg312ma95waXHKLxXi3AkXX4pNt3BbTC9GqdHXSDgk4FnK77nseiAQU9T4nStKNDsrXL8uhtN45GCQzaovcENeRqAH 10 -p b6af8cad8ccce3ff08133592120e80e74ba546905fd8c1e01c368655700acb2f
  


or



Specify a fee

  transfer 3 29vTyGg312ma95waXHKLxXi3AkXX4pNt3BbTC9GqdHXSDgk4FnK77nseiAQU9T4nStKNDsrXL8uhtN45GCQzaovcENeRqAH 10 -f 0.02
  



Output


Money successfully sent, transaction 6f82c098fd7fd454142a71bee64f6fa2e25935df149082527c3eb3ff6d280011










viewPrivateKey
(SimpleWallet Command)




Shows the wallet's view private key.




Input


viewPrivateKey



Output


773370eee0cc4ecabfad6bc8f52fa91c3ece4dc41fd7850ccb6706a66d602a66










SimpleWallet JSON RPC





***The SimpleWallet JSON RPC will be disabled after Cash2 software version 5.1**





The Simplewallet JSON RPC is an HTTP server that provides information about a Cash2 wallet running on the simplewallet program.


Start the Cash2 daemon cash2d.exe --rpc-bind-ip=0.0.0.0 --rpc-bind-port=12276.


Start the Simplewallet JSON server simplewallet.exe --wallet-file=myWallet --pass=myWalletPassword --rpc-bind-port=12276.


Access the Simplewallet JSON RPC server at http://localhost:12276 or http://[your ip address]:12276 using Postman.





Available SimpleWallet JSON RPC Methods











get_height
(Simplewallet JSON RPC)




Returns the last top known block height for simplewallet.


This method can be used to verify that simplewallet is correctly synchronized.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"get_height"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "height": 1907805
    }
  }
  










get_payments
(Simplewallet JSON RPC)




Returns the information about a transaction sent to the wallet given the transaction's payment identifier.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"get_payments",
    "params":{
      "payment_id":"4aeb8ae0ed7e358045a3acff104bd7599720399bee290a79e8b67a1f8d430a2d"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "payments": [
        {
          "amount": 1000000000,
          "block_height": 1575745,
          "tx_hash": "d475ec1db717a94f027869ad8c92afb9538bd3113025ed79224d05f57b7e4591",
          "unlock_time": 0
        }
      ]
    }
  }
  










get_transfers
(Simplewallet JSON RPC)




Returns the list of all the wallet's incoming and outgoing transfers.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"get_transfers"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "transfers": [
        {
          "address": "",
          "amount": 1000000000,
          "blockIndex": 325665,
          "fee": 0,
          "output": false,
          "paymentId": "",
          "time": 1543201380,
          "transactionHash": "2ec2750f643dc4a88b376e595f11c8fa486f998bb30e297ba32e2720b618b9bf",
          "txKey": "",
          "unlockTime": 0
        },
        {
          "address": "",
          "amount": 9000000000,
          "blockIndex": 1212500,
          "fee": 0,
          "output": false,
          "paymentId": "",
          "time": 1546490127,
          "transactionHash": "45773b553e162386b30eefc698f1e4efdb5919b99334e61b817aac22e1811fcf",
          "txKey": "",
          "unlockTime": 0
        }
      ]
    }
  }
  










get_tx_key
(Simplewallet JSON RPC)




Returns the transaction's secret key if it is stored in wallet.


Can be used to prove that you paid the receiver.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"get_tx_key",
    "params":{
      "tx_hash":"e12f65f0d6b214fdeb9c59961ec20ccb8b25d1f37c5e534bff043b4caeee01f5"
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
        "tx_key": "b36e58ea6f691a613d21fc4f818bb5b8ec7b995effbb16011d6840bc6f9a3401"
    }
  }
  










getbalance
(Simplewallet JSON RPC)




Returns the balance of the address.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"getbalance"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "available_balance": 2866543211,
      "locked_amount": 0
    }
  }
  










reset
(Simplewallet JSON RPC)




Allows you to resynchronize your wallet.




URL


http://localhost:12276/json_rpc



Input



  {
    "method":"reset"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









store
(Simplewallet JSON RPC)




Saves the wallet data.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"store"
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {}
  }
  









transfer
(Simplewallet JSON RPC)




Transfer money to one or more destination addresses.




URL


http://localhost:12276/json_rpc



Input



  {  
    "method":"transfer",
    "params":{
      "destinations":[
        {
          "amount":1000000000,
          "address":"28ey1mwiKoyRAx8LHgGt65DFuQLUHYdse232gGof3L2y8Jv3WDdVyuuYqE7ZXdC682hxk77JpH6yQbDYErWDttifNC2yi6N"
        }
      ],
      "fee":10000000,
      "mixin":3,
      "unlock_time":0
    }
  }
  



Output



  {
    "jsonrpc": "2.0",
    "result": {
      "tx_hash": "e8e97949b0255b86ddec1cba36a9eab600fdb8b865524bcd814dc9d277dd502f",
      "tx_key": "069708f968f2a62fe39469645c62d2f9b678f45f59892814ddb245c3d6559ea0"
    }
  }
  










Glossary



Block height



Block index



Blockchain height



Peer nodes










Disclaimer




Introduction

This website is operated by The Cash2 Developers, a loose collective of individuals behind Cash2. By visiting and using this website you will be accepting these Terms of Use ("TOU"). Please read them carefully and if you disagree with the TOU in any way, then do not use this website. The Cash2 Developers reserves the right to post changes to the TOU on this website at any time, and by your continuing to use the website thereafter, you agree to be bound by the new version of the TOU. If any TOU changes are not acceptable, you must stop your use of this website. In these TOU, "The Cash2 Developers" and "we" refers to The Cash2 Developers, and "User" or "you" refers to each visitor to this website. "Cash2" refers to the digital currency that can be used by the software available on this website.



Sites and Services

We do not guarantee that access to or use of this website or any services will be uninterrupted or error free, and The Cash2 Developers shall not be liable for any feature not being accessible or for any unavailability of its website and services. The website and its features may be expanded, limited or modified at any time by The Cash2 Developers to meet the needs of its Users, or for technical or other reasons, without advance notice or reason. We may also in our sole discretion, and at any time, discontinue providing, temporarily or permanently, any or all of the website, without notice. To access some of the content or features of the website or its services, Users may need to enhance or update the hardware or software in their computer systems. The Cash2 Developers assumes no responsibility for any failure to access the website or any services, partially or fully, whether due to the User's system, the Internet network or any other cause.



Minors

We do not provide information or services to minors, and if you are under 18 you may only use this site with the active involvement of a parent, guardian or other supervising adult.



No Investment Advice

This website does not provide individual or customized legal, tax, financial, or investment services. Since each individual's situation is unique, a qualified professional should be consulted before making financial decisions. Since Cash2 is meant to be used as a medium of exchange, nothing on this website constitutes investment advice or a solicitation to buy, hold, invest in, own, or use Cash2.



Content Limitations

We make no guarantees as to the accuracy, thoroughness or quality of the information on this website, which is provided only on an "AS-IS" and "AS AVAILABLE" basis at User's sole risk. This information may be provided by third parties and The Cash2 Developers shall not be responsible or liable for any errors, omissions or inaccuracies in the website content. The information provided at this site are neither comprehensive nor appropriate for every individual. Some of the information is relevant only in certain parts of the world, and may not be relevant to or compliant with the laws, regulations or other legal requirements of other countries. It is your responsibility to determine whether, how and to what extent your intended use of the information and services will be technically and legally possible in the areas of the world where you intend to use them. You are advised to verify any information before using it for any personal, financial or business purpose. In addition, the opinions and views expressed in any forum post on this website are solely those of the author(s) of the article and do not reflect the opinions of The Cash2 Developers. The website content and services may be modified at any time by us, without advance notice or reason, and The Cash2 Developers shall have no obligation to notify you of any corrections or changes to any website content.



Information provided here was borrowed from Copyright (c) 2014-2019 The Monero Developers and is distributed under the CC BY-SA 4.0 license.