Nexus Server
Learn how to configure and launch a Nexus server
Initializing a Nexus Server
Nexus
is the entrypoint for your proxy. It can be configured in many different ways, on many different platforms. Let’s take a look at the anatomy of a simple Nexus
server instance.
In this example, we first create two NodeProvider
instances, which we’ll use to connect to Ethereum Mainnet
via Alchemy
and Infura
. We then create a Nexus
instance, passing in the NodeProvider
instances, the port we want to run the server on, and some logging and relay configuration. In this particular example, we configure the relay to retry failed requests up to 3 times, and to randomize the order of requests.
Running a Nexus Server
Nexus servers are designed to run on many different platforms. See Integrations for more information on how to run Nexus on your platform of choice. In this example, let’s set up a NodeJs standalone server.
Interacting with a Nexus Server
Once you have a Nexus server running, you can interact with is using any JSON-RPC client. Here’s an example using curl
. Pay attention to the endpoint. Nexus servers are designed to handle multiple chains, so you need to specify the chain ID in the endpoint. In this example, since we have configured the server to connect to Ethereum Mainnet
, we use the chain ID 1
.
Was this page helpful?