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

Commit

Permalink
Merge pull request #12 from input-output-hk/adapted-mantis-config-ref…
Browse files Browse the repository at this point in the history
…actor

Adapted mantis usage due to config refactor
  • Loading branch information
Ninjatrappeur committed Nov 19, 2020
2 parents 331e9a1 + 53164bc commit cc0fb08
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions jobs/mantis-qa-load.nix
Expand Up @@ -18,12 +18,12 @@ let
in [
{
data = ''
include "${mantis}/conf/testnet-internal.conf"
include "${mantis}/conf/testnet-internal-nomad.conf"
logging.json-output = true
logging.logs-file = "logs"
mantis.blockchains.testnet-internal.bootstrap-nodes = [
mantis.blockchains.testnet-internal-nomad.bootstrap-nodes = [
{{ range service "${namespace}-mantis-miner" -}}
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
{{- .Data.data.value -}}
Expand All @@ -41,7 +41,7 @@ let
mantis.network.rpc.http.interface = "0.0.0.0"
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-nomad.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
'';
destination = "local/mantis.conf";
changeMode = "noop";
Expand Down Expand Up @@ -273,12 +273,12 @@ let
templates = [
{
data = ''
include "${mantis}/conf/testnet-internal.conf"
include "${mantis}/conf/testnet-internal-nomad.conf"
logging.json-output = true
logging.logs-file = "logs"
mantis.blockchains.testnet-internal.bootstrap-nodes = [
mantis.blockchains.testnet-internal-nomad.bootstrap-nodes = [
{{ range service "${namespace}-mantis-miner" -}}
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
{{- .Data.data.value -}}
Expand All @@ -295,7 +295,7 @@ let
mantis.network.rpc.http.interface = "0.0.0.0"
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-nomad.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
'';
changeMode = "restart";
destination = "local/mantis.conf";
Expand Down
20 changes: 10 additions & 10 deletions jobs/mantis.nix
Expand Up @@ -18,14 +18,13 @@ 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"
include "${mantis}/conf/testnet-internal-nomad.conf"
logging.json-output = true
logging.logs-file = "logs"
mantis.blockchains.testnet-internal.bootstrap-nodes = [
mantis.blockchains.testnet-internal-nomad.bootstrap-nodes = [
{{ range service "${namespace}-mantis-miner" -}}
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
{{- .Data.data.value -}}
Expand All @@ -43,9 +42,10 @@ let
mantis.network.rpc.http.interface = "0.0.0.0"
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-nomad.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
mantis.blockchains.testnet-internal.pow-target-time = 30 seconds
mantis.blockchains.testnet-internal-nomad.ecip1098-block-number = 0
mantis.blockchains.testnet-internal-nomad.ecip1097-block-number = 0
'';
destination = "local/mantis.conf";
changeMode = "noop";
Expand Down Expand Up @@ -279,14 +279,13 @@ 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"
include "${mantis}/conf/testnet-internal-nomad.conf"
logging.json-output = true
logging.logs-file = "logs"
mantis.blockchains.testnet-internal.bootstrap-nodes = [
mantis.blockchains.testnet-internal-nomad.bootstrap-nodes = [
{{ range service "${namespace}-mantis-miner" -}}
"enode:// {{- with secret (printf "kv/data/nomad-cluster/${namespace}/%s/enode-hash" .ServiceMeta.Name) -}}
{{- .Data.data.value -}}
Expand All @@ -303,9 +302,10 @@ let
mantis.network.rpc.http.interface = "0.0.0.0"
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-nomad.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"
mantis.blockchains.testnet-internal.pow-target-time = 30 seconds
mantis.blockchains.testnet-internal-nomad.ecip1098-block-number = 0
mantis.blockchains.testnet-internal-nomad.ecip1097-block-number = 0
'';
changeMode = "restart";
destination = "local/mantis.conf";
Expand Down
12 changes: 6 additions & 6 deletions overlay.nix
Expand Up @@ -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 = "aaf3c852b4882369ac5a0f518344d9b02e63b8ef";
rev = "057f84ca72914c7175a0df1d8e40df9c83a9ed6f";
ref = "develop";
submodules = true;
};

mantis-faucet-source = builtins.fetchGit {
url = "https://github.com/input-output-hk/mantis";
rev = "dcb6d7b714bc1e23f75dd3e62365b316dab68ec3";
rev = "057f84ca72914c7175a0df1d8e40df9c83a9ed6f";
ref = "develop";
submodules = true;
};
Expand All @@ -37,7 +37,7 @@ in {
mantisConfigJson = {
mantis = {
consensus.mining-enabled = false;
blockchains.network = "testnet-internal";
blockchains.network = "testnet-internal-nomad";

network.rpc = {
http = {
Expand All @@ -54,7 +54,7 @@ in {
mantisConfigHocon =
prev.runCommand "mantis.conf" { buildInputs = [ prev.jq ]; } ''
cat <<EOF > $out
include "${final.mantis}/conf/testnet-internal.conf"
include "${final.mantis}/conf/testnet-internal-nomad.conf"
EOF
jq . < ${
Expand Down Expand Up @@ -138,7 +138,7 @@ in {
len=0
until [ $len -eq 194 ]; do
echo "generating key..."
len="$( eckeygen -Dconfig.file=${final.mantis}/conf/mantis.conf | tee "$keyFile" | wc -c )"
len="$( eckeygen -Dconfig.file=${final.mantis}/conf/app.conf | tee "$keyFile" | wc -c )"
done
fi
Expand All @@ -153,7 +153,7 @@ in {
coinbase="$(generateCoinbase "$secretKey")"
vault kv put "$coinbasePath" "value=$coinbase"
cat $tmpdir/.mantis/testnet-internal/keystore/*$coinbase | vault kv put "$accountPath" -
cat $tmpdir/.mantis/testnet-internal-nomad/keystore/*$coinbase | vault kv put "$accountPath" -
else
echo "Downloading key for $keyFile from Vault"
secretKey="$(vault kv get -field value "$secretKeyPath")"
Expand Down
4 changes: 2 additions & 2 deletions templates/mantis.tmpl
@@ -1,9 +1,9 @@
include "./result/conf/testnet-internal.conf"
include "./result/conf/testnet-internal-nomad.conf"

mantis.consensus.mining-enabled = false
mantis.blockchains.testnet-internal.custom-genesis-file = "./genesis.json"

mantis.blockchains.testnet-internal.bootstrap-nodes = [
mantis.blockchains.testnet-internal-nomad.bootstrap-nodes = [
{{ range service "mantis-testnet-mantis-miner" -}}
"enode:// {{- with secret (printf "kv/data/nomad-cluster/testnet/%s/enode-hash" .ServiceMeta.Name) -}}
{{- .Data.data.value -}}
Expand Down

0 comments on commit cc0fb08

Please sign in to comment.