Skip to content

A diagnostic tool for testing the operation of pocket network servicer nodes

License

Notifications You must be signed in to change notification settings

decentralized-authority/pokt-lint

Repository files navigation

Unit Tests   Go Report Card

POKT Lint

An open-source diagnostic tool for Pocket Network node runners.


Using the public API

The public deployment of this tool is available at the following baseURLs:

Run the OpenAPI docs locally

make docserver

Deploying to AWS Lambda

A public deployment is maintained on AWS. To build executables that can be uploaded to AWS Lambda, run the following command:

make build-lambda

This will create 2 archives that can be uploaded to their corresponding Lambda functions:

  • build/LambdaPingTestHandler.zip
  • build/LambdaRelayTestHandler.zip

You can also build and deploy to AWS using the aws-cli:

make deploy-lambda-all-qa
# or
make deploy-lambda-all

This uses the aws-cli docker container and expects ~/.aws/config and ~/.aws/credentials to exist.


Build the test commands locally

This package provides 2 commands that can be used to test the operation of Pocket Network nodes:

  • pingtest measures the latency between the test client and a node
  • relaytest runs relay tests on a node

The commands can be built and run directly on your host, or they can be built and run in a docker container.

Option 1) Build directly on your host

Requirements:

# clone the repository
git clone https://github.com/decentralized-authority/pokt-lint

# build the commands
cd pokt-lint
make build-commands

Option 2) Build using Docker

Requirements:

  • Docker

Build for Linux:

# clone the repository
git clone https://github.com/decentralized-authority/pokt-lint

# build the commands
cd pokt-lint
docker build -t pokt-lint .
docker run --rm -ti -v $PWD/build:/app/build pokt-lint

Build for macOS:

# clone the repository
git clone https://github.com/decentralized-authority/pokt-lint

# build the commands
cd pokt-lint
docker build -t pokt-lint -f Dockerfile-mac .
docker run --rm -ti -v $PWD/build:/app/build pokt-lint

Build for Windows:

# clone the repository
git clone https://github.com/decentralized-authority/pokt-lint

# build the commands
cd pokt-lint
docker build -t pokt-lint -f Dockerfile-win .
docker run --rm -ti -v %cd%\build:/app/build pokt-lint

This will create 2 executable files:

./build/pingtest

Usage of ./build/pingtest:
  -num int
    	-num 10 (default 1)
  -url string
    	-url https://www.example.com

./build/relaytest

Usage of ./build/relaytest:
  -chains string
    	comma separated chains ids, eg: -chains=0001,0003,0005
  -id string
    	node id
  -url string
    	node url

Dev Toolchain Reference

pokt-lint % make
usage: make [target] ...

targets:
-------
help                            Show this help message.
docserver                       Run an interactive OpenAPI spec on port 3333
docserver-stop                  Stop the interactive spec
build-commands                  <-- compiles executables to ${BUILD_DIR}
build-lambda                    <-- builds lambda function bundles in ${BUILD_DIR}
build-lambda-pingtest           builds the pingtest lambda function
build-lambda-relaytest          builds the relaytest lambda function
build-lambda-cors               builds the cors handler (to return access-control-* headers)
deploy-lambda-all-qa            <-- deploys all lambda QA functions
deploy-lambda-all               <-- deploys all lambda functions
deploy-lambda-pingtest-qa       builds and deploys the pingtest QA function
deploy-lambda-relaytest-qa      builds and deploys the relaytest QA function
deploy-lambda-cors-qa           builds and deploys the CORS QA function
deploy-lambda-pingtest          builds and deploys the pingtest function
deploy-lambda-relaytest         builds and deploys the relaytest function
deploy-lambda-cors              builds and deploys the CORS function
test                            runs the unit tests
clean                           deletes build artifacts

About

A diagnostic tool for testing the operation of pocket network servicer nodes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages