diff --git a/jobs/mantis-qa-fastsync.nix b/jobs/mantis-qa-fastsync.nix index 2834d65..ed5344f 100644 --- a/jobs/mantis-qa-fastsync.nix +++ b/jobs/mantis-qa-fastsync.nix @@ -1,4 +1,3 @@ - { mkNomadJob, lib, mantis, mantis-source, mantis-faucet, mantis-faucet-source , dockerImages }: let diff --git a/overlay.nix b/overlay.nix index b6c1b78..1d0b1a7 100644 --- a/overlay.nix +++ b/overlay.nix @@ -10,7 +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 = "5d754f6e666cb4a40c7e0db0a98cc1ec4deed712"; + rev = "76ceac0c56f9037416164430155a5387e42b5cf3"; + ref = "develop"; + submodules = true; + }; + + mantis-faucet-source = builtins.fetchGit { + url = "https://github.com/input-output-hk/mantis"; + rev = "76ceac0c56f9037416164430155a5387e42b5cf3"; ref = "develop"; submodules = true; }; @@ -20,11 +27,21 @@ in { mantis = import final.mantis-source { inherit system; }; + mantis-faucet = import final.mantis-faucet-source { inherit system; }; + + mantis-explorer-server = prev.callPackage ./pkgs/mantis-explorer-server.nix { + inherit (self.inputs.inclusive.lib) inclusive; + }; + + # 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 = { consensus.mining-enabled = false; - blockchains.network = "testnet-internal"; + blockchains.network = "testnet-internal-nomad"; network.rpc = { http = { @@ -41,7 +58,7 @@ in { mantisConfigHocon = prev.runCommand "mantis.conf" { buildInputs = [ prev.jq ]; } '' cat < $out - include "${final.mantis}/conf/testnet-internal.conf" + include "${final.mantis}/conf/testnet-internal-nomad.conf" EOF jq . < ${ @@ -110,10 +127,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)" @@ -125,7 +142,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 @@ -140,7 +157,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")" @@ -158,10 +175,10 @@ in { extraData = "0x00"; nonce = "0x0000000000000042"; gasLimit = "0x2fefd8"; - difficulty = "0x400"; + difficulty = "0xF4240"; ommersHash = "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"; - timestamp = "0x00"; + timestamp = "0x5FA34080"; coinbase = "0x0000000000000000000000000000000000000000"; mixHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; @@ -182,49 +199,53 @@ in { echo "$genesis" | vault kv put $genesisPath - ''; - generate-mantis-qa-genesis = final.writeShellScriptBin "generate-mantis-qa-genesis" '' - set -xeuo pipefail - - prefix="$1" - - read genesis < /dev/null; then + echo "Image already exists in registry" + else + docker load -i ${image} + docker push ${image.imageName}:${image.imageTag} + fi ''; load = builtins.trace key (final.writeShellScriptBin "load" ''