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
  • Running Your Local Network
  • Configuration Files
  • Advantages of Running a Local Network
  1. For Developers

Local Networks

You can run an R5 client locally to create your own private network. Developing on your own closed and local network provides an optimised workflow and an environment that is fully controlled by you. This is ideal for fast deployments, iterative development, and even production-grade business applications.


Overview

Running a local network gives you complete control over the blockchain environment. You can test new features, deploy smart contracts quickly, and simulate various network conditions without interference from external users. It is also useful for production deployments where a private, controlled network is required.

By default, local networks run with a chain ID of 13512. However, you can easily change this along with many other parameters by editing the configuration files provided with R5.


Running Your Local Network

To launch your local network, use the R5 Relayer by running the following command:

./r5 --network local

This command starts your R5 client in local mode, using default settings from the configuration files.


Configuration Files

Main Configuration

Local network parameters are defined in the main configuration file located at:

/config/local.config

This file is a TOML-formatted configuration (similar to a Geth file) that allows you to customise various settings. The following table outlines some of the most common parameters you can change:

Parameter
Default Value
Description

chainID

33712

Unique identifier for the local chain.

networkID

13512

Identifier for the network; typically matches the chain ID.

gasLimit

8000000

Maximum gas allowed per block.

blockTime

7

Target block time in seconds.

cacheSize

1024

Cache size in MB for block processing.

extraData

""

Custom extra data to be included in the genesis block.

Note: You may add or modify additional parameters as needed for your specific requirements.


Genesis Configuration

The genesis block for your local network is defined in the file:

/genesis/local.json

You can customise this file to change the initial state of your blockchain, such as pre-allocating funds to accounts or setting initial parameters for contract deployments.


Advantages of Running a Local Network

  • Rapid Deployments: Test smart contracts and network upgrades in a controlled environment with minimal delay.

  • Customisation: Fully customise network parameters, genesis state, and other settings to match your development or business needs.

  • Full Control: Run a private network where you have complete control over node behaviour, network rules, and access permissions.

  • Production-Grade Applications: Local networks can be configured to simulate production environments, allowing businesses to deploy and test applications in a secure, isolated setting.

  • Optimised Workflow: Developers can rapidly iterate on code changes without the overhead or risk of using public testnets.

PreviousR5 DevnetNextJSON-RPC API

Last updated 2 months ago