Skip to content

pierogiDev/get_geth_connections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This package is just only a selector of preset addresses of the Geth using web3.js.

Usage

Prepare a .env file like below according to your development environment using the Geth and the web3.js.

GETH_VPN_HTTP_API_ADDRESS=http://171.1.1.1:8545
GETH_VPN_SOCKET_API_ADDRESS=ws://171.1.1.1:8546
GETH_LAN_HTTP_API_ADDRESS=http://192.168.1.1:8545
GETH_LAN_SOCKET_API_ADDRESS=ws://192.168.1.1:8546

And use the module like below.

import {gethVpnHttpClient, gethVpnSocketClient, gethHttpClient, gethSocketClient} from "@pierogi.dev/get_geth_connections";

//Get a block information from a http api of the Geth.
let blockInfo = gethHttpClient.getBlock('15000000');

//Get a new block information from a socket api of the Geth via vpn.
gethVpnSocketClient.subscribe('newBlockHeaders', (error: Error, result: T) => {
    console.log(result);
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published