[Solved] Problem with setup of aeternal (middleware)

I have followed the official guide from this repo in order to setup own aeternal: GitHub - aeternity/aeternal: Æterrnal--the caching and reporting layer for the æternity blockchain

Then docker setup guide:

  • Install Docker and Docker Compose.
  • Update docker/aeternity.yaml as per your requirement.
  • Copy .env.example to .env and if required, edit the node and compiler version.
  • From the project root run, run docker-compose up

Everything is up and running (frontend and endpoints are showing, ) but, this error is showing all the time:

middleware_1 | 2019-12-17T18:09:03.816265691+00:00 ERROR aeternal::models - Error loading key block: NotFound
middleware_1 | 2019-12-17T18:09:03.816288431+00:00 ERROR aeternal::loader - Couldn’t load generation -1 from DB

Height is always 0 and it looks like some db error.

My OS is ubuntu server.

Do you have any idea?

(Off-topic but on Fedora and CentOs docker-compose is not working properly- it is a known problem about docker-compose, but some users can have troubles with that )

1 Like

Someone familiar with the docker?

@jsnewby or @shekhar-shubhendu may have a look?

1 Like

Hello @tima_t, as @jsnewby didn’t get around to look at this, I tried it out and was able to replicate and fix the issue you were having.

There are 2 issues:

  1. The .env.example contains very outdated versions for node and compiler that are not compatible with the current sync protocol
  2. The provided aeternity.yaml configuration specifies peers: [] preventing sync with the network

I created a pull request for the aeternal team that should fix those issues of the provided setup here: fixed provided docker-compose configuration by thepiwo · Pull Request #252 · aeternity/aeternal · GitHub

Let me know if there are any further questions.

1 Like

Thanks @philipp.chain I will try it and write back!

I have an update as well - it looks like the official branch is develop or tag v0.12.1 - maybe we should write it in the docs in order to keep everything up-to date for the other developers.

After the help of @jsnewby I succeed to run the docker using @jsnewby node.
You can see my docker-compose.yml:

version: ‘3.1’
services:
middleware:
build:
context: .
dockerfile: ./docker/Dockerfile
ports:
- “8080:80”
- “3020:3020”
entrypoint: ./docker/wait-for-it.sh node:3013 – ./aeternal -p -s -w
environment:
- NODE_URL=http://aeternal.io:4013
- AESOPHIA_URL=https://testnet.aeternal.io/middleware/contracts/calls/address/ct_2M9XPMwz1GggFRPatEd2aAPZbig32ZqRJBnhTT2yRVM4k6CQnb
- DATABASE_URL=postgres://middleware:middleware@db/middleware
- LOG_CONF=/logs/log.yaml
volumes:
- ${PWD}/docker/wait-for-it.sh:/app/docker/wait-for-it.sh
depends_on:
- db
- node
- compiler

frontend:
build:
context: ./frontend/
dockerfile: nginx.Dockerfile
args:
- NODE_URL=http://165.22.199.163:8080
- NODE_WS=http://165.22.199.163:3020
- NETWORK_NAME=‘TEST NET’
ports:
- “8081:80”
depends_on:
- middleware

node:
image: aeternity/aeternity:{NODE_TAG} hostname: node expose: [3013, 3113, 3014] environment: AETERNITY_CONFIG: /home/aeterinty/aeternity.yaml volumes: - {PWD}/docker/aeternity.yaml:/home/aeterinty/aeternity.yaml
- node_db:/home/aeterinty/node/data/mnesia

db:
image: postgres:11
restart: unless-stopped
environment:
- POSTGRES_USER=middleware
- POSTGRES_PASSWORD=middleware
- POSTGRES_DB=middleware
volumes:
- ae-mdw-postgres-volume:/var/lib/postgresql/data
expose: [5432]

compiler:
image: aeternity/aesophia_http:${COMPILER_TAG}
hostname: compiler
expose: [3080]

volumes:
ae-mdw-postgres-volume:
external: false
node_db:

Could be useful tho.

hello, we just got an updated docker example on the develop branch that hopefully clarifies things:

1 Like

I have tried it - works great.

I have one more question when I go in examples and run the docker-compose up it starts on the mainnet.

I guess that this is config in aeternity folder.

When I uncomment this line:

#fork_management:
#network_id: “ae_uat”

It should start syncing the test net right?

I tried but it does not work on the testnet.

it works fine with these lines commented and syncs the mainnet.

yes, if you set in the node/config.yaml file the lines

fork_management:
  network_id: "ae_uat"

the node will sync to testnet, but before doing so you need to remove the existing database, otherwise the node will not be able to sync since it is already partially synced with mainnet.

To do so you can, from the examples folder , run the command:

docker-compose down -v

that will delete everything in the example context.

Can you help me @tima_t

whats your issue here @hasan.chain?

Hello @philipp.chain

I installed docker-compose with pip. but I can’t get results with docker --version command.

Pip version :


I think now okey

1 Like

Generally I don’t think it is possible to install docker via pip, just refer to the official docker documentation.

1 Like

Yes you are right. again gave docker error when connected to node