An open-source diagnostic tool for Pocket Network node runners.
- Using the public API
- Deploying to AWS Lambda
- Build the test commands locally
- Dev tools (Makefile) reference
The public deployment of this tool is available at the following baseURLs:
- staging: https://2eqrf8goof.execute-api.us-east-1.amazonaws.com/test
- production: https://2eqrf8goof.execute-api.us-east-1.amazonaws.com/prod
make docserver
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.
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 noderelaytest
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.
Requirements:
- Go 1.17
- GNU Make
# clone the repository
git clone https://github.com/decentralized-authority/pokt-lint
# build the commands
cd pokt-lint
make build-commands
Requirements:
- Docker
# 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
# 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
# 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
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