Skip to content

Commit

Permalink
docs: docker compose local development instructions (#259)
Browse files Browse the repository at this point in the history
doc: Docker Compose local development instructions
  • Loading branch information
walkah authored Jul 18, 2024
1 parent 063f00f commit 9938087
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion LOCAL_DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ The node can can run directly from an existing docker image, it will initialize

These are the commands to run the node and boot the network: `./stack chain-clean` (the first time this won't do anything, but I find it better to get in the habit of resetting artifacts everytime), `./stack chain` to run the node and `./stack chain-boot` to fund the accounts with ETH (for gas fees), compile the contracts, add Golang bindings to use the contracts directly in go code, deploy the contracts and fund the accounts with Lilypad tokens.


#### Summary of command sequence

```sh
./stack chain-clean
./stack chain
Expand Down Expand Up @@ -68,6 +68,34 @@ For the time being this process has to be executed directly and needs Golang to

There is ongoing work to pack together the `bacalhau` node and `resource provider` service in a docker container as these two are highly coupled and can be abstracted into one component.

## Using Docker Compose

This comment has been minimized.

Copy link
@AquiGorka

AquiGorka Jul 29, 2024

Contributor

😍


An alternative to the above for running the local stack is to use [Docker Compose](https://docs.docker.com/compose/).

Benefits of using Docker Compose include:

- Start/stop the full stack with a single command.
- Runs the docker images for all services (i.e. "closer to prod")
- Chain and Bacalhau state are maintained between runs (in the `./data` directory).

The main drawback is, for development, you'll need to re-build the images after changes for testing.

All of the docker commands have been wrapped by `./stack` - to simplify doppler configuration, etc.

### Running the stack

_First run_: run `./stack compose-init`. This essentially runs `./stack chain-clean` and `./stack chain-boot`.

Run `./stack compose-up` to start the stack.

### Re-building images

The first time you run docker compose, it will pull / build the images for all services. If you're making code changes, you'll want to re-build the docker images with your local changes. This can be done with `./stack compose-build`.

### Stopping / shutting down

Run `./stack compose-down`.

## Running a job

Once all the services are up and running this command can be used to trigger an on-chain job: `./stack run-cowsay-onchain`
Expand Down

0 comments on commit 9938087

Please sign in to comment.