Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shopstr local dev (regtest) environment #98

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

riccardobl
Copy link
Contributor

@riccardobl riccardobl commented Jan 28, 2025

This pr adds a preseeded local dev environment for shopstr using docker-compose.
When shopstr is started from the dev environment, everything runs locally, in a deterministic environment where the dev can experiment and break stuff without worrying about consequences.

The environment includes:

  • bitcoind, lnd and cln nodes running in regtest
  • an elementd node with a local boltz instance (for future liquid swaps)
  • a cashu mint connected to lnd
  • a nostr relay
  • postgress with the required plugins
  • imgpush as replacement for nostr.build, since the nostr.build deployment is very convoluted ( it needs a local s3 provider and some other stuff)
  • the shopstr instance launched in watch mode

Most of this stuff is technical, and the dev doesn't really need to know about any of that.
The only thing the dev has to do is to start the environment with

./shopstr start

and connect to localhost:3000. Everything will just work™ and will be already pre-configured to use the dev environment resources.

Additionally there are some other useful commands that the dev can use to interact with the environment, most notably:

# stop and delete the changes (reset the env)
./shopstr delete 

# pay a local invoice (eg. a cashu minting invoice)
./shopstr pay <invoice> 

# show the logs
./shopstr logs

#  generate a deterministic nsec for the given username (ie. the nsec is always the same in every instance of shopstr dev environment)
./shopstr login username 

All the commands are available from ./shopstr help

    start                        - Start the dev environment
    stop                         - Stop the dev environment
    delete                       - Reset the dev environment (delete containers and volumes)
    lnd <command>                - Execute lncli commands on the lnd container
    cln <command>                - Execute lightning-cli commands on the cln container
    invoice <amount>             - Create a lightning invoice
    pay <invoice>                - Pay a lightning invoice
    logs                         - Show and follows the logs of a container (defaults to shopstr if no container is specified)
    ps                           - Show the status of the containers
    exec <container> <command>   - Run a command on a container (defaults to shopstr if no container is specified)
    cmd  <container>             - Open a shell on a container (defaults to shopstr if no container is specified)
    login <username>             - Generate a nsec to login in shopstr for the given username

Fixes: #96
and might be a good starting point for: #76

@riccardobl
Copy link
Contributor Author

This is a draft because i still need to version lock the containers, but it is technically working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

postgis 3.4.1 is deprecated(?)
1 participant