1.0.7 • Published 12 months ago

@ethereum_net_stats/get_geth_connections v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

About

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

Usage

Prepare a .env file like below(see .envSample) 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
GETH_DOCKER_HTTP_API_ADDRESS=http://171.0.0.1:8545
GETH_DOCKER_SOCKET_API_ADDRESS=ws://171.0.0.1:8546

And use the package 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);
});

Note

This is just a package for my personal use. However, if you use a LAN and a VPN to access to your Geth node, this may make a little help.

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago