Skip to content

Instantly share code, notes, and snippets.

@harsh-98
Created June 15, 2020 15:00
Show Gist options
  • Save harsh-98/8ff3c18700bc30fd57579629361547c3 to your computer and use it in GitHub Desktop.
Save harsh-98/8ff3c18700bc30fd57579629361547c3 to your computer and use it in GitHub Desktop.

RPC request

Getting pkh address

{"jsonrpc": "2.0","method": "getPkh", "id": "1"}

Getting utxo info

Replace <> with pkh address.

{{"jsonrpc": "2.0","method": "getUtxoInfo", "params": [<>], "id": "1"}} 

Getting reputation of all address

{"jsonrpc": "2.0","method": "getReputationAll", "id": "1"}

Getting reputation of specifc address

Replace <> with pkh address.

{{"jsonrpc": "2.0","method": "getReputation", "params": [<>], "id": "1"}}

Getting block data

Replace <> by block hash.

{{"jsonrpc": "2.0","method": "getBlock", "params": [<>], "id": "1"}}

Getting transaction

Replace <> by transaction hash.

{{"jsonrpc": "2.0","method": "getTransaction", "params": [<>], "id": "1"}}

Sending value transfer request

Replace <> by vtt struct.

{{"jsonrpc": "2.0","method": "sendValue", "params": <>, "id": "1"}}

for struct of VTT you have to look at code, I am pasting the struct for this request only:

{"vto":[{"pkh":"twit1ssylj50yrlws8r0tu6x3t5fy90gd8dg2e6tauk","value":1,"time_lock":0}],"fee":1,"utxo_strategy":"Random"}

Sending data request

Replace <> by data request struct.

{{"jsonrpc": "2.0","method": "sendRequest", "params": <>, "id": "1"}}

data request struct.

{"dro": dr_output, "fee": fee}

Getting data request report

Replace <> by hash of report.

{{"jsonrpc": "2.0","method": "dataRequestReport", "params": [<>], "id": "1"}}

Get peers

{"jsonrpc": "2.0","method": "peers", "id": "1"}

Known peers

{"jsonrpc": "2.0","method": "knownPeers", "id": "1"}

getting node stats

{"jsonrpc": "2.0","method": "nodeStats", "id": "1"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment