Cheat Sheet: Parity and Bitcoin Core
Useful commands to interact with your Ethereum and Bitcoin nodes.
Parity (Ethereum)
Starting Parity
<h1 id="heading-3">Mainnet</h1>
parity --chain mainnet
<h1 id="heading-4">Testnet (Ropsten)</h1> parity --chain ropsten
<h1 id="heading-5">With JSON-RPC API</h1> parity --chain mainnet --jsonrpc-apis web3,eth,net,personal,parity
Common Parity Commands
<h1 id="heading-7">Check sync status</h1>
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545
<h1 id="heading-8">Get block number</h1> curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545
<h1 id="heading-9">Get balance</h1> curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","latest"],"id":1}' http://localhost:8545
<h1 id="heading-10">List accounts</h1> curl -X POST --data '{"jsonrpc":"2.0","method":"parity_listAccounts","params":[100],"id":1}' http://localhost:8545
Bitcoin Core
Starting Bitcoin Core
<h1 id="heading-3">Mainnet</h1>
bitcoind
<h1 id="heading-14">Testnet</h1> bitcoind -testnet
<h1 id="heading-15">With RPC server</h1> bitcoind -server -rpcuser=user -rpcpassword=password
Common Bitcoin Core Commands
<h1 id="heading-7">Check sync status</h1>
bitcoin-cli getblockchaininfo
<h1 id="heading-18">Get block count</h1> bitcoin-cli getblockcount
<h1 id="heading-9">Get balance</h1> bitcoin-cli getbalance
<h1 id="heading-20">List transactions</h1> bitcoin-cli listtransactions
<h1 id="heading-21">Get new address</h1> bitcoin-cli getnewaddress
<h1 id="heading-22">Send transaction</h1> bitcoin-cli sendtoaddress <address> <amount>
Using bitcoin-cli with RPC
<h1 id="heading-24">With authentication</h1>
bitcoin-cli -rpcuser=user -rpcpassword=password getblockchaininfo
<h1 id="heading-25">Using curl</h1> curl --user user:password --data-binary '{"jsonrpc":"1.0","id":"curltest","method":"getblockchaininfo","params":[]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
