Warnet runs on Kubernetes (k8s) and requires the Helm Kubernetes package manager in order to run the network.
The Kubernetes cluster can be run locally via minikube, Docker Desktop, k3d or similar, or remotely via Googles GKE, Digital Ocean, etc..
The utilities kubectl
and helm
must be installed and found on $PATH to administer the network.
Either install warnet via pip, or clone the source and install:
You can install warnet via pip
into a virtual environment with
python3 -m venv .venv
source .venv/bin/activate
pip install warnet
You can install warnet from source into a virtual environment with
git clone https://github.com/bitcoin-dev-project/warnet.git
cd warnet
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
The helm
and kubectl
utilities are required for all configurations to talk to and administrate your cluster.
These can be installed using your operating system's package manager, a third party package manager like homebrew, or as binaries directly into a python virtual environment created for warnet, by following the steps in Use warnet to install dependencies.
If you are using a cloud-based cluster, these are the only tools needed.
# Ensure the virtual environment is active
source .venv/bin/activate
# Run `warnet setup` to be guided through downloading binaries into the
# python virtual environment
warnet setup
If the number of nodes you are running can run on one machine (think a dozen or so) then Warnet can happily run on a local Kubernetes. Two supported local Kubernetes implementations are Minikube and Docker Desktop.
Docker desktop includes the docker engine itself and has an option to enable Kubernetes. Install it and enable Kubernetes in the option menu to start a cluster.
Minikube requires a backend to run on with the supported backend being Docker.
Install Docker first, and then proceed to Install Minkube.
After installing Minikube don't forget to start it with:
minikube start
Minikube has a guide on getting started which could be useful to validate that your minikube is running correctly.
After installing kubectl
and helm
the following commands should run successfully on either a local or remote cluster.
Do not proceed unless kubectl
and helm
are working.
helm repo add examples https://helm.github.io/examples
helm install hello examples/hello-world
helm list
kubectl get pods
helm uninstall hello
The use of a k8s cluster management tool is highly recommended.
We like to use k9s
: https://k9scli.io/
To get started first check you have all the necessary requirements:
Tip
Don't forget to activate your python virtual environment when using new terminals!
warnet setup
Then create your first network:
# Create a new network in the current directory
warnet init
# Or in a directory of choice
warnet new <directory>