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:
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:
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:
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:
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.
Last updated