Rapid Chain
  • WHITE PAPER
    • Introduction
    • Mission and Vision
    • Architecture
    • Highlights
    • Safety and Compliance
    • Usage Areas
    • A look to the Future
    • Summary and contact
  • Getting Started
    • Network Information
    • Setting Up a Connection
  • Developer Resources
    • Deploying Smart Contracts
    • Local Rapid Node
    • Resources
    • NFT & Token API
    • Token Deployer
    • Faucet
  • FULL NODE
    • Validator Guide
      • Wallet Commands
      • Validator Commands
      • Governance
      • Stake, Delegation & Rewards
    • Run a Rapid Node
      • System Configuration
      • Local dependencies
      • Build Rapidd
      • General Settings
      • Join Network
      • Running Rapidd
    • Run a Rapid Validator
      • Register a Validator
      • Restore a Validator
    • Auto Installation
      • Build Rapidd
      • Create Validator
Powered by GitBook
On this page
  1. Getting Started

Setting Up a Connection

PreviousNetwork InformationNextDeploying Smart Contracts

Last updated 1 year ago

CtrlK

To set up a connection to Rapidchain via RPC, you can use web3 libraries like web3.js or ethers.js.

Here is an example using web3.js:

const Web3 = require('web3');

// Replace with the relevant RPC URL
const rpcURL = 'https://rpc.mainnet.rapidchain.org'; 

const web3 = new Web3(rpcURL);

// Check if the connection is successful
web3.eth.getBlockNumber().then(console.log);

Common RPC Methods

Here are some common RPC methods that you might use when interacting with the Rapidchain network:

  • rpd_blockNumber: Returns the number of the most recent block.

  • rpd_getBalance: Returns the balance of the specified address.

  • rpd_sendTransaction: Sends a transaction to the network.

For a complete list of RPC methods, refer to the Ethereum JSON RPC API documentation, as Rapidchain is compatible with EVM and supports the same RPC methods.

Troubleshooting and Support

If you encounter any issues while connecting to Rapidchain via RPC, please check the following:

  • Ensure the RPC URL is correct and accessible.

  • Make sure you have the correct Chain ID for the network you are connecting to.

  • If you’re using a third-party library, make sure it’s up-to-date.

For further assistance, please join our community forums or contact our support team.