Humanode Docs
  • Quick Start
  • Overview
  • Concepts
    • Bioauth
    • Smart Contracts
    • Node
    • Validator
  • Chains
  • Help & Support
    • Troubleshooting
    • FAQ
    • Discord
  • Node
    • About
    • System Requirements
    • Setup
    • CLI
      • Dev Mode
    • JSON-RPC
    • Tools & Services
  • Humanode Launcher
    • About
    • Launcher Installation
    • Workspace Creation
      • Remote
      • Local
        • Linux / macOS
        • Windows
    • Node Installation
    • Node Configuration
    • Running the node
    • Stopping the node
  • Humanode Distribution
    • About
    • Preparation
    • Node Installation
      • Manual Installation
    • Running the node
  • Validators
    • About
    • Becoming a validator
    • Checking validator status
  • Tools & Services
    • Polkadot.js apps
    • Polkadot.js extension
      • Wallet Setup
    • EVM Playground
    • Subscan
    • Exchanges
    • Oracles
    • Testnet Faucets
    • Substrate API Sidecar
    • Humanode Truffle Box
    • Humanode Token Claim
  • Bioauth
    • About Bioauth
    • Enrolling
    • Authenticating
    • Robonode
  • EVM & Solidity Smart Contracts
    • EVM Compatibility
    • Precompiles
    • Architecture
    • HMND/eHMND swap
    • EVM Dev Mode & Keys
    • Sample contract: ERC20 token
    • EVM Playground
    • Humanode Truffle Box
Powered by GitBook
On this page
  • About
  • Usage
  1. Tools & Services

Substrate API Sidecar

A REST API on top of Substrate JSON-RPC API for easier interoperation.

PreviousTestnet FaucetsNextHumanode Truffle Box

Last updated 2 years ago

About

The is an external application that provides a more convenient HTTP API on top of the low-level JSON-RPC API that node exposes.

Humanode network can be used with Substrate API Sidecar, although some of the Humanode specific APIs are not exposed.

If you are an app developer, and you need a quick way to do some common blockchain operations (e.g. balance transfer), consider using the Substrate API Sidecar.

Usage

  1. Install Node.js.

  2. Install the Substrate API Sidecar.

    npm install -g @substrate/api-sidecar
  3. Run the sidecar process and connect to Humanode network.

    SAS_SUBSTRATE_URL=<URL> substrate-api-sidecar

    Replace <URL> with the right JSON-RPC URL from the page, or use your own.

  1. Install Docker.

  2. Run the Substrate API Sidecar image.

    docker run --rm -it \
      -p 8080:8080 \
      -e "SAS_SUBSTRATE_URL=<URL>" \
      parity/substrate-api-sidecar:latest

    Replace <URL> with the right JSON-RPC URL from the page, or use your own.

You can now send the simple HTTP requests and get simple JSON responses instead of dealing with the Substrate JSON-RPC protocol specifics.

$ curl -sS 'http://127.0.0.1:8080/accounts/hmpwhPbL5XJTYPWd3Gw9dUzdWrPwx2nbMFK7CmCQTrYNSfrW4/balance-info' | jq .
{
  "at": {
    "hash": "0x50c54161a09a127324de2e7a5c10d01458b896a4eef4905243c23c5c35f17827",
    "height": "796175"
  },
  "nonce": "0",
  "tokenSymbol": "HMND",
  "free": "353780945734999999999999000",
  "reserved": "0",
  "miscFrozen": "0",
  "feeFrozen": "0",
  "locks": []
}

Substrate API Sidecar
chains
chains