Skip to content

0xHawre/AXELAR-data-fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Axelar RPC Block Height Fetcher

This Node.js script fetches the latest block height from specified Axelar RPC endpoints. It makes repeated requests to the endpoints, logs the block height, and includes error handling.

Prerequisites

Install Node.js If Node.js is not already installed, you can install it using the following commands:

sudo apt update && sudo apt upgrade -y
sudo apt install nodejs npm -y

Install Required Node.js Packages Install the axios package using npm:

npm install axios

Setup

  1. Clone the Repository:
git clone https://github.com/Hafxhak/AXELAR-data-fetcher.git
cd AXELAR-data-fetcher 
  1. Edit the Script:

Open the script in a text editor:

nano index.js

Replace the placeholder URLs in the rpcUrls list with your own Axelar RPC endpoint URLs. Example:

const rpcUrls = [
    'https://tm.axelar.lava.build/lava-referer-your-unique-id/',  // replace with your main-net RPC
    'https://tm.axelar-testnet.lava.build/lava-referer-your-unique-id/',  // replace with your test-net RPC
];

Save and exit the editor (for nano, press CTRL + X, then Y, and Enter).

Running the Script

  1. Install and Use Screen:

Install screen to run the script in a detached session:

sudo apt install screen -y
screen -S axelar
  1. Run the Script:

Execute the script using Node.js:

node index.js

Example Output

The script will log the latest block height from the RPC endpoint for each request. Example output:

Latest Block Height for https://tm.axelar.lava.build/lava-referer-your-unique-id/: 12345
  1. Detach from the Screen Session:

Detach from the screen session without stopping the script by pressing CTRL + A, then D.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published