Edit ganache-cli launch parameters, enigma-contract docker image

I want to give feedback that would really help DApp developers out there.

It would be great to give out a way to launch ganache-cli with a pre-set seed.

As I have found out, you launch ganache-cli via launch_ganache.bash inside enigma-contract docker image. But your default parameters are:

ganache-cli -d -p 9545 -i 4447 -h 0.0.0.0

Is there some other way to edit these parameters without editing the docker image?

Thanks

EDIT:

After building a custom docker image from your enigma-contract image using as a dockerfile:

   FROM enigmampc/enigma_contract

   COPY launch_ganache.bash /root/launch_ganache.bash

Pointing to a modified launch_ganache.bash with the following parameter:

-m 'SEED HERE'

And overriding docker-compose.yml files at the root directory of a ‘discovery init’ created folder with the new image name, I get the following error after the successful deployment of the enigma ethereum contracts:

more content above here
contract_1  | Summary
contract_1  | =======
contract_1  | > Total deployments:   10
contract_1  | > Final cost:          0.32704728 ETH
contract_1  | 
contract_1  | root@contract:~# GET / HTTP/1.1
contract_1  | Host: contract:8081
contract_1  | User-Agent: curl/7.58.0
contract_1  | Accept: */*
contract_1  | 
contract_1  | GET / HTTP/1.1
contract_1  | Host: contract:8081
contract_1  | User-Agent: curl/7.58.0
contract_1  | Accept: */*
contract_1  | 
km_1        | [+] Home dir is /root
km_1        | [+] Home dir is /root
km_1        | [-] Create .enigma folder => AlreadyExists
km_1        | [-] Create .enigma/epoch folder => AlreadyExists
km_1        | [-] Create .enigma/state-keys folder => AlreadyExists
km_1        | The current directory is /root/enigma-core/enigma-principal/bin
km_1        | [-] Open token file /root/.enigma/enclave.token error! Will create one.
km_1        | Loading Principal config: "../app/tests/principal_node/config/principal_test_config.json"
km_1        | [+] Home dir is /root
km_1        | Back from Ocall: /root/.enigma
km_1        | Succeeded reading key from file
km_1        | [Mode:] run node NO DEPLOY.
km_1        | Connected to the Enigma contract: "aA6d9E1A1FF7Fb540E3b7B968637dd69a1a02dc3" with account: 0x1df62f291b2e969fb0849d99d9ce41e2f137006e
km_1        | [+] Home dir is /root
km_1        | No existing epoch state, starting with block 0
km_1        | Fetching the signing address for account: 0x1df62f291b2e969fb0849d99d9ce41e2f137006e
contract_1  | eth_call
km_1        | Using SGX_MODE: "SW"
km_1        | Fetching quote with SPID: "B0335FD3BC1CCA8F804EB98A6420592D"
km_1        | Simulation mode, using quote as report: AgAAAAsAAADvAO8A7+/v77AzX9O8HMqPgE65imQgWS14gD/Vn5d1i8F+adCaMZvQSCDzN2rmsvIDTTt6S0ineAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAADAAAAAAAAALWi+zqwTS0baXkBzX1MEM1dW7b/2VK60Uyy7NaRhTHZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACD1xnnferKFHD2uvYqTXdDA8iZ22kCD5xw7h38CMfOngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABM/pz5FwMOp0kYI5njESIMxsLPWwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqAIAAO7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7o3yo4kfkrJr5rzQVmgBAADu7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u5rURzatCe1ty2+7MAHoQNq
km_1        | Registering worker
contract_1  | eth_sendTransaction
km_1        | thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Web3Error { message: "Unable to call register: Error(Rpc(Error { code: ServerError(-32000), message: \"sender account not recognized\"

How do I proceed from here to use a custom mnemonic defined by me?

3 Likes

Hey @joao.l.martins, thanks for the post – what’s the motivation for custom mnemonics in this instance?

Hi @ainsley ! Thanks for answering. In fact that is a great question, I think my motivations were purely security related, as the deterministic mnemonic is known by everyone else, but it is not a great deal at all to use it for test purposes. But I guess I can edit other parameters, such as block time to put it slightly more realistic (e.g. 3 seconds?)

I take this opportunity also to ask another different question. I have looked into your tutorials regarding the millionaires problem secret contract implementation and dapp creation, but I think I am missing the piece on how can a smart contract call a secret contract function or vice-versa.

Imagine at the end of an auction I have an array of encrypted bids in my ethereum smart contract and I need to compute the auction winner. How can the secret contract send the result of the computation (winner and winning bid) to the smart contract? Is this made via enigma.js?

3 Likes