Code Monkey home page Code Monkey logo

testnet-manager's Introduction

Parity Testnet Manager

A simple UI and REST API to operate Polkadot multi-chains testnets in Kubernetes.

The testnet-manager let you view the following information about nodes running in your cluster:

  • List Substrate nodes running in Kubernetes and query their status over RPC
  • List Validators running in Kubernetes
  • List Parachains and collator nodes

When provided with the relay-chain Sudo account, the testnet-manager can perform the following actions:

  • Register/Deregister validator nodes
  • Rotate validator session keys
  • Onboard/Offboard a parachain
  • Register/Deregister parachain collators

Running tests

python -m pytest

Running locally

Note that running with those commands will fail to connect to your Kubernetes cluster and running nodes without adapting them to your setup. As such, it is recommended to refer to the next section for instructions to run a complete local stack in Kubernetes.

Setup the local environment:

poetry install
poetry shell

Set environment variables, eg:

NAMESPACE=rococo
HEALTHY_MIN_PEER_COUNT="1"
WS_ENDPOINT: "wss://rococo-rpc.polkadot.io"
NODE_HTTP_PATTERN: "http://NODE_NAME.rococo:9933"
NODE_WS_PATTERN: "ws://NODE_NAME.rococo:9944"
HEALTHY_MIN_PEER_COUNT: "1"
SUDO_SEED=***
VALIDATORS_ROOT_SEED=***
TESTNET_MANAGER_CONSENSUS=poa

Start the app:

# Dev
python -m uvicorn main:app --reload
# Prod
python -m gunicorn -k uvicorn.workers.UvicornWorker main:app --bind 0.0.0.0:5000 --timeout=3600 --capture-output --enable-stdio-inheritance --workers 4

Running in a Local Kubernetes cluster

Install either Minikube or Rancher-Desktop. Then, start your Kubernetes cluster in a VM and run:

cd local-kubernetes/minikube # cd local-kubernetes/rancher-desktop
make setup
make install

Remark: Wait for the "setup" step (chainspec building) to complete before installing to prevent the nodes from failing to pull chainspecs files. For more information see helm/minikube/README.md

Continuously deploy to Kubernetes with Skaffold:

skaffold dev

testnet-manager's People

Contributors

alvicsam avatar bulatsaif avatar pierrebesson avatar

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.