Skip to content

Repository files navigation

Public configuration files

This README provides a comprehensive overview of the configuration files required for the functioning of rpc system.

Table of Contents

Chain Settings Configuration

The first of these files is chains.yaml, which specifies the settings for different blockchain protocols and their respective chains.

Protocols

Each protocol section defines settings for a specific blockchain protocol, including protocol-specific parameters and a list of chains associated with that protocol.

Example Structure

protocols:
- id: protocol1label: Protocol 1type: type1settings:
parameter1: value1parameter2: value2chains:
- id: mainnetpriority: 100chain-id: chain-id1short-names: [shortname1, shortname2]code: CODE1grpcId: 1
- id: testnetpriority: 1chain-id: chain-id2short-names: [shortname3]code: CODE2grpcId: 2
- id: protocol2label: Protocol 2type: type2settings:
parameter3: value3parameter4: value4chains:
- id: mainnetpriority: 50chain-id: chain-id3short-names: [shortname4]code: CODE3grpcId: 3

Field Descriptions

FieldDescription
idIdentifier for the protocol.
labelHuman-readable name for the protocol.
typeType of the blockchain protocol.
settingsSpecific settings for the protocol.
chainsList of chains associated with the protocol.

Chain Details

Each chain under a protocol defines specific parameters and settings unique to that chain. These settings ensure that each chain operates correctly within the context of its protocol. As usual chains are mainnet and all testnets of that protocol.

Example Structure

chains:
- id: chain-mainnetpriority: 100chain-id: chain-id1short-names: [shortname1, shortname2]code: CODE1grpcId: 1
- id: chain-testnetpriority: 1chain-id: chain-id2short-names: [shortname3]code: CODE2grpcId: 2

Field Descriptions

FieldDescription
idIdentifier for the chain.
priorityPriority of the chain. Used in UIs.
chain-idIdentifier for the chain. Different types in different chains.
short-namesList of short names for the chain.
codeCode used to identify the chain.
grpcIdgRPC identifier for the chain from api module
settingsSpecific settings for the chain.

Settings

The settings section contains parameters that apply to specific chain. Global parameters located at top level as default, then more specific parameters defined in protocol section and last one could be specified on each chain separately. Chain settings overrides protocol settings, protocol settings overrides default settings.

settings:
expected-block-time: 1soptions:
validate-peers: falselags:
syncing: 40lagging: 20

Field Descriptions

FieldDescription
expected-block-timeDefault expected time for block generation.
lags.syncingNumber of blocks considered for syncing.
lags.laggingNumber of blocks considered for lagging.
options.validate-peersEnable validation of peers for chains
options.validate-syncingEnable validation of syncing state
options.disable-validationDisable all validations

Meta data

Icons

Icons are stored in the /icons directory. To add a new icon, place a .svg or .png file into the /icons folder. Ensure the filename corresponds to the identifier for the protocol.

Next, register the icon in the Icons map within the /icons/getChainIcon.ts file.

Example:

importEthereumfrom"./Ethereum.svg";constIcons: Record<string,React.ComponentType>={// existing iconsethereum: Ethereum,// add new icons here};

If you are adding or modifying an .svg icon, ensure to compress it using SVGOMG.

Descriptions

Each chain's description is displayed on the https://drpc.org/chainlist/* pages (e.g., https://drpc.org/chainlist/ethereum). To add a description for a new chain, insert the corresponding text into the CHAIN_DESCRIPTION map in the ./chain_descriptions.tsx file.

Clients compatibility list

File compatible-clients.yaml describes compatible clients of blockchains for drpc. It contains of list of clients, optional list of chains and enumeration of allowed or disallowed versions of clients.

Each chain could accept or discard new clients and it should be specified in chains.yaml (tbd)

Example:

rules:
- client: erigonnetworks:
- ethereumblacklist:
- v2.40.0

Blacklisting

The first, default mode is blacklisting. In case client have non compatible versions, it should be specified as blacklist:

rules:
- client: client_with_blacklistblacklist:
- v1
- v2
- v4

This means that all clients except v1, v2, and v4 are allowed for usage.

Whitelisting

The second mode is whitelisting. In case there are specified white list - all other versions become gray. Gray versions means it could be used in tests but not in production requests. Therefore all new versions adds to graylist and could be manually added to white or black list.

rules:
- client: client_with_whitelistwhitelist:
- v3blacklist:
- v1
- v2

Chain meta

chains-meta.yaml is autogenerated file that contains additional information about ethereum-like chains - currency and links to explorers.

To regenrate this file you can run tool from get-meta folder.

About

public files of dRPC

Resources

Stars

8 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages