Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 67 additions & 16 deletions jobs/mantis-qa-load.nix
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ let
in [
{
data = ''
include "${mantis}/conf/testnet-internal.conf"
include "${mantis-faucet}/conf/testnet-internal.conf"
mantis.blockchains.testnet-internal.custom-genesis-file = "{{ env "NOMAD_TASK_DIR" }}/genesis.json"

faucet {
Expand Down Expand Up @@ -442,37 +442,88 @@ let
# Transaction value
tx-value = 1000000000000000000

# Faucet listen interface
listen-interface = "0.0.0.0"

# Faucet listen port
listen-port = {{ env "NOMAD_PORT_rpc" }}

# Faucet cors config
cors-allowed-origins = "*"

# Address of Ethereum node used to send the transaction
rpc-address = {{- range service "${namespace}-mantis-1.${namespace}-mantis-miner-rpc" -}}
"http://{{ .Address }}:{{ .Port }}"
{{- end }}

# How often can a single IP address send a request
min-request-interval = 1.minute

# How many ip addr -> timestamp entries to store
latest-timestamp-cache-size = 1024
min-request-interval = 0.minute
}

logging {
# Flag used to switch logs to the JSON format
json-output = false
json-output = true

# Logs directory
logs-dir = /local/mantis-faucet/logs
#logs-dir = /local/mantis-faucet/logs

# Logs filename
logs-file = "logs"
}

mantis {
network {
rpc {
http {
# JSON-RPC mode
# Available modes are: http, https
# Choosing https requires creating a certificate and setting up 'certificate-keystore-path' and
# 'certificate-password-file'
# See: https://github.com/input-output-hk/mantis/wiki/Creating-self-signed-certificate-for-using-JSON-RPC-with-HTTPS
mode = "http"

# Whether to enable JSON-RPC HTTP(S) endpoint
enabled = true

# Listening address of JSON-RPC HTTP(S) endpoint
interface = "0.0.0.0"

# Listening port of JSON-RPC HTTP(S) endpoint
port = {{ env "NOMAD_PORT_rpc" }}

# Path to the keystore storing the certificates (used only for https)
# null value indicates HTTPS is not being used
certificate-keystore-path = null

# Type of certificate keystore being used
# null value indicates HTTPS is not being used
certificate-keystore-type = null

# File with the password used for accessing the certificate keystore (used only for https)
# null value indicates HTTPS is not being used
certificate-password-file = null

# Domains allowed to query RPC endpoint. Use "*" to enable requests from
# any domain.
cors-allowed-origins = "*"
}

ipc {
# Whether to enable JSON-RPC over IPC
enabled = false

# Path to IPC socket file
socket-file = "/local/mantis-faucet/faucet.ipc"
}

# Enabled JSON-RPC APIs over the JSON-RPC endpoint
apis = "faucet"
}
}
}

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";
Expand Down
66 changes: 52 additions & 14 deletions jobs/mantis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -531,26 +531,13 @@ let
# Transaction value
tx-value = 1000000000000000000

# Faucet listen interface
listen-interface = "0.0.0.0"

# Faucet listen port
listen-port = {{ env "NOMAD_PORT_rpc" }}

# Faucet cors config
cors-allowed-origins = "*"

# Address of Ethereum node used to send the transaction
rpc-address =
{{- range service "mantis-1.${namespace}-mantis-miner-rpc" -}}
rpc-address = {{- range service "${namespace}-mantis-1.${namespace}-mantis-miner-rpc" -}}
"http://{{ .Address }}:{{ .Port }}"
{{- end }}

# How often can a single IP address send a request
min-request-interval = 1.minute

# How many ip addr -> timestamp entries to store
latest-timestamp-cache-size = 1024
}

logging {
Expand All @@ -564,6 +551,57 @@ let
logs-file = "logs"
}

mantis {
network {
rpc {
http {
# JSON-RPC mode
# Available modes are: http, https
# Choosing https requires creating a certificate and setting up 'certificate-keystore-path' and
# 'certificate-password-file'
# See: https://github.com/input-output-hk/mantis/wiki/Creating-self-signed-certificate-for-using-JSON-RPC-with-HTTPS
mode = "http"

# Whether to enable JSON-RPC HTTP(S) endpoint
enabled = true

# Listening address of JSON-RPC HTTP(S) endpoint
interface = "0.0.0.0"

# Listening port of JSON-RPC HTTP(S) endpoint
port = {{ env "NOMAD_PORT_rpc" }}

# Path to the keystore storing the certificates (used only for https)
# null value indicates HTTPS is not being used
certificate-keystore-path = null

# Type of certificate keystore being used
# null value indicates HTTPS is not being used
certificate-keystore-type = null

# File with the password used for accessing the certificate keystore (used only for https)
# null value indicates HTTPS is not being used
certificate-password-file = null

# Domains allowed to query RPC endpoint. Use "*" to enable requests from
# any domain.
cors-allowed-origins = "*"
}

ipc {
# Whether to enable JSON-RPC over IPC
enabled = false

# Path to IPC socket file
socket-file = "/local/mantis-faucet/faucet.ipc"
}

# Enabled JSON-RPC APIs over the JSON-RPC endpoint
apis = "faucet"
}
}
}

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) -}}
Expand Down
4 changes: 2 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
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 = "1adf11435e35e7368bb9b6268d8ccab9fd104349";
rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe";
ref = "develop";
submodules = true;
};

mantis-faucet-source = builtins.fetchGit {
url = "https://github.com/input-output-hk/mantis";
rev = "62c00140d34e134dcb71b1812e5f76d8401ee747";
rev = "df2916bccd53b2ccc5c3758e5aa7f272c6fbb4fe";
ref = "develop";
submodules = true;
};
Expand Down