Coder Social home page Coder Social logo

blockchain-api's Introduction

Blockchain API

๐Ÿ“š Documentation

Blockchain RPC proxy for interacting with multiple EVM and non-EVM blockchains. Also offers higher-levels functions such as ENS resolution and transaction history. We do not run our own blockchain RPC nodes but instead proxy to and load balance across other popular RPC providers.

Not to be confused with the WalletConnect Relay.

Usage

Endpoint: https://rpc.walletconnect.com/v1?chainId=eip155:1&projectId=<your-project-id>

For example:

curl -X POST "https://rpc.walletconnect.com/v1?chainId=eip155:1&projectId=<your-project-id>" --data '{"id":"1","jsonrpc":"2.0","method":"eth_chainId","params":[]}'

Obtain a projectId from https://cloud.walletconnect.com

See SUPPORTED_CHAINS.md for which chains we support and which chainId to use.

Development

Requirements

  • Rust >= 1.56 version,
  • Just as a command runner,
  • Docker for building and running Docker containers.

Building and running

cp .env.example .env
nano .env
just run
# projectId is not validated under default .env.example configuration
curl -X POST "http://localhost:3000/v1?chainId=eip155:1&projectId=someid" --data '{"id":"1","jsonrpc":"2.0","method":"eth_chainId","params":[]}'

Testing

just devloop

Docker

$ docker build . --tag rpc-proxy:
$ docker run -p 3000:3000 \
    -e RPC_PROXY_POKT_PROJECT_ID=<some_id> \
    -e RPC_PROXY_INFURA_PROJECT_ID=<some_id> \
    -e RPC_PROXY_QUICKNODE_API_TOKEN=<some_id> \
    -e RPC_PROXY_REGISTRY_API_URL=<registry_url> \
    -e RPC_PROXY_REGISTRY_API_AUTH_TOKEN=<token> \
    --name rpc -it rpc-proxy

Docker Compose

If you need to test with registry caching activated, you can use docker-compose to spawn a redis instance for the proxy:

$ RPC_PROXY_POKT_PROJECT_ID=<some_id> \
  RPC_PROXY_INFURA_PROJECT_ID=<some_id> \
  RPC_PROXY_QUICKNODE_API_TOKEN=<some_id> \
  RPC_PROXY_REGISTRY_API_AUTH_TOKEN=<token> \
  docker-compose up

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.