Skip to main content

Command line interface used for generating local Lightning test environment

Project description

Aesir

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

Aesir banner

Prerequisites

  • python (3.8+)
  • pip
  • docker

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 docker 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
> ╭───── containers ─────╮┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
>  aesir-postgres       │┃ Name           Nodekey       Channels   Peers   Height  Synced? ┃
>  aesir-pong           │┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
>  aesir-ping           ││ aesir-pong     3da33d3eb12   2          1       216        true │
>  aesir-bitcoind       ││                deacf4e1a64                                      │
>  ...                  ││ ...            ...           ...        ...     ...     ...     

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
> ╭───── containers ─────╮┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
>  aesir-postgres       │┃ Name           Nodekey       Channels   Peers   Height  Synced? ┃
>  aesir-redis          │┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
>  aesir-lnd            ││ aesir-lnd      c0ae6b158d0   0          0       202        true │
>  aesir-bitcoind       ││                4194459b8f3                                      │
>  ...                  ││ ...            ...           ...        ...     ...     ...     

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.

Roadmap

  • Simplify schema.yml and embed commands to service definitions
  • De-couple from polarlightning images and build from aesir definitions
  • Remove deprecated section
  • Write click tests.
  • Add aesir-tesla-ball peripheral service using tesla-ball
  • Use joblib to speed up deployment with parallelization.
  • Create and add some type of ordapi peripheral service.

Contributions

This project uses poetry package manager to keep track of dependencies. You can set up your local environment as such:

pip install --user poetry

And then you can install development dependencies like so:

$ pip install --user poetry
> ...
$ poetry install --with dev  # install with development dependencies
> Installing dependencies from lock file
>
> Package operations: 33 installs, 0 updates, 0 removals
>
>    ...
>    ...
>    ...
>    ...
>
> Installing the current project: aesir (0.4.2)

Known issues

You may run into this setback when first running this project. This is a docker-py issue widely known as of October 2022.

docker.errors.DockerException:
  Error while fetching server API version: (
    'Connection aborted.', FileNotFoundError(
      2, 'No such file or directory'
    )
  )

See the following issue for Mac OSX troubleshooting. docker from_env and pull is broken on mac Recommended fix is to run the following command:

sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock

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.4.8.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

aesir-0.4.8-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aesir-0.4.8.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.0 Darwin/22.1.0

File hashes

Hashes for aesir-0.4.8.tar.gz
Algorithm Hash digest
SHA256 68ce3efb2b048a4461f441c9da5a25b0038e55da34da6d261d406972cc315702
MD5 47c5358048e629d41dc355c1abb2f783
BLAKE2b-256 b0f73fb435902862cbd2f8cd36ff7de102a3dc09ecceed940e6f03bc782741a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aesir-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.0 Darwin/22.1.0

File hashes

Hashes for aesir-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6943ef38a78c33160c3c5d34194b2af9edef25af08e33ec5c168112153594a96
MD5 44a180ecbaa3c0a7560f54efe90de772
BLAKE2b-256 8ecde64dc1280921176d62d2077ae144f115e7ba78538ee8bd2e2fe296c52f13

See more details on using hashes here.

Supported by

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