Skip to main content

Command line interface used for generating local Lightning test environment

Project description

Aesir

Bitcoin-only Lightning Docker License: MIT Top Languages Size Last commit

Aesir banner

Prerequisites

  • python 3.10 and above - High-level general-purpose programming language
  • pip - package installer for Python
  • docker - build, deploy run, update and manage containerized applications

Getting started

You can use aesir simply by installing via pip on your Terminal.

pip install aesir

And then you can begin deploying local cluster as such:

aesir deploy

The initial deployment may take some time at pulling required images from their respective repositories. Results may look as such:

$ pip install aesir
> ...
> Installing collected packages: aesir
> Successfully installed aesir-0.4.3
$ aesir deploy
> Deploy specified local cluster:            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01
> Generate addresses:                        ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
> Mine initial capital for parties:          ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

You will have podman containers running in the backend, ready to be interfaced by your local environment applications you are developing.

Begin local mining

In order to properly test many functionalities, you will need to send mining commands to local setup. You can achieve completely local and running environment with the following command:

Demonstration

Cluster types

Currently there are two supported cluster-types in this project. Specified by flags, --duo (default), or --cat, --ohm, --uno with the following set-up:

Type Description
cat Customized aesir-bitcoind-cat node that has OP_CAT enabled for experiments
duo Contains two LND nodes named aesir-ping and aesir-pong unified by
one single aesir-bitcoind service.
ohm Only has aesir-bitcoind without any Lightning nodes.
uno Only has one LND node named aesir-lnd connected to aesir-bitcoind.

Peripheral containers

This project also helps you setup peripheral services to make development process easier, too. For example, if you want to deploy a duo-cluster with attached postgres database, run the following:

$ aesir deploy --with-postgres
> ...
$ aesir mine
> FIXME

Or run an uno-cluster with both attached postgres database and redis solid store cache like this:

$ aesir deploy --uno --with-postgres --with-redis
> ...
$ aesir mine
> FIXME

Cleanup

Use the following command to clean up active aesir-* containers:

aesir clean

🚧 This will resets the current test state, so use with care. Example below:

$ aesir clean
> Remove active containers:                  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01

Change-logs

  • 0.3.1 Add aesir-cashu-mint & aesir-lnd-krub image setups and deployments w/ shared volumes
  • 0.3.2 Define classifiers on pyproject.toml for PyPI metadata
  • 0.3.3 Drop black and use ruff formatter and linter
  • 0.3.4 Simplify deployment workflows and
  • 0.3.5 Restructure project so that when installed, src folder will not be created
  • 0.3.6 Breakdown "setup" command into "build" and "pull"
  • 0.3.7 Lightning cluster now with ord
  • 0.3.8 Rename "ord" to "ord-server" to avoid confusion with cli
  • 0.3.9 Remove intermediate containers
  • 0.4.0 Resist electricity with "ohm" mode
  • 0.4.1 Remove Ordinals' spiked ball
  • 0.4.2 Disable bitcoind prune mode
  • 0.4.3 Implement dashboard walkthrough using blessed
  • 0.4.4 Add cat cluster in deployment and --bitcoind-cat flag for customized build
  • 0.4.5 The Yggdrasil update where docker build logs are chunked for display
  • 0.4.6 Create default wallet if no lnd containers
  • 0.4.7 (reverted) Remove unittesting from image build process
  • 0.4.8 Follow Productivity Notes for bitcoind-cat; Fix progress bar overlap.
  • 0.4.9 Change package manager and add invoice command
  • 0.5.0 Adopt podman to encourage daemonlessness and rootlessness
  • 0.5.1 Drop podman support for unstable SSH connections, viva Docker
  • 0.5.2 Stricten type definitions and fix undefined/attribute bugs
  • 0.5.3 Define aesir-bitcoind and aesir-lnd build instructions. Decouple from Polar's
  • 0.5.4 Add Lightning Terminal to list of available peripherals as aesir-litd
  • 0.5.5 Fix build selection and ordering for missing images in deploy command

Roadmap

  • Add CI/CD with testcontainers
  • Simplify schemas.yml and embed commands to service definitions
  • Drop docker-py and replace with podman-py (rolled back and on hold)
  • Write click tests.
  • Use joblib to speed up deployment with parallelization.
  • Create and add some type of ordapi peripheral service.

Known issues

  • Mining dashboard hangs when using aesir-bitcoind & aesir-ord-server together in ohm cluster
  • Rust images like aesir-electrs and aesir-ord-server are prone to build failure

Contributions

Prerequisites

  • pyenv - simple Python version management
  • uv - extremely fast Python package & project manager written in Rust

Set up local environment

The following guide walks through setting up your local working environment using pyenv as Python version manager and uv as Python package manager. If you do not have pyenv installed, run the following command.

Install using Homebrew (Darwin)
brew install pyenv --head
Install using standalone installer (Darwin and Linux)
curl https://pyenv.run | bash

If you do not have uv installed, run the following command.

Install using Homebrew (Darwin)
brew install uv
Install using standalone installer (Darwin and Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh

Once you have pyenv Python version manager installed, you can install any version of Python above version 3.10 for this project. The following commands help you set up and activate a Python virtual environment where uv can download project dependencies from the PyPI open-sourced registry defined under pyproject.toml file.

Set up environment and synchroniz project dependencies
pyenv shell 3.11.9
uv venv  --python-preference system
source .venv/bin/activate
uv sync --dev

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aesir-0.5.5.tar.gz (400.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aesir-0.5.5-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file aesir-0.5.5.tar.gz.

File metadata

  • Download URL: aesir-0.5.5.tar.gz
  • Upload date:
  • Size: 400.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for aesir-0.5.5.tar.gz
Algorithm Hash digest
SHA256 18c836f90d5acffeb61e0000b02340263c0787a66013c295342de978a1e8f4ac
MD5 73b0ad2aa1f6220d13ef4b28c4819199
BLAKE2b-256 37eb6400ae67d77258d0a7f0cf4d1e78ad168363e280991bbb519f842423a718

See more details on using hashes here.

File details

Details for the file aesir-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: aesir-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for aesir-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 44d9dc20c2bc2ff02a7ee9a6df98ca504868ec840e4e1cfd24a114ec3aa7e2f1
MD5 885bb7680007a8572581e5d645fd2a09
BLAKE2b-256 41e250d3b7cc6ea990b44ac092022084552bfe64d7756743c4804bc92ae5f991

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page