AeMdw Docker Setup Documentation
Overview
AeMdw is a middleware that acts as a caching and reporting layer for the æternity blockchain. It responds to queries more efficiently than the node and supports additional queries.
The middleware runs an Aeternity Node alongside it in the same Docker container and BEAM VM instance. This node can be configured using the aeternity.yaml file or by passing environment variables, just like configuring the node directly.
Quick Start with Docker Compose
Step 1: Clone the Repository
git clone https://github.com/aeternity/ae_mdw && cd ae_mdwStep 2: Database Snapshot (Optional)
Download a full backup from Aeternity Downloads.
Create a
datadirectory under the root repository directory and extract the backup using the following command:tar -xvzf path-to-backup.tar.gz -C dataThis will extract the
mnesiaandmdw.dbfolders to thedatadirectory.
Step 3: Start the Application
Run the following command to start the application on the mainnet:
docker compose upTo check if the application is running properly, visit the /status endpoint and ensure that node_height is higher than 600000.
Running with Docker (Without Compose)
Step 1: Create Directories and Set Permissions
Create the necessary directories for data storage and logs:
mkdir -p data/mnesia data/mdw.db logEnsure the directories have the correct permissions to allow the middleware to write to them:
chown -R 1000 data logStep 2: Use a Database Snapshot (Optional)
If you want to use a database snapshot:
Download a full backup from Aeternity Downloads.
Extract the backup to the
datadirectory:tar -xvzf path-to-backup.tar.gz -C dataThis will place the
mnesiaandmdw.dbfolders under thedatadirectory.
Step 3: Run the Container
Start the container with the following command:
docker run -it --name ae_mdw \
-p 4000:4000 \
-p 4001:4001 \
-p 3113:3113 \
-p 3013:3013 \
-p 3014:3014 \
-v ${PWD}/data/mnesia:/home/aeternity/node/data/mnesia \
-v ${PWD}/data/mdw.db:/home/aeternity/node/data/mdw.db \
-v ${PWD}/log:/home/aeternity/ae_mdw/log \
-v ${PWD}/docker/aeternity.yaml:/home/aeternity/.aeternity/aeternity/aeternity.yaml \
aeternity/ae_mdw:latestThis 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_mdwTo check the status of the container, run the following command:
docker ps -aTo stop the container, run the following command:
docker stop ae_mdwTo restart the container, run the following command:
docker start ae_mdwCustomizing Configuration
Edit the configuration file docker/aeternity.yaml to specify network settings:
ae_mainnetfor mainnetae_uatfor testnetA custom network name if running your own network or a hyperchain
You can also pass environment variables to configure the node, similar to standard Aeternity Node configuration.
Refer to Aeternity Configuration Docs for more details.
Additional Resources
Last updated
Was this helpful?