Giter Club home page Giter Club logo

ping-thing-client's Introduction

ping-thing-client

Node JS Client to contribute ping times to the Validators.app Ping Thing.

Install notes

git clone https://github.com/Block-Logic/ping-thing-client.git cd ping-thing-client/

Try yarn install. If that doesn't work, use: yarn add @solana/web3.js yarn add dotenv yarn add xhr2

I use .env to hold sensitive data that I don't want to appear in the GitHub repo. Copy .env.sample to .env and replace the values inside the file with your data. The .env file needs your private wallet keypair in base58 format. There is a simple Ruby script that will convert a keypair.json file into base58. See keypair_to_base58.rb

Before you can post pings to validators.app, you will need an API key. You can sign up at https://www.validators.app/users/sign_up and grab a free API key from your dashboard. Note: Your login handle will be displayed on the public Ping Thing page.

After retrieving your API key, copy & paste it into the VA_API_KEY attribute of your .env file.

In the .env file, try VERBOSE_LOG=true to see log output the first time you run the script. After saving your .env file, try running the script with node ping-thing-client.mjs and watch the output. I use VERBOSE_LOG=false in production to minimize log noise.

Running the Ping Thing Script

You can start the script & push it to the background with node ping-thing-client.mjs >> ping-thing.log 2>&1 &.

Look for an example service file in this repo soon.

RPC Notes

If you are running the Ping Thing client on your validator node, you need to enable private RPC for access from your localhost. You also need to enable --enable-rpc-transaction-history to get the TX slot after confirmation.

Misc Notes

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.