For the complete documentation index, see llms.txt. This page is also available as Markdown.

Programmatic Requests

Build scripts using Axios or Requests, still calling read RPC methods but using more involved methods, e.g. eth_call

We can also write a simple script to make cURL requests. This will allow us to build around the RPC responses. This will make it easier to call different endpoints with different arguments and handle data that we receive from the RPC calls.

First, let's set up the typescript project.

  1. check node and npm (node package manager) versions:

In your terminal, enter:

node --version
npm --version

It should give something like:

v18.17.1
10.1.0

If these packages are not installed, run:

sudo apt install nodejs npm
  1. Create a project directory and navigate into it:

mkdir telSimpleCalls
cd telSimpleCalls
  1. Open a new VsCode (or alternative IDE) window of your directory:

code .
  1. Initialise a new project:

npm init -y
  1. As we will need typescript and axios packages, we install them using:

  1. Initialise the TypeScript configuration:

This command creates a tsconfig.json file in your project directory. You can leave the settings as default.

You should now have your TypeScript project set up! Let's get into writing some scripts!

Last updated