R5 Network
WebsiteR5 LabsGitHub
  • Getting Started
    • Hello & Welcome!
  • About R5
    • Overview
    • R5 Components
    • Consensus Mechanism
    • zkNet (Privacy)
  • R5 Coin
  • R5 Tokenomics
  • Tutorials & Guides
    • Connect & Use R5
      • R5 Desktop Wallet
      • MetaMask
      • Rabby Wallet
      • Coinbase Wallet
    • zkNet Web Wallet
    • R5 Desktop Wallet
      • Interface Overview
      • Send a Transaction
      • Receive a Transaction
      • Backup Your Wallet
      • Retrieve Your Private Key
    • How To: Deploy a Node
    • How To: Mine R5
    • How To: GPU Mine R5
    • How To: Build R5 From Source
    • How To: Connect Local Nodes
  • For Developers
    • R5 SDK
      • R5 Relayer
      • R5 Console
      • JS Console
      • CLI Wallet
      • SCdev
      • SSL Proxy
    • Hardware Requirements
    • R5 Testnet
    • R5 Devnet
    • Local Networks
    • JSON-RPC API
      • admin
      • debug
      • ethash
      • miner
      • net
      • r5 (eth)
      • rpc
      • txpool
      • web3
    • Indexer API
    • zkNet API
    • Node Configuration
    • Ethash-R5
    • Smart Contracts
    • Wrapped R5 (Native)
    • Tokens & NFTs
  • Bug Bounty Program
  • Resources
    • Website
    • R5 Labs
    • R5 Labs GitHub
Powered by GitBook
On this page
  • Overview
  • Starting the Console
  • Supported Queries
  • Converting HEX to DEC in Responses
  • Response Format
  1. For Developers
  2. R5 SDK

R5 Console

Overview

The R5 Console is an easy-to-use CLI interface for interacting with your R5 node, and it also supports connecting to remote RPCs via the flag --rpcurl RPC_URL. It is an excellent tool for quick querying and testing via JSON-RPC methods.

Starting the Console

You can start the console via the R5 Relayer by adding the --r5console flag:

./r5 --r5console

If you wan to connect to a remote RPC or is running your local node on a different port than 8545, you will need to initiate the binary directly (often found within the /bin directory) with the --rpcurl flag:

./console --rpcurl https://yourrpc.com

It supports both http and https connections, and uses http://localhost:8545 as its default RPC URL.

Supported Queries

The console supports all JSON-RPC queries available from the RPC node it is connected to. There are two ways in which you can structure your queries: a) Full JSON; or b) Simplified.

Full JSON Queries

You can submit full JSON queries in line, such as like in the example below:

{"jsonrpc": "2.0", "method": "r5_getBalance", "params": ["0x123..."], "id": 1}

Simplified Queries

You can use simplified queries by typing the method followed by its parameters, in order. For example:

 r5_getBalance 0x123... latest

Converting HEX to DEC in Responses

The console has a built-in HEX-to-DEC converter that you can use to convert the HEX numerals in your response to decimals. It doesn't work with all queries, but it's an easy way to make the printed responses easier to read. To activate the converter, add the --trydec token after your query. For example:

r5_getBalance 0x123... latest --trydec

For simplified queries, and for full JSON queries:

{"jsonrpc": "2.0", "method": "r5_getBalance", "params": ["0x123..."], "id": 1} --trydec

Response Format

The responses are printed on the screen in JSONformat, for example, for a query such as:

r5_getSupply --trydec

We can expect a response similar to:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "2000112000000000000000000"
}
PreviousR5 RelayerNextJS Console

Last updated 2 months ago