Architecture
Internet -> 158.180.40.102 (E2.1.Micro - nginx reverse proxy)
                       |  (VCN internal network)
                  10.0.0.x (Ampere A1 - norynthd chain node)

The micro VM handles all public traffic. Nginx forwards chain requests to Ampere via private VCN. No second public IP needed.

1. Script: Poll for Free Ampere Capacity

Ampere A1 instances are in high demand. This script polls Oracle's API every 60 seconds and provisions when a slot opens.

Install OCI CLI

curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh | bash
exec -l $SHELL
oci setup config

Get Required OCIDs

oci iam compartment list --compartment-id-in-tree TENANCY_OCID
oci network subnet list --compartment-id COMPARTMENT_OCID
oci compute image list --compartment-id COMPARTMENT_OCID --operating-system "Canonical Ubuntu" --operating-system-version "24.04" --shape "VM.Standard.A1.Flex"
oci iam availability-domain list --compartment-id COMPARTMENT_OCID

Run the Provisioning Script

chmod +x provision-ampere.sh
nohup ./provision-ampere.sh > ampere-provision.log 2>&1 &
tail -f ampere-provision.log

The script runs until an Ampere slot opens. May take hours or days depending on your region.

2. Reverse Proxy Setup on Micro VM

Once Ampere is running, configure nginx on the micro VM to proxy chain endpoints:

# Install nginx
sudo apt update && sudo apt install -y nginx certbot python3-certbot-nginx

# Create reverse proxy config for api.chain.norynth.com and rpc.chain.norynth.com
# Replace AMPEREPRIVATEIP with the Ampere instance's private IP

Nginx Config (chain.norynth.com)

server {
    listen 443 ssl http2;
    server_name api.chain.norynth.com;

    location / {
        proxy_pass http://AMPEREPRIVATEIP:1317;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_buffer_size 128k;
        proxy_buffers 4 256k;
        proxy_busy_buffers_size 256k;
    }
}

server {
    listen 443 ssl http2;
    server_name rpc.chain.norynth.com;

    client_max_body_size 50m;

    location / {
        proxy_pass http://AMPEREPRIVATEIP:26657;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Enable & Reload

sudo ln -s /etc/nginx/sites-available/chain.norynth.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo certbot --nginx -d api.chain.norynth.com -d rpc.chain.norynth.com
sudo systemctl reload nginx
3. Deploy Chain Node on Ampere
# SSH into Ampere
ssh ubuntu@AMPERE_PRIVATE_IP

# Install deps
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git wget tar gcc make jq

# Install Go 1.23 for ARM64
wget https://golang.org/dl/go1.23.6.linux-arm64.tar.gz
sudo tar -C /usr/local -xzf go1.23.6.linux-arm64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc

# Clone and build
git clone https://github.com/norynth/norynth-chain.git
cd norynth-chain
CGO_ENABLED=1 GOFLAGS="-buildvcs=false" go build --build.tags "sonic.noasm" -o $HOME/go/bin/norynthd ./cmd/norynthd
sudo cp $HOME/go/bin/norynthd /usr/local/bin/norynthd

# Init chain
norynthd init "norynth-ampere" --chain-id norynth
sed -i 's/"stake"/"ukrn"/g' ~/.norynth/config/genesis.json

# Configure
sed -i 's/minimum-gas-prices = ".*"/minimum-gas-prices = "0.025ukrn"/' ~/.norynth/config/app.toml
sed -i 's/enable = false/enable = true/' ~/.norynth/config/app.toml
sed -i 's|address = "tcp://localhost:1317"|address = "tcp://0.0.0.0:1317"|' ~/.norynth/config/app.toml
sed -i 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|' ~/.norynth/config/config.toml
4. Migration Steps
  1. Stop node on micro VM: sudo systemctl stop norynthd
  2. Copy chain data: rsync -avz ~/.norynth/data/ ubuntu@<ampere-ip>:~/.norynth/data/
  3. Start node on Ampere: sudo systemctl start norynthd
  4. Configure micro VM as reverse proxy (remove norynthd service)
  5. Update DNS: rpc.chain.norynth.com + api.chain.norynth.com → 158.180.40.102 (proxied)
DNS Records
RecordTypeValueProxy
api.chain.norynth.comA158.180.40.102Cloudflare
rpc.chain.norynth.comA158.180.40.102Cloudflare
grpc.chain.norynth.comA158.180.40.102DNS only