This allows for easy orchestration of the Midnight Node service.
- Install Docker Engine
- Install Docker Compose
- Install direnv
-
Clone repository
-
In
.envrcset CFG_PRESET to be the environment you wish to point to (E.g. testnet-02). -
run
direnv allowto load the environment variables -
Run
docker-compose up
The .envrc file will automatically create a random private key and save it as midnight-node.privatekey.
Choose which compose files to use:
compose.ymlfor Midnight Nodecompose-partner-chains.ymlfor Cardano + DB Syncproof-server.ymlfor Local Proof Server
One can use one or multiple compose files at once.
For example, to run the Midnight Node, you can do:
docker compose up -dor to run the Midnight Node and Cardano DB Sync, you can do:
docker compose -f ./compose-partner-chains.yml -f ./compose.yml up -dor to run the Midnight Node, Cardano DB Sync and a local Proof Server, you can do:
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml up -d🚀 That's it.
If you're using midnight-node smartcontract or midnight-node wizards that need ogmios, and you're running midnight-node in docker you must pass -O ws://host.docker.internal:1337 as an argument.
(Once PartnerChains 1.7+ is released OGMIOS_URL env var can be set so that it just works, but for now you have to pass it as an argument.)
To restart from fresh, run:
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml down -v
docker compose -f ./compose-partner-chains.yml -f ./compose.yml -f ./proof-server.yml kill
rm -R ./cardano-data
docker volume rm midnight-node-docker_midnight-data-testnetIf you get warnings like this then likely direnv is not setup or direnv allow has not been run:
WARN[0000] The "HOME_IPC" variable is not set. Defaulting to a blank string.
If you get IPC errors with Cardano node then delete the stale
socket file: rm ~/ipc/node.socket and restart.
If you encounter this message on the midnight node it's likely that the cardano-node is still syncing and it will go away once it's fully synced:
Unable to author block in slot. Failure creating inherent data provider:
'No latest block on chain.' not found.
Possible causes: main chain follower configuration error, db-sync not synced fully,
or data not set on the main chain.
Apache 2.0. PRs welcome, please see CONTRIBUTING.md for details.