Skip to content

ArcanePrivacy/Relayer

Repository files navigation

Relayer for Arcane Privacy

Deploy with docker-compose (recommended)

The following instructions are for Ubuntu 22.10, other operating systems may vary. These instructions include automated SSL configuration with LetsEncrypt.

PREREQUISITES

  1. Update core dependencies
  • sudo apt-get update
  1. Install docker-compose
  • curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
  1. Install Docker
  • curl -fsSL https://get.docker.com -o get-docker.sh && chmod +x get-docker.sh && ./get-docker.sh
  1. Install git
  • sudo apt-get install git-all
  1. Install nginx
  • sudo apt install nginx
  1. Stop apache2 instance (enabled by default)
  • sudo systemctl stop apache2

FIREWALL CONFIGURATION

* Warning: Failure to configure SSH as the first UFW rule, will lock you out of the instance

  1. Make sure UFW is installed by running apt update and apt install ufw
  2. Allow SSH in the first position in UFW by running sudo ufw allow OpenSSH*
  3. Allow HTTP, and HTTPS by running sudo ufw allow http, sudo ufw allow https
  4. Finalize changes and enable firewall sudo ufw enable

DEPLOYMENT

  1. Clone the repository and enter the directory
  • git clone https://github.com/ArcanePrivacy/Relayer.git && cd Relayer
  1. Clone the example environment file .env.example to configure for the preferred network - cp .env.example .env , then fill .env file.
  • Set PRIVATE_KEY for your relayer address. Accepted formats: base58, JSON byte array ([159,24,...]), comma-separated bytes (159,24,...), or 0x-prefixed hex (64-byte key).
  • Set RELAYER_FEE to what you would like to charge as your fee (remember 0.3% is deducted from your staked relayer balance)
  • Set RANGE_API_KEY (you can get key from here)
  • Set RPC_URL — for example Helius (https://devnet.helius-rpc.com/?api-key=... or https://mainnet.helius-rpc.com/?api-key=... matching NET_ID)
  • Set REDIS_PASSWORD
  • Set NET_ID=devnet if you're running relayer on devnet
  1. Clone the reverse-proxy environment file .env.proxy.example to configure your domain/TLS - cp .env.proxy.example .env.proxy, then fill .env.proxy.
  • Set VIRTUAL_HOST and LETSENCRYPT_HOST to your domain address
    • add a A record DNS record with the value assigned to your instance IP address to configure the domain
  1. Uncomment the env_file lines (remove # ) for the associated network services in docker-compose.yml
  2. Build and deploy the docker source by specifying the network through:
  • sudo apt install npm
  • npm run build
  • docker-compose up -d
  1. Visit your domain address and check the /status endpoint and ensure there is no errors in the status field

NGINX REVERSE PROXY

  1. Copy the pre-modified nginx policy as your default policy
  • cp arcane.conf /etc/nginx/sites-available/default
  1. Append the default nginx configuration to include streams
  • echo "stream { map_hash_bucket_size 128; map_hash_max_size 128; include /etc/nginx/conf.d/streams/*.conf; }" >> /etc/nginx/nginx.conf
  1. Create the stream configuration
  • mkdir /etc/nginx/conf.d/streams && cp arcane-stream.conf /etc/nginx/conf.d/streams/arcane-stream.conf
  1. Start nginx to make sure the configuration is correct
  • sudo systemctl restart nginx
  1. Stop nginx
  • sudo systemctl stop nginx

Run locally

  1. npm i
  2. cp .env.example .env
  3. Modify .env as needed
  4. npm run start
  5. Go to http://127.0.0.1:8000
  6. In order to execute withdraw request, you can run following command
curl -X POST -H 'content-type:application/json' --data '<input data>' http://127.0.0.1:8000/relay

Relayer should return a transaction hash.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors