Skip to content

Instantly share code, notes, and snippets.

@Mine77
Last active December 6, 2019 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Mine77/cb26558a993088a298a2bc1862bb9662 to your computer and use it in GitHub Desktop.
Save Mine77/cb26558a993088a298a2bc1862bb9662 to your computer and use it in GitHub Desktop.
All CKB RPC API in a paw file for Rest API softwares such as Insomnia.
{
"info": {
"name": "CKB.paw",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
"version": "v0.0.0"
},
"item": [
{
"name": "Chain",
"item": [
{
"name": "get_block",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_block\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0x4c2f8ba5f5a0104eaf84fcbb16af4b0e7ca2f2fdb076e748d54ef876d085d49e\\\"]}\"\n}"
}
}
},
{
"name": "get_block_by_number",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_block_by_number\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"7105\\\"]}\"\n}"
}
}
},
{
"name": "get_block_hash",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_block_hash\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0\\\"]}\"\n}"
}
}
},
{
"name": "get_cells_by_lock_hash",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_cells_by_lock_hash\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0x0da2fe99fe549e082d4ed483c2e968a89ea8d11aabf5d79e5cbf06522de6e674\\\",\\\"1\\\",\\\"100\\\"]}\"\n}"
}
}
},
{
"name": "get_current_epoch",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_current_epoch\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
},
{
"name": "get_epoch_by_number",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_epoch_by_number\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0\\\"]}\"\n}"
}
}
},
{
"name": "get_live_cell",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_live_cell\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[{\\\"hash\\\":\\\"0xda27a795e14067e18a0cfc0951571aaca47bd9851adc9bf5baa22cf27c8bcde8\\\",\\\"index\\\":0}]}\"\n}"
}
}
},
{
"name": "get_tip_block_number",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_tip_block_number\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
},
{
"name": "get_tip_header",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_tip_header\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
},
{
"name": "get_transaction",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_transaction\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0xa5ad5cb960d5c56f150351d8862b744ae51b68f91cd680d51aeb1e08ba541774\\\"]}\"\n}"
}
}
}
]
},
{
"name": "Experiment",
"item": [
{
"name": "_compute_code_hash",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"_compute_code_hash\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[\\\"0x123456\\\"]}\"\n}"
}
}
},
{
"name": "_compute_script_hash",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"_compute_script_hash\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[{\\\"args\\\":[\\\"0x123450\\\",\\\"0x678900\\\"],\\\"code_hash\\\":\\\"0xb35557e7e9854206f7bc13e3c3a7fa4cf8892c84a09237fb0aab40aab3771eee\\\"}]}\"\n}"
}
}
},
{
"name": "_compute_transaction_hash",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"_compute_transaction_hash\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[{\\\"version\\\":\\\"0\\\",\\\"deps\\\":[],\\\"inputs\\\":[],\\\"outputs\\\":[],\\\"witnesses\\\":[]}]}\"\n}"
}
}
},
{
"name": "dry_run_transaction",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"dry_run_transaction\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[{\\\"version\\\":\\\"0\\\",\\\"deps\\\":[],\\\"inputs\\\":[],\\\"outputs\\\":[],\\\"witnesses\\\":[]}]}\"\n}"
}
}
}
]
},
{
"name": "Net",
"item": [
{
"name": "get_peers",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_peers\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
},
{
"name": "local_node_info",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"local_node_info\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
}
]
},
{
"name": "Pool",
"item": [
{
"name": "send_transaction",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"send_transaction\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[{\\\"version\\\":\\\"0\\\",\\\"deps\\\":[],\\\"inputs\\\":[],\\\"outputs\\\":[],\\\"witnesses\\\":[]}]}\"\n}"
}
}
},
{
"name": "tx_pool_info",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"tx_pool_info\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
}
]
},
{
"name": "Stats",
"item": [
{
"name": "get_blockchain_info",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_blockchain_info\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
},
{
"name": "get_peers_state",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_peers_state\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
}
]
},
{
"name": "Miner (not for public usage)",
"item": [
{
"name": "get_block_template",
"request": {
"url": "http://127.0.0.1:8114",
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"string\",\n \"default\": \"{\\\"method\\\":\\\"get_block_template\\\",\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":1,\\\"params\\\":[]}\"\n}"
}
}
}
]
}
]
}
@Mine77
Copy link
Author

Mine77 commented May 13, 2019

Credit: this file is authored by @ashchan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment