Skip to content

Commit

Permalink
docs: make the containers named and add management commands
Browse files Browse the repository at this point in the history
  • Loading branch information
yaboiishere committed Feb 28, 2025
1 parent 4f42eeb commit 3dba51e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 6 deletions.
49 changes: 44 additions & 5 deletions docs/hyperchains_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ To properly configure your middleware for Aeternity Hyperchains, start by genera
Once you have the necessary configuration files, you can run the middleware using Docker:

```
docker run -it --rm \
-p 3013:3013 \
docker run -it --name ae_mdw_${NAME} \
-p 4000:4000 \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/data/aecore/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/data/aecore/${NAME}_contracts.json \
Expand All @@ -42,6 +45,7 @@ docker run -it --rm \
- **Make sure you have enough account balance on the pinning chain for all of the accounts**
- The command assumes the configuration files are in the `${NAME}/nodeConfig` directory in your current working directory, where `${NAME}` is the name of your Hyperchain.
- This command uses the [middleware image](https://hub.docker.com/r/aeternity/ae_mdw), which differs from the [node image](https://hub.docker.com/r/aeternity/aeternity).
- You can pass the `-d` flag to run the container in detached mode.

---

Expand All @@ -61,9 +65,12 @@ To ensure data persistence across container restarts:
```
docker run -it --rm \
-p 3013:3013 \
docker run -it --name ae_mdw_${NAME} \
-p 4000:4000 \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/${NAME}/nodeConfig/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_accounts.json:/home/aeternity/node/data/mnesia/${NAME}_accounts.json \
-v ${PWD}/${NAME}/nodeConfig/${NAME}_contracts.json:/home/aeternity/node/data/mnesia/${NAME}_contracts.json \
Expand All @@ -75,7 +82,39 @@ docker run -it --rm \
- `-v ${PWD}/data/mnesia:/home/aeternity/node/data/mnesia`: Persists the node database.
- `-v ${PWD}/data/mdw.db:/home/aeternity/node/data/mdw.db`: Persists the middleware database.
With this setup, the middleware will retain its state even after the container is stopped or restarted.
With this setup, the middleware will retain its state even after the container is stopped or restarted.
You can also pass the `-d` flag to run the container in detached mode.
## Step 4: Accessing the Middleware
Once the container is running, you can access the middleware at `http://localhost:4000` and the node at `http://localhost:3013`.
## Managing the Container
To check the logs, run the following command:
```
docker logs ae_mdw_${NAME}
```
To check the status of the container, run the following command:
```
docker ps -a
```
To stop the container, run the following command:
```
docker stop ae_mdw_${NAME}
```
To restart the container, run the following command:
```
docker start ae_mdw_${NAME}
```
---
Expand Down
34 changes: 33 additions & 1 deletion docs/middleware_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ If you want to use a database snapshot:
Start the container with the following command:
```
docker run -it --rm \
docker run -it --name ae_mdw \
-p 4000:4000 \
-p 4001:4001 \
-p 3113:3113 \
Expand All @@ -86,6 +86,38 @@ docker run -it --rm \
aeternity/ae_mdw:latest
```
This command starts the middleware in a docker container. The middleware will be available at `http://localhost:4000`. Note that you can pass the -d flag to run the container in detached mode.
### Step 4: Check the Status
To check if the middleware is running properly, visit the `/status` endpoint and ensure that `node_height` is higher than `0`.
### Step 5: Managing the Container
To check the logs, run the following command:
```
docker logs ae_mdw
```
To check the status of the container, run the following command:
```
docker ps -a
```
To stop the container, run the following command:
```
docker stop ae_mdw
```
To restart the container, run the following command:
```
docker start ae_mdw
```
## Customizing Configuration
Edit the configuration file `docker/aeternity.yaml` to specify network settings:
Expand Down

0 comments on commit 3dba51e

Please sign in to comment.