0.26.0 • Published 12 months ago

@whatsgood/nexus v0.26.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

hero banner with nexus dog

npm version npm downloads

Discord GitHub Actions Status Docker Image Size (tag)

Introduction

Welcome to Nexus - a load balancing blockchain RPC reverse proxy written in TypeScript.

Documentation

Check out our documentation for detailed instructions.

Installation

# npm
npm install @whatsgood/nexus

# pnpm
pnpm install @whatsgood/nexus

# yarn
yarn add @whatsgood/nexus

Quickstart

// node.js standalone server example

import { Nexus, NodeProvider, CHAIN } from "@whatsgood/nexus";
import { createServer } from "node:http";

const llamaRpcNodeProvider = new NodeProvider({
  name: "llama-rpc",
  chain: CHAIN.ETHEREUM_MAINNET,
  url: "https://eth.llamarpc.com",
});

const tenderlyNodeProvider = new NodeProvider({
  name: "tenderly",
  chain: CHAIN.ETHEREUM_MAINNET,
  url: "https://gateway.tenderly.co/public/mainnet",
});

const nexus = Nexus.create({
  nodeProviders: [llamaRpcNodeProvider, tenderlyNodeProvider],
  port: 4000,
});

createServer(nexus).listen(nexus.port, () => {
  console.log(`🚀 Server ready at http://localhost:${nexus.port}`);
});

Interaction

In this example, since we have configured the server to connect to Ethereum Mainnet, we supply the chain id = 1 as the endpoint.

curl \
    -X POST http://localhost:4000/1 \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
0.26.0

12 months ago

0.25.0

12 months ago

0.24.0

12 months ago

0.21.0

12 months ago

0.20.0

12 months ago

0.19.0

12 months ago

0.23.1

12 months ago

0.23.0

12 months ago

0.22.0

12 months ago

0.13.0

1 year ago

0.14.0

1 year ago

0.15.0

1 year ago

0.16.0

1 year ago

0.17.0

1 year ago

0.18.0

1 year ago

0.11.0

1 year ago

0.12.0

1 year ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago