Sign inSign up

nanojson/nanorpcproxy

By nanojson

•Updated about 4 years ago

A relay and protection system for Nano nodes. https://github.com/Joohansson/NanoRPCProxy

Image
0

50K+

nanojson/nanorpcproxy repository overview

⁠NanoRPCProxy

NanoRPCProxy is a relay and protection system that operates between a client and a Nano node RPC interface. It makes it possible to set the RPC interface public to the Internet without compromising the security of the node itself. The Nano node has no built-in functionality for user authentication, rate-limiting or caching which makes it dangerous to open up without protection as this proxy provides. With NanoRPCProxy you can, for example, serve a mobile app or web frontend with indirect node calls.

In reality, it can be used for Nano wallets, exchanges, block explorers, public APIs, monitor systems, Point of Sale or anything that communicates with a node.

The built-in token system makes it possible to serve requests beyond the default limits and monetize your backend via direct Nano token purchases.

Demo clients/code for Curl, JS, REACT, Python and Flask are available to test your own server.

Public API demo client with token support: https://api.nanos.cc⁠


In addition to the RPC interface, NanoRPCProxy also has built-in support for certain websocket subscriptions offered by the Nano node, for example block confirmations. Similar to the RPC, the websocket is DDOS protected and acts as a secure layer between the client and the node. This allows, for example, a public websocket open to everyone who needs to track certain accounts in real-time, without the need to set up their own node. That could be, but not limited to:

  • Microprocessors controlling hardware (IoT) like animal feeder, beer dispenser, door locks, arcade machines, exhibition demos, hobby projects, etc
  • Web apps with features activated by payments, wallet alert/tracking, payment listener, games, etc

Demo clients for websocket is available for JS (web) and Node.js.

Public websocket demo: https://api.nanos.cc/socket⁠

Apart from increased security, NanoRPCProxy solves the scalability issue where a node can't serve too many clients and lets the node do what it's supposed to do, ie. process blocks as fast as possible. The system can be scaled up to serve thousands of clients with only one connection to the node per proxy server.

⁠Features

  • Fully customizable via a settings file
  • Supports any RPC command for any remote client; like wallets, exchanges, apps, games, bots or public API
  • Supports websocket subscriptions for block confirmations; like account tracking (multiple accounts allowed) and public endpoint
  • Caching of certain request actions to lower the RPC burden
  • Limits the number of response objects, like the number of pending transactions
  • Slows down IPs that doing requests above limit (Overridden by purchased tokens)
  • IP filter for max allowed requests per time window (Overridden by purchased tokens)
  • Extra DDOS protection layer (defaults to max 2 requests/sec, also for purchased tokens)
  • IP black list (also for purchased tokens)
  • Supports basic authentication (username / password) (also for purchased tokens)
  • Supports multiple users via authentication
  • User-specific settings override
  • Optional token system for requests with built-in Nano purchases => independent of any 3rd party payment processors => unlimited implementation possibilities
  • Supports POST requests like the RPC, ie. payload = {"action":"block_count"}
  • Supports GET requests, ie. URL query = /proxy/?action=block_count
  • Both RPC and websocket support http and/or https with your own SSL cert (or use another proxy like Cloudflare to serve https)
  • Works with both beta and main Nano network
  • Support for both delegated PoW (dPoW) and BoomPoW (bPoW)
  • Multiple demo clients for developers

Full description: https://github.com/Joohansson/NanoRPCProxy⁠

Tag summary

Content type

Image

Digest

Size

355.6 MB

Last updated

almost 5 years ago

docker pull nanojson/nanorpcproxy