Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit 3cd506b

Browse files
author
Nicolás Tallar
authored
New testnet re-deployment changes (#11)
* New testnet re-deployment changes * Removed unused configurations for faucet backend * Update path to instances vault for faucet as well
1 parent 89d9fc6 commit 3cd506b

File tree

3 files changed

+19
-39
lines changed

3 files changed

+19
-39
lines changed

jobs/mantis-qa-load.nix

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,6 @@ let
414414
in [
415415
{
416416
data = ''
417-
include "${mantis-faucet}/conf/testnet-internal.conf"
418-
mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
419-
420417
faucet {
421418
# Base directory where all the data used by the faucet is stored
422419
datadir = "/local/mantis-faucet"
@@ -512,18 +509,6 @@ let
512509
}
513510
}
514511
}
515-
516-
mantis.blockchains.testnet-internal.bootstrap-nodes = [
517-
{{ range service "${namespace}-mantis-miner" -}}
518-
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
519-
{{- .Data.data.value -}}
520-
{{- end -}}@{{ .Address }}:{{ .Port }}",
521-
{{ end -}}
522-
]
523-
524-
mantis.client-id = "${faucetName}"
525-
mantis.metrics.enabled = true
526-
mantis.metrics.port = {{ env "NOMAD_PORT_metrics" }}
527512
'';
528513
changeMode = "noop";
529514
destination = "local/faucet.conf";

jobs/mantis.nix

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ let
1818
let secret = key: ''{{ with secret "${key}" }}{{.Data.data.value}}{{end}}'';
1919
in [
2020
{
21+
# FIXME: pow-target-time was only temporarily changed here, should be included on the default testnet-internal on next version of mantis
2122
data = ''
2223
include "${mantis}/conf/testnet-internal.conf"
2324
@@ -43,6 +44,8 @@ let
4344
mantis.network.rpc.http.port = {{ env "NOMAD_PORT_rpc" }}
4445
mantis.network.server-address.port = {{ env "NOMAD_PORT_server" }}
4546
mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
47+
48+
mantis.blockchains.testnet-internal.pow-target-time = 30 seconds
4649
'';
4750
destination = "local/mantis.conf";
4851
changeMode = "noop";
@@ -273,6 +276,7 @@ let
273276

274277
templates = [
275278
{
279+
# FIXME: pow-target-time was only temporarily changed here, should be included on the default testnet-internal on next version of mantis
276280
data = ''
277281
include "${mantis}/conf/testnet-internal.conf"
278282
@@ -297,6 +301,8 @@ let
297301
mantis.network.rpc.http.port = {{ env "NOMAD_PORT_rpc" }}
298302
mantis.network.server-address.port = {{ env "NOMAD_PORT_server" }}
299303
mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
304+
305+
mantis.blockchains.testnet-internal.pow-target-time = 30 seconds
300306
'';
301307
changeMode = "restart";
302308
destination = "local/mantis.conf";
@@ -503,16 +509,13 @@ let
503509
in [
504510
{
505511
data = ''
506-
include "${mantis-faucet}/conf/testnet-internal.conf"
507-
mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
508-
509512
faucet {
510513
# Base directory where all the data used by the faucet is stored
511514
datadir = "/local/mantis-faucet"
512515
513516
# Wallet address used to send transactions from
514517
wallet-address =
515-
{{- with secret "kv/nomad-cluster/${namespace}/${namespace}-mantis-1/coinbase" -}}
518+
{{- with secret "kv/nomad-cluster/${namespace}/mantis-1/coinbase" -}}
516519
"{{.Data.data.value}}"
517520
{{- end }}
518521
@@ -601,34 +604,22 @@ let
601604
}
602605
}
603606
}
604-
605-
mantis.blockchains.testnet-internal.bootstrap-nodes = [
606-
{{ range service "${namespace}-mantis-miner" -}}
607-
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
608-
{{- .Data.data.value -}}
609-
{{- end -}}@{{ .Address }}:{{ .Port }}",
610-
{{ end -}}
611-
]
612-
613-
mantis.client-id = "${faucetName}"
614-
mantis.metrics.enabled = true
615-
mantis.metrics.port = {{ env "NOMAD_PORT_metrics" }}
616607
'';
617608
changeMode = "noop";
618609
destination = "local/faucet.conf";
619610
}
620611
genesisJson
621612
{
622613
data = ''
623-
{{- with secret "kv/data/nomad-cluster/${namespace}/${namespace}-mantis-1/account" -}}
614+
{{- with secret "kv/data/nomad-cluster/${namespace}/mantis-1/account" -}}
624615
{{.Data.data | toJSON }}
625616
{{- end -}}
626617
'';
627618
destination = "secrets/account";
628619
}
629620
{
630621
data = ''
631-
COINBASE={{- with secret "kv/data/nomad-cluster/${namespace}/${namespace}-mantis-1/coinbase" -}}{{ .Data.data.value }}{{- end -}}
622+
COINBASE={{- with secret "kv/data/nomad-cluster/${namespace}/mantis-1/coinbase" -}}{{ .Data.data.value }}{{- end -}}
632623
'';
633624
destination = "secrets/env";
634625
env = true;

overlay.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ in {
1010
# The branch was `chore/update-sbt-add-nix`, for future reference.
1111
mantis-source = builtins.fetchGit {
1212
url = "https://github.com/input-output-hk/mantis";
13-
rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe";
13+
rev = "dcb6d7b714bc1e23f75dd3e62365b316dab68ec3";
1414
ref = "develop";
1515
submodules = true;
1616
};
1717

1818
mantis-faucet-source = builtins.fetchGit {
1919
url = "https://github.com/input-output-hk/mantis";
20-
rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe";
20+
rev = "dcb6d7b714bc1e23f75dd3e62365b316dab68ec3";
2121
ref = "develop";
2222
submodules = true;
2323
};
@@ -29,6 +29,10 @@ in {
2929

3030
mantis-faucet = import final.mantis-faucet-source { inherit system; };
3131

32+
# Any:
33+
# - run of this command with a parameter different than the testnet (currently 10)
34+
# - change in the genesis file here
35+
# Requires an update on the mantis repository and viceversa
3236
generate-mantis-keys = let
3337
mantisConfigJson = {
3438
mantis = {
@@ -119,10 +123,10 @@ in {
119123
for count in $(seq "$desired"); do
120124
keyFile="secrets/mantis-$count.key"
121125
coinbaseFile="secrets/mantis-$count.coinbase"
122-
secretKeyPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/secret-key"
123-
hashKeyPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/enode-hash"
124-
coinbasePath="kv/nomad-cluster/$prefix/testnet-mantis-$count/coinbase"
125-
accountPath="kv/nomad-cluster/$prefix/testnet-mantis-$count/account"
126+
secretKeyPath="kv/nomad-cluster/$prefix/mantis-$count/secret-key"
127+
hashKeyPath="kv/nomad-cluster/$prefix/mantis-$count/enode-hash"
128+
coinbasePath="kv/nomad-cluster/$prefix/mantis-$count/coinbase"
129+
accountPath="kv/nomad-cluster/$prefix/mantis-$count/account"
126130
genesisPath="kv/nomad-cluster/$prefix/genesis"
127131
128132
hashKey="$(vault kv get -field value "$hashKeyPath" || true)"

0 commit comments

Comments
 (0)