Skip to content
Open
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
18 changes: 1 addition & 17 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: main
tags:
- v*
workflow_dispatch:
env:
IMAGE_NAME: relay-rewards-controller

Expand Down Expand Up @@ -45,20 +46,3 @@ jobs:

docker tag $IMAGE_NAME $IMAGE_ID:${GITHUB_SHA}
docker push $IMAGE_ID:${GITHUB_SHA}

- name: Deploy new version
env:
NOMAD_CACERT: admin-ui-ca.crt
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN_RELAY_REWARDS_CONTROLLER_DEPLOY }}
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }}
run: |
curl -L https://releases.hashicorp.com/nomad/1.10.2/nomad_1.10.2_linux_amd64.zip -o nomad.zip
unzip nomad.zip

if grep -q "stage" deploy-vars.json; then
sed -i "s/\[\[ .commit_sha \]\]/${GITHUB_SHA}/g" operations/relay-rewards-controller-stage.hcl
./nomad job run operations/relay-rewards-controller-stage.hcl
else
sed -i "s/\[\[ .commit_sha \]\]/${GITHUB_SHA}/g" operations/relay-rewards-controller-live.hcl
./nomad job run operations/relay-rewards-controller-live.hcl
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ In production these are injected by Nomad + Vault + Consul KV (see
| `OPERATOR_REGISTRY_PROCESS_ID` | AO process id for the operator registry |
| `HODLER_CONTRACT_ADDRESS` | HODLER Ethereum contract address |
| `JSON_RPC` | Ethereum JSON-RPC URL for reading the HODLER contract |
| `CU_URL` | AO Compute Unit URL used by `aoconnect` |
| `HB_URL` | Our HyperBEAM node, e.g. `https://hb.anyone.tech`. No default — the service refuses to start without it. |

> **A note on `USE_HODLER`:** this flag is a leftover from the migration to the
> HODLER staking model. HODLER is now the only supported path going forward, so
Expand Down
21 changes: 14 additions & 7 deletions operations/relay-rewards-controller-live.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variable "commit_sha" {
type = string
description = "The git commit SHA to use for the runtime image tag"
}

job "relay-rewards-controller-live" {
datacenters = ["ator-fin"]
type = "service"
Expand Down Expand Up @@ -28,26 +33,29 @@ job "relay-rewards-controller-live" {
driver = "docker"
config {
network_mode = "host"
image = "ghcr.io/anyone-protocol/relay-rewards-controller:[[ .commit_sha ]]"
image = "ghcr.io/anyone-protocol/relay-rewards-controller:${var.commit_sha}"
force_pull = true
}

env {
IS_LIVE="true"
VERSION="[[ .commit_sha ]]"
VERSION = var.commit_sha
REDIS_MODE="sentinel"
REDIS_MASTER_NAME="relay-rewards-controller-live-redis-master"
USE_HODLER = "true"
BUNDLER_GATEWAY="https://ar.anyone.tech"
# BUNDLER_NODE="https://ar.anyone.tech/bundler"
BUNDLER_NODE="https://upload.ardrive.io"
# Our own node once /~bundler@1.0/tx is edge-allowed + the signer is faff-allow-listed:
# BUNDLER_NODE="https://hb.anyone.tech"
BUNDLER_NODE="https://up.arweave.net"
GEODATADIR="/geo-ip-db/data"
GEOTMPDIR="/geo-ip-db/tmp"
ROUND_PERIOD_SECONDS="3600"
DO_CLEAN="true"
PORT="${NOMAD_PORT_http}"
NO_COLOR="1"
CU_URL="https://cu.anyone.tech"
# Our own HyperBEAM node — replaces CU_URL (D17). The edge whitelists
# `/~meta@1.0` and `^/{contract-pid}`, covering both the `~process@1.0/now/...`
# reads and the `~process@1.0/push` writes.
HB_URL="https://hb.anyone.tech"
IS_LOCAL_LEADER="true"
CPU_COUNT="1"
CONSUL_HOST="${NOMAD_IP_http}"
Expand All @@ -66,7 +74,6 @@ job "relay-rewards-controller-live" {
{{with secret "kv/live-protocol/relay-rewards-controller-live"}}
RELAY_REWARDS_CONTROLLER_KEY="{{.Data.data.RELAY_REWARDS_CONTROLLER_KEY}}"

BUNDLER_NETWORK="{{.Data.data.BUNDLER_NETWORK}}"
BUNDLER_CONTROLLER_KEY="{{.Data.data.RELAY_REWARDS_CONTROLLER_KEY}}"

JSON_RPC="{{.Data.data.JSON_RPC}}"
Expand Down
23 changes: 15 additions & 8 deletions operations/relay-rewards-controller-stage.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
variable "commit_sha" {
type = string
description = "The git commit SHA to use for the runtime image tag"
}

job "relay-rewards-controller-stage" {
datacenters = ["ator-fin"]
type = "service"
Expand Down Expand Up @@ -28,26 +33,29 @@ job "relay-rewards-controller-stage" {
driver = "docker"
config {
network_mode = "host"
image = "ghcr.io/anyone-protocol/relay-rewards-controller:[[ .commit_sha ]]"
image = "ghcr.io/anyone-protocol/relay-rewards-controller:${var.commit_sha}"
force_pull = true
}

env {
IS_LIVE="true"
VERSION="[[ .commit_sha ]]"
VERSION = var.commit_sha
REDIS_MODE="sentinel"
REDIS_MASTER_NAME="relay-rewards-controller-stage-redis-master"
USE_HODLER = "true"
BUNDLER_GATEWAY="https://ar.anyone.tech"
# BUNDLER_NODE="https://ar.anyone.tech/bundler"
BUNDLER_NODE="https://upload.ardrive.io"
# Our own node once /~bundler@1.0/tx is edge-allowed + the signer is faff-allow-listed:
# BUNDLER_NODE="https://hb.anyone.tech"
BUNDLER_NODE="https://up.arweave.net"
GEODATADIR="/geo-ip-db/data"
GEOTMPDIR="/geo-ip-db/tmp"
ROUND_PERIOD_SECONDS="900"
ROUND_PERIOD_SECONDS="3600"
DO_CLEAN="true"
PORT="${NOMAD_PORT_http}"
NO_COLOR="1"
CU_URL="https://cu-stage.anyone.tech"
# Our own HyperBEAM node — replaces CU_URL (D17). The edge whitelists
# `/~meta@1.0` and `^/{contract-pid}`, covering both the `~process@1.0/now/...`
# reads and the `~process@1.0/push` writes.
HB_URL="https://hb-stage.anyone.tech"
IS_LOCAL_LEADER="true"
CPU_COUNT="1"
CONSUL_HOST="${NOMAD_IP_http}"
Expand All @@ -66,7 +74,6 @@ job "relay-rewards-controller-stage" {
{{with secret "kv/stage-protocol/relay-rewards-controller-stage"}}
RELAY_REWARDS_CONTROLLER_KEY="{{.Data.data.RELAY_REWARDS_CONTROLLER_KEY}}"

BUNDLER_NETWORK="{{.Data.data.BUNDLER_NETWORK}}"
BUNDLER_CONTROLLER_KEY="{{.Data.data.RELAY_REWARDS_CONTROLLER_KEY}}"

JSON_RPC="{{.Data.data.JSON_RPC}}"
Expand Down
Loading