Skip to content

Commit

Permalink
instructions for devpod
Browse files Browse the repository at this point in the history
  • Loading branch information
QAston committed Dec 22, 2023
1 parent 6682aeb commit f09ffa9
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 41 deletions.
49 changes: 36 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,53 @@ How to use
----------

The primary interface for users is the container one,
accessed via `docker-compose` utility.
accessed via `docker compose` utility (docker compose v2, do not confuse with
v2 of the docker-compose spec, which is obsolete).

To get fresh privatenet up and running, invoke:
First, chose how you want to run the project and save your configuration in the
`.env` file:

* if you're using the opus devpod (internal chorus one project) run:
```bash
echo "COMPOSE_FILE=compose-devpod.yaml" > .env
echo "COMPOSE_PROJECT_NAME=${C1_DOCKER_NAMESPACE}-possim" >> .env
echo "POSSIM_DOCKER_NETWORK=${C1_DOCKER_NETWORK}" >> .env
echo "POSSIM_BINDMOUNT_PATH=$(host-path-outside-of-docker.sh .)" >> .env
echo "POSSIM_HOSTNAME=${C1_DOCKER_NAMESPACE}-possim.devel" >> .env
```
* otherwise for linux host networking configuration run:
```bash
echo "COMPOSE_FILE=compose-host.yaml" > .env
echo "POSSIM_HOSTNAME=127.0.0.1" >> .env
```

Once you've set up your env you can get the privatenet up and running using:

```bash
docker-compose build possim
docker-compose run possim
docker-compose run --use-aliases possim
```

Run with overridden config:
Once running, you can connect using:

```bash
docker-compose run possim CONFIG=/opt/privatenet/pbs_config.yaml
source .env
curl -v http://$POSSIM_HOSTNAME:15050
```

To run with overridden config:

```bash
docker-compose run --use-aliases possim CONFIG=/opt/privatenet/pbs_config.yaml
```

See [configuration.yaml](./eth_possim/resources/configuration.yaml) for the default values.

How to test
-----------
```bash
docker-compose run possim test
```

How it works inside the container
----------------------------------
Expand All @@ -67,11 +97,4 @@ the components.

Then, `tilt up` command starts the blockchain.

And finally, `make` file binds generation and tilt start together.


How to test
-----------
```bash
docker-compose run possim test
```
And finally, `make` file binds generation and tilt start together.
34 changes: 34 additions & 0 deletions compose-devpod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# this compose file is written and invoked using the guidelines defined here:
# https://github.com/ChorusOne/hopper-build-container/blob/main/docker.md
# so that the project can be run in all docker-outside-of-docker environments
# (devpod, github ci, cloud build, etc)
networks:
default:
external: true
name: ${POSSIM_DOCKER_NETWORK:-${C1_DOCKER_NETWORK}}

services:
possim:
extends:
file: compose.yaml
service: possim
networks:
default:
aliases:
# use an alias with a .devel tld to avoid DNS resolution
# normally we'd just use the `container-name.` hostname, but the container_name
# is ignored when running using docker compose run command
- ${POSSIM_HOSTNAME}
expose:
# execution wsrpc
- "18546"
# execution rpc
- "18544"
# beacon rest
- "15050"
# beacon teku
- "15051"
# beacon lighthouse
- "15151"
# mev relay
- "38000"
18 changes: 18 additions & 0 deletions compose-host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
possim:
extends:
file: compose.yaml
service: possim
ports:
# execution wsrpc
- "18546:18546"
# execution rpc
- "18544:18544"
# beacon rest
- "15050:15050"
# beacon teku
- "15051:15051"
# beacon lighthouse
- "15151:15151"
# mev relay
- "38000:38000"
12 changes: 12 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
possim:
build: .
volumes:
- ${POSSIM_BINDMOUNT_PATH:-.}/eth_possim:/opt/privatenet/eth_possim:ro
- ${POSSIM_BINDMOUNT_PATH:-.}/Tiltfile:/opt/privatenet/Tiltfile:ro
- ${POSSIM_BINDMOUNT_PATH:-.}/Makefile:/opt/privatenet/Makefile:ro
- ${POSSIM_BINDMOUNT_PATH:-.}/.data:/opt/privatenet/.data:rw
- ${POSSIM_BINDMOUNT_PATH:-.}/tests:/opt/privatenet/tests
- ${POSSIM_BINDMOUNT_PATH:-.}/requirements-dev.txt:/opt/privatenet/requirements-dev.txt
- ${POSSIM_BINDMOUNT_PATH:-.}/pbs_config.yaml:/opt/privatenet/pbs_config.yaml
command: freshrun
28 changes: 0 additions & 28 deletions docker-compose.yaml

This file was deleted.

0 comments on commit f09ffa9

Please sign in to comment.