Last active
June 6, 2023 16:26
-
-
Save andy108369/ef23ff0fe5caf2e12b1b41a99e812294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/andy108369/ef23ff0fe5caf2e12b1b41a99e812294 | |
# Last updated on June 06 2023 16:25 | |
# | |
# PoC SDL for running nym-mixnode on Akash Network | |
# https://twitter.com/andy83482/status/1665093815290437635 | |
# | |
# Provider requires to support the IPv6, steps outlined here https://github.com/akash-network/support/issues/100 | |
# | |
# apt update | |
# apt -y install wget curl jq iproute2 iputils-ping net-tools netcat-openbsd | |
# wget -c "https://github.com/nymtech/nym/releases/download/nym-binaries-v1.1.19/nym-mixnode" | |
# chmod +x nym-mixnode | |
# install nym-mixnode /usr/local/bin/ | |
# now restore the PEM files from the backup so that "nym-mixnode init" won't create the new ones: ~/.nym/mixnodes/<node-id>/data/*.pem | |
# IMPORTANT: make sure "--host ::" so that mixnode accepts both IPv4 and IPv6! Host & K8s cluster have to support IPv6 and K8s has to support IPv6DualStack | |
# mixnode1.akash.pro should point to A, AAAA DNS records | |
# nym-mixnode init --id seventh-horizon --wallet-address n1n8damnwuweg7jdq28xfpyn6mtwkpx4c8v7cx0j --host :: --announce-host mixnode1.akash.pro | |
# | |
# nym-mixnode describe --id seventh-horizon | |
# ulimit -n 65535; exec nym-mixnode run --id seventh-horizon > logs 2>&1 & | |
# | |
# Verify: | |
# # cat /proc/$(pidof -s nym-mixnode)/limits | grep 'open files' | |
# Max open files 65535 65535 files | |
# | |
# IMPORTANT: backup the PEM files!!! ~/.nym/mixnodes/<node-id>/data/*.pem | |
# | |
# Make sure to update the mapped ports [Mix Port, Verloc Port, HTTP Port], Host and Version (if not using IP Leasing) on the Nyx chain in your Node Settings (via Nym Wallet -> Bonding -> your mix node -> Node Settings) | |
# | |
# Verify: | |
# curl -sk <mixnode-IP>:<HTTP Port>/stats | jq | |
# curl -sk <mixnode-IP>:<HTTP Port>/verloc | jq | head -5 | |
# curl -sk <mixnode-IP>:<HTTP Port>/hardware | jq | |
# curl -sk <mixnode-IP>:<HTTP Port>/description | jq | |
--- | |
version: "2.0" | |
services: | |
mixnode: | |
image: ubuntu:20.04 | |
env: | |
- 'SSH_PUBKEY=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINNFxqDbY0BlEjJ2y9B2IKUUoimOq6oAC7WcsQT8qmII andy@akash' | |
command: | |
- "sh" | |
- "-c" | |
args: | |
- 'apt-get update; | |
apt-get install -y --no-install-recommends -- ssh; | |
mkdir -p -m0755 /run/sshd; | |
mkdir -m700 ~/.ssh; | |
echo "$SSH_PUBKEY" | tee ~/.ssh/authorized_keys; | |
chmod 0600 ~/.ssh/authorized_keys; | |
ls -lad ~ ~/.ssh ~/.ssh/authorized_keys; | |
md5sum ~/.ssh/authorized_keys; | |
exec /usr/sbin/sshd -D' | |
params: | |
storage: | |
vol1: | |
mount: /root | |
expose: | |
# Mix Port | |
- port: 1789 | |
as: 1789 | |
to: | |
- global: true | |
# Verloc Port | |
- port: 1790 | |
as: 1790 | |
to: | |
- global: true | |
# HTTP Port | |
- port: 8000 | |
as: 8000 | |
to: | |
- global: true | |
# SSH | |
- port: 22 | |
as: 22 | |
to: | |
- global: true | |
profiles: | |
compute: | |
mixnode: | |
resources: | |
cpu: | |
units: 1 | |
memory: | |
size: 512Mi | |
storage: | |
- size: 512Mi | |
- name: vol1 | |
size: 512Mi | |
attributes: | |
persistent: true | |
class: beta3 | |
placement: | |
akash: | |
attributes: | |
host: akash | |
#signedBy: | |
# anyOf: | |
# - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" | |
pricing: | |
mixnode: | |
denom: uakt | |
amount: 10000000 | |
deployment: | |
mixnode: | |
akash: | |
profile: mixnode | |
count: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment