transmute-industries / sidetree.js

Sidetree Core Protocol and DID Method Drivers
https://identity.foundation/sidetree/spec/
Apache License 2.0
51 stars 26 forks source link

WARNING: The MNEMONIC variable is not set. Defaulting to a blank string. #217

Open devrajsinghrawat opened 3 years ago

devrajsinghrawat commented 3 years ago

When I am starting the docker-compose then the mnemonic does not picked from .env file as mentioned in comment in docker compose file.

  # This env variable comes from the .env file in the directory in which the
  # docker-compose command is run. Here it will be ./packages/sidetree-ledger-ethereum
Screenshot 2021-08-10 at 13 30 18

and due to that every time, when the container is being restarted a new set of keys are being assigned.

I am starting the container, just by right click on the docker-compose in vscode by selecting "Compose up" option.

devrajsinghrawat commented 3 years ago

I would like to add here that this only occuers when I start the container directly using docker-compose file .. But when these containers are started using PreTest that time it picks the env variables correctly.

i.e. if I run

npm run test:only @sidetree/element

then it ll internally call pretest "pretest": "docker-compose up -d mongo ganache ipfs",

and picks up correct mnemonics.

OR13 commented 3 years ago

hmm, seems like we probably need to separate the docker compose files so that running a local node is easier.

devrajsinghrawat commented 3 years ago

I ll let it open so that you can close it, when it done in future releases

BenjaminMoe commented 2 years ago

I think I've seen this when starting up a server. Want to see if it's happening, and why it's happening, because the seed should be defined in the configuration file.

BenjaminMoe commented 2 years ago

Taking some notes, it looks like this error can be reproduced by running the test for the cas-ipfs module.

> @sidetree/cas-ipfs@0.3.1-unstable.25 pretest ~/Github/sidetree.js/packages/cas-ipfs
> docker-compose up -d ipfs mongo

WARNING: The MNEMONIC variable is not set. Defaulting to a blank string.
sidetreejs_ipfs_1 is up-to-date
sidetreejs_mongo_1 is up-to-date

> @sidetree/cas-ipfs@0.3.1-unstable.25 test ~/Github/sidetree.js/packages/cas-ipfs
> tsdx test --passWithNoTests

So we need to track down where that warning is coming from, and if it's needed or not.

OR13 commented 2 years ago

This should be defaulted to an example.