Get Started

EZAT RPC Overview

At EZAT, we run RPC endpoints for Polygon, Binance Smart Chain, Ethereum, and Metabit. To make it easier for developers to integrate with EZAT, we've created this document that shows how to call RPC methods using JavaScript.

Authentication Options

API Key Authentication - By default, all endpoints created on EZAT are protected by an API key in the URL which looks something like this:

https://api.ebs.ezat.io/core/api/v1.0/rpc/sample-endpoint-name?x-api-key-id=API-KEY-ID&x-api-key=API-KEY

For API keys generation, read step-by-step guide.

You can also pass the API key ID and API key in the header which looks something like this:

var myHeaders = {
  x-api-key-id: API-KEY-ID,
  x-api-key: API-KEY
}

var raw = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "sample-method-name",
  "params": [],
  "id": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.ebs.ezat.io/core/api/v1.0/rpc/sample-endpoint-name", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Disabling API Key Authentication - You can also disable the API Key authentication completely in API Key Management.

Setting up Web3 SDKs & Programming Languages

Ethers.js

At EZAT we prefer ethers.js as our JS library for interacting with JSON-RPCs when possible. Ethers aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. If you'd like to use it, please be sure to install it like so:

npm install --save ethers

Web3.js

There is also Web3.js - it's a collection of libraries that allow you to interact with a local or remote ethereum node using HTTP, IPC or WebSocket. If you'd like to use it, please be sure to install it like so:

npm install web3

JavaScript

To run our JavaScript code examples, you'll need to have Node v18 and up installed. You can follow this official document to install the latest, stable version of Node globally. Check if you have it by running the following:

node -v

Last updated