Skip to content

Web3.js

You can also use web3.js to connect to Cyber Testnet and Mainnet.

Install

npm install --save web3

Setup

const { Web3 } = require("web3");
const web3 = new Web3("https://cyber-testnet.alt.technology/"); // Testnet rpc

Read data from Cyber

const latestBlock = await web3.eth.getBlockNumber();