Unveiling the Community RPC Experimental Program by DCDAO: Empowering Darwinia’s Community-driven Ecosystem

Darwinia
DARWINIA NETWORK
Published in
5 min readJul 4, 2023

Introduction

DCDAO (Darwinia Community DAO), a freshly-minted community self-organized workgroup (WG) to the Darwinia ecosystem, is committed to fostering the growth and advancement of the Darwinia community.

The DCDAO focuses on the following areas to foster the growth of the Darwinia community:

Community engagement and support: Enhancing communication, providing educational resources, and offering assistance to community members.

Marketing and promotion: Creating awareness about the Darwinia ecosystem and its features through social media, events, and collaborations with other projects.

Development support: Facilitating the development of tools, applications, and infrastructure that benefit the Darwinia ecosystem and its users.

For more details, please refer to Introducing the Darwinia Community DAO (DCDAO).

The Community RPC Experimental Program is an exploration by DCDAO within the realm of development support, that aims to empower Darwinia's Community-driven Ecosystem. This program brings forth two significant benefits:

1. For Dapp developers, the Community RPC service is now live and accessible through the following endpoints:

https://darwinia-rpc.darwiniacommunitydao.xyz
https://crab-rpc.darwiniacommunitydao.xyz

2. And community members will have the opportunity to receive financial support by providing RPC services.

In the following sections, Darwinia will provide a brief overview of this program by DCDAO and guide community members through the process of becoming an RPC provider. By following the steps outlined below or referring to the tutorial provided by DCDAO, community members can join the ranks of Community RPC providers.

Community RPC Experimental Program

DCDAO has initiated an experimental program aimed at expanding the range of community RPC endpoints for the Darwinia Chain. This program move serves to enhance the decentralization of the Darwinia Chain node service, ultimately leading to a more stable and reliable RPC service for users while maximizing the utilization of community resources.

In order to motivate active participation and ensure superior service quality, DCDAO will implement a rewards system that recognizes and rewards community members based on the excellence of their service. Learn more from the program proposal of DCDAO.

Step 1: Run A Darwinia Chain Archive Node

📌 To establish the Community RPC endpoint, it is essential to operate a 
Darwinia Chain ARCHIVE NODE. This type of node is crucial for providing the
necessary data and information required for the RPC service to function
correctly. By running an ARCHIVE NODE, you can ensure the availability of
historical blockchain data.

Recommended Hardware

  • RAM: 16 GB
  • Storage(SSD): 1 TB

Run Node

You have the flexibility to choose between two methods for setting up your Darwinia Chain archive node: utilizing Docker or using a precompiled binary.

Method 1 — Docker

  • After replacing the parameters within the angle brackets with your own values, execute the following command:
$ docker run -it --rm --name node-darwinia2 \\
--restart=always \\
-p=<YOUR_LOCAL_HTTPS_PORT>:9933 \\
-p=<YOUR_LOCAL_WSS_PORT>:9944 \\
-v=<YOUR_LOCAL_DATA_DIR>:/home/darwinia/data \\
ghcr.io/darwinia-network/darwinia:v6.3.4-1 \\
--chain=darwinia \\
--base-path=/home/darwinia/data \\
--state-pruning=archive \\
--blocks-pruning=archive \\
--ws-max-connections=1000 \\
--ws-external \\
--rpc-external \\
--rpc-cors=all

📌 Note 1:
If you are running Docker with a non-root user, please ensure that the value for YOUR_LOCAL_DATA_DIR is set to one of the following options:
1. /home/darwinia
2. /data
📌 Note 2:
1. "--ws-max-connections=1000" is optional, it is used to limit your node's
max connections.
2. if you are also a collator, replace "--ws-external --rpc-external"
with " --collator --unsafe-ws-external --unsafe-rpc-external".
  • (Optional) Download History Data
# polkadot history data
wget <https://dot-rocksdb.polkashots.io/snapshot> -O - | tar -I lz4 -xf - -C <YOUR_LOCAL_DATA_DIR>/polkadot/chains/polkadot
# darwinia history data
wget <https://snapshots.darwinia.network/darwinia2-454050.tar.zst> -O - | tar -I zstd -xf - -C <YOUR_LOCAL_DATA_DIR>/chains/darwinia2

Go to https://snapshots.darwinia.network to get the latest data.

Method 2 — Precompiled Binary

  • Download and uncompress the binary.

As of the time of writing this article, the latest version of the Darwinia Chain is v6.3.4. Please ensure that you check for the latest version when running your own node.

https://github.com/darwinia-network/darwinia/releases/download/v6.3.4/darwinia-x86_64-linux-gnu.tar.bz2

wget https://github.com/darwinia-network/darwinia/releases/download/v6.3.4/darwinia-x86_64-linux-gnu.tar.bz2
tar xvf darwinia2-x86_64-linux-gnu.tar.bz2

  • After replacing the parameters within the angle brackets with your own values, execute the following command:
$ darwinia \
--chain=darwinia \
--base-path=<YOUR_LOCAL_DATA_DIR> \
--state-pruning=archive \
--blocks-pruning=archive \
--ws-max-connections=1000 \
--rpc-port=<YOUR_LOCAL_HTTPS_PORT> \
--ws-port=<YOUR_LOCAL_WSS_PORT> \
--ws-external \
--rpc-external \
--rpc-cors=all
  • (Optional) Download History Data
# polkadot history data
wget https://dot-rocksdb.polkashots.io/snapshot -O - | tar -I lz4 -xf - -C <YOUR_LOCAL_DATA_DIR>/polkadot/chains/polkadot
# darwinia history data
wget https://snapshots.darwinia.network/darwinia2-454050.tar.zst -O - | tar -I zstd -xf - -C <YOUR_LOCAL_DATA_DIR>/chains/darwinia2

Go to https://snapshots.darwinia.network to get the latest data.

Test Your Endpoint

Once your archive node has successfully caught up with the latest block, you can employ the following command to test the functionality of your endpoint.

Test in your localhost

$ curl -X POST -H 'Content-Type: application/json' <http://localhost>:<YOUR_LOCAL_HTTPS_PORT> -d '{"id":26,"jsonrpc":"2.0","method":"state_getRuntimeVersion","params":["0x068226c8afce280b3ba0f73a3ae56d26751c2324f8a718c154fb5db9e7cbdbbd"]}'

Test remotely

$ curl -X POST -H 'Content-Type: application/json' http://<YOUR_IP_OR_DOMAIN>:<YOUR_LOCAL_HTTPS_PORT> -d '{"id":26,"jsonrpc":"2.0","method":"state_getRuntimeVersion","params":["0x068226c8afce280b3ba0f73a3ae56d26751c2324f8a718c154fb5db9e7cbdbbd"]}'

Ensure that the ports associated with your RPC endpoint are accessible from outside of your host.

Step 2: Submit Your Pull Request

  • Open this link in your browser.
  • Fill out the form like this and then submit it:

Resources:

About DCDAO

GitHub | Twitter | Snapshot | Discussion

The Darwinia Community DAO (DCDAO) is a community self-organized workgroup (WG) that aims to contribute to the growth and development of the Darwinia community. Sponsored by the Darwinia Treasury and Itering, the DCDAO welcomes donations and contributions from community members who share its vision and objectives.

About Darwinia Network

GitHub | Website | Medium | Twitter | Telegram | Discord

Darwinia is a cross-chain programmable network that provides two essential solutions: Darwinia Chain and Darwinia Msgport. Darwinia Chain is a smart contract platform compatible with the EVM and shares the robust security of Polkadot. On the other hand, Darwinia Msgport acts as a crucial infrastructure enabling Dapps to seamlessly communicate and exchange messages across different blockchain networks, facilitating efficient interchain operations.

--

--

Darwinia
DARWINIA NETWORK

As an open cross-chain bridge protocol based on Substrate, Darwinia focuses on the construction of future Internet of Tokens. TG: http://t.me/DarwiniaNetwork