Giter Club home page Giter Club logo

blockwallet-eth-proxy's Introduction

eth-proxy

Simple proxy for ethereum nodes to handle the authentication and endpoints. It exposes the '/' for RPC and optionally '/ws' for web sockets. Also it adds a customizable endpoint called "/status" used as a health check to know if the nodes was rate limited by sending a POST with a node method (ideally that doesn't consume compute units). The proxy adds Authorization header to all RPC/WS requests (optional).

Usage

  1. Install Docker.
  2. Spin up eth-proxy docker container:
    # RPC_ENDPOINT - RPC endpoint of the node deployed on Chainstack.
    # WS_ENDPOINT - WebSocket endpoint of the node deployed on Chainstack.
    # ENDPOINT - If the WS and RPC endpoints are the same you can use this variable.
    # USERNAME, PASSWORD - [optional] basic auth credentials to access the node deployed on Chainstack.
    
    # DNS: DNS host.
    # PORT: The proxy will listen to this port.
    # WS: flag in "YES" to enable a /ws endpoint allowing web sockets
    # STATUS_METHOD: node method to check if the node was rate limited or not.
    
  3. Use proxy to send requests to the node:
    curl 'http://localhost:8545' -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0","method": "eth_blockNumber","params": [],"id": 83}'
    

blockwallet-eth-proxy's People

Contributors

akegaviar avatar ichbineze avatar leablock avatar zaslavskii avatar

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.