Skip to content

chainstacklabs/unstoppable-rpc

Repository files navigation

The Unstoppable RPC Endpoint

The Unstoppable RPC Endpoint: Aggregating RPC endpoints for improved availability, low latency, and enhanced security. Open source and accessible to all DApp projects.

Architecture

Solution is based on Cloudflare Workers, using Cloudflare KV Storage plugin and Cloudflare Caching API.

Architecture

Getting Started

Installation

  1. Install npm and yarn locally
  2. Create Cloudflare account
  3. Install dependencies
yarn install
  1. Login into wrangler locally
yarn run wrangler login

Node list configuration

  1. Create KV namespace in Cloudflare KV
  • for development create preview KV
yarn run wrangler kv:namespace create CONFIG_KV --preview
  • for production create regular KV
yarn run wrangler kv:namespace create CONFIG_KV

add config from console output into wrangler.toml file, example:

  • dev:
kv_namespaces = [
    { binding = "CONFIG_KV", preview_id = "PREVIEW_ID" }
]
  • prod:
kv_namespaces = [
    { binding = "CONFIG_KV", id = "ID" },
]
  1. Prepare node list data with your list of endpoints

Example and structure could be found in node-config-example.json

Tips:

  • you can specify coordinates of node to get geo routing benefits and minimize latency
    • this info could be extracted from IP by external services such IP Info
  1. Enter node list data into created KV namespace
  • go to Cloudflare UI -> Workers KV page
  • select your created namespace
  • create new item(entry) into namespace

Develop

  1. Make sure KV namespace is created and node list is configured
  2. Run web server locally
yarn run wrangler dev

Publish

  1. Make sure KV namespace is created and node list is configured
  2. Publish worker code to Cloudflare Workers
yarn run wrangler publish

Acknowledgments

The project was done for ETH Belgrade hackathon 2023

Team members:

About

ETH Belgrade Hackaton 2023 project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published