diff --git a/jobs/mantis-qa-load.nix b/jobs/mantis-qa-load.nix index bb33c9e..5e570e2 100644 --- a/jobs/mantis-qa-load.nix +++ b/jobs/mantis-qa-load.nix @@ -414,9 +414,6 @@ let in [ { data = '' - include "${mantis-faucet}/conf/testnet-internal.conf" - mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json" - faucet { # Base directory where all the data used by the faucet is stored datadir = "/local/mantis-faucet" @@ -512,18 +509,6 @@ let } } } - - mantis.blockchains.testnet-internal.bootstrap-nodes = [ - {{ range service "${namespace}-mantis-miner" -}} - "enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}} - {{- .Data.data.value -}} - {{- end -}}@{{ .Address }}:{{ .Port }}", - {{ end -}} - ] - - mantis.client-id = "${faucetName}" - mantis.metrics.enabled = true - mantis.metrics.port = {{ env "NOMAD_PORT_metrics" }} ''; changeMode = "noop"; destination = "local/faucet.conf"; diff --git a/jobs/mantis.nix b/jobs/mantis.nix index 5bdb2c5..fb1095f 100644 --- a/jobs/mantis.nix +++ b/jobs/mantis.nix @@ -18,6 +18,7 @@ let let secret = key: ''{{ with secret "${key}" }}{{.Data.data.value}}{{end}}''; in [ { + # FIXME: pow-target-time was only temporarily changed here, should be included on the default testnet-internal on next version of mantis data = '' include "${mantis}/conf/testnet-internal.conf" @@ -43,6 +44,8 @@ let mantis.network.rpc.http.port = {{ env "NOMAD_PORT_rpc" }} mantis.network.server-address.port = {{ env "NOMAD_PORT_server" }} mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json" + + mantis.blockchains.testnet-internal.pow-target-time = 30 seconds ''; destination = "local/mantis.conf"; changeMode = "noop"; @@ -273,6 +276,7 @@ let templates = [ { + # FIXME: pow-target-time was only temporarily changed here, should be included on the default testnet-internal on next version of mantis data = '' include "${mantis}/conf/testnet-internal.conf" @@ -297,6 +301,8 @@ let mantis.network.rpc.http.port = {{ env "NOMAD_PORT_rpc" }} mantis.network.server-address.port = {{ env "NOMAD_PORT_server" }} mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json" + + mantis.blockchains.testnet-internal.pow-target-time = 30 seconds ''; changeMode = "restart"; destination = "local/mantis.conf"; @@ -503,16 +509,13 @@ let in [ { data = '' - include "${mantis-faucet}/conf/testnet-internal.conf" - mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json" - faucet { # Base directory where all the data used by the faucet is stored datadir = "/local/mantis-faucet" # Wallet address used to send transactions from wallet-address = - {{- with secret "kv/nomad-cluster/${namespace}/${namespace}-mantis-1/coinbase" -}} + {{- with secret "kv/nomad-cluster/${namespace}/mantis-1/coinbase" -}} "{{.Data.data.value}}" {{- end }} @@ -601,18 +604,6 @@ let } } } - - mantis.blockchains.testnet-internal.bootstrap-nodes = [ - {{ range service "${namespace}-mantis-miner" -}} - "enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}} - {{- .Data.data.value -}} - {{- end -}}@{{ .Address }}:{{ .Port }}", - {{ end -}} - ] - - mantis.client-id = "${faucetName}" - mantis.metrics.enabled = true - mantis.metrics.port = {{ env "NOMAD_PORT_metrics" }} ''; changeMode = "noop"; destination = "local/faucet.conf"; @@ -620,7 +611,7 @@ let genesisJson { data = '' - {{- with secret "kv/data/nomad-cluster/${namespace}/${namespace}-mantis-1/account" -}} + {{- with secret "kv/data/nomad-cluster/${namespace}/mantis-1/account" -}} {{.Data.data | toJSON }} {{- end -}} ''; @@ -628,7 +619,7 @@ let } { data = '' - COINBASE={{- with secret "kv/data/nomad-cluster/${namespace}/${namespace}-mantis-1/coinbase" -}}{{ .Data.data.value }}{{- end -}} + COINBASE={{- with secret "kv/data/nomad-cluster/${namespace}/mantis-1/coinbase" -}}{{ .Data.data.value }}{{- end -}} ''; destination = "secrets/env"; env = true; diff --git a/overlay.nix b/overlay.nix index fb63c22..2f8a8fe 100644 --- a/overlay.nix +++ b/overlay.nix @@ -10,14 +10,14 @@ in { # The branch was `chore/update-sbt-add-nix`, for future reference. mantis-source = builtins.fetchGit { url = "https://github.com/input-output-hk/mantis"; - rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe"; + rev = "dcb6d7b714bc1e23f75dd3e62365b316dab68ec3"; ref = "develop"; submodules = true; }; mantis-faucet-source = builtins.fetchGit { url = "https://github.com/input-output-hk/mantis"; - rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe"; + rev = "dcb6d7b714bc1e23f75dd3e62365b316dab68ec3"; ref = "develop"; submodules = true; }; @@ -29,6 +29,10 @@ in { mantis-faucet = import final.mantis-faucet-source { inherit system; }; + # Any: + # - run of this command with a parameter different than the testnet (currently 10) + # - change in the genesis file here + # Requires an update on the mantis repository and viceversa generate-mantis-keys = let mantisConfigJson = { mantis = { @@ -119,10 +123,10 @@ in { for count in $(seq "$desired"); do keyFile="secrets/mantis-$count.key" coinbaseFile="secrets/mantis-$count.coinbase" - secretKeyPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/secret-key" - hashKeyPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/enode-hash" - coinbasePath="kv/nomad-cluster/$prefix/testnet-mantis-$count/coinbase" - accountPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/account" + secretKeyPath="kv/nomad-cluster/$prefix/mantis-$count/secret-key" + hashKeyPath="kv/nomad-cluster/$prefix/mantis-$count/enode-hash" + coinbasePath="kv/nomad-cluster/$prefix/mantis-$count/coinbase" + accountPath="kv/nomad-cluster/$prefix/mantis-$count/account" genesisPath="kv/nomad-cluster/$prefix/genesis" hashKey="$(vault kv get -field value "$hashKeyPath" || true)"