Skip to main content

Installation & running

Docker compose (bare metal)

TL;DR

  1. git clone git@github.com:warp-contracts/warp-dre-node.git
  2. cp .env.defaults .env
  3. Edit .env file and set all required variables.
  4. docker compose up -d

Pre requirements

  1. You need to have docker installed on your local machine with docker compose. You can use docker-desktop.
  2. You need to have Arweave wallet. You can generate it using:
    1. arweave wallet. You can download the wallet using the download button in the wallet setting.
    2. Generate a new wallet using script: mkdir .secrets && yarn generate-arweave-wallet
    3. Script will generate arweave keys, you should past JSON string in NODE_JWK_KEY env variable in .env file

      ⚠️ Don't use wallets with real funds for test/development proposes.

  3. (Optional) NodeJS
  4. (Optional) Yarn

Running

To run docker compose you need to set up correct environment variables. You can do it using .env file:

cp .env.defaults .env

The file .env.example contains variables you can configure) or any other way supported by docker compose.

When you set up all required environment variables, just run:

docker compose up -d

Hosting specific setup

AWS (EC2)

Create EC2 instance

  1. Go to EC2 instace creation page (services -> compute -> ec2 -> launch instance)
  2. Choose Debian 11 AMI (you can choose any system you prefer)
  3. Instance type
    1. t3.micro for test proposes
    2. t3.medium or bigger for production
  4. Key pair (login)
    1. Create new key pair
    2. Download key pair and save it in safe place. You will need it to login to the instance after creation
  5. Network settings:
    1. Set flag: "Allow HTTP traffic from the internet"
  6. Storage: 60Gb, gp2
  7. Advanced details -> User data -> Paste content to install docker and D.R.E.:
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
echo BEGIN
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
wget \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo useradd -g docker -s /bin/bash -m dre

cd /home/dre
mkdir warp-dre-node
export DRE_RELEASE=$(curl -sL https://api.github.com/repos/warp-contracts/warp-dre-node/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "export DRE_IMAGE_TAG=$DRE_RELEASE" >> .bashrc
wget -O- https://github.com/warp-contracts/warp-dre-node/releases/download/$DRE_RELEASE/docker-compose.yml > warp-dre-node/docker-compose.yml
echo $'env=prod\nNODE_JWK_KEY=' > warp-dre-node/.env
sudo chown -R dre warp-dre-node
echo END

Configure the instance and run D.R.E. node

  1. Wait until instance is created and initialized. You can check status in EC2 console in the "Status Checks" section
  2. Login to the instance using SSH
    1. Open terminal
    2. Run chmod 400 <path_to_key_pair_file> to set correct permissions to the key pair file
    3. Run ssh -i <path_to_key_pair_file> admin@<instance_public_ip>
  3. Login as dre user: sudo su dre
  4. Check if you have access to docker: docker ps. Check /var/log/user-data.log in case it's not accessible
  5. Go to warp-dre-node directory: cd ~/warp-dre-node
  6. Set all required variables: nano .env
    1. ENV - change to prod, if you run D.R.E. node in production mode
    2. NODE_JWK_KEY - paste your arweave wallet JSON string. Creation of the wallet is described in the pre requirements section
  7. Run docker compose up -d to start D.R.E. node
  8. Check if containers started successfully: docker ps
  9. Check if D.R.E. node is running: go to http://<instance ip>/status

GCP

  1. Go to VM instance create page (compute engine -> VM instances)
  2. Choose Debian 11 AMI (you can choose any system you prefer)
  3. Instance type
    1. e2-small for test proposes
    2. e2-standard-2 or bigger for production
  4. Firewall:
    1. Set flag: "Allow HTTP traffic"
  5. Storage: 60Gb, gp2
  6. Advanced options
    1. Disk - add additional disk - 60Gb
    2. Managenent -> Automation -> Paste content to install docker and D.R.E.:
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
echo BEGIN
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
wget \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo useradd -g docker -s /bin/bash -m dre

cd /home/dre
mkdir warp-dre-node
export DRE_RELEASE=$(curl -sL https://api.github.com/repos/warp-contracts/warp-dre-node/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "export DRE_IMAGE_TAG=$DRE_RELEASE" >> .bashrc
wget -O- https://github.com/warp-contracts/warp-dre-node/releases/download/$DRE_RELEASE/docker-compose.yml > warp-dre-node/docker-compose.yml
echo $'env=prod\nNODE_JWK_KEY=' > warp-dre-node/.env
sudo chown -R dre warp-dre-node
echo END

Configure the instance and run D.R.E. node

  1. Wait until instance will be in the running state
  2. Login to the instance using SSH (you can do it in the GCP console)
  3. Login as dre user: sudo su dre
  4. Check if you have access to docker: docker ps. Check /var/log/user-data.log in case it's not accessible
  5. Go to warp-dre-node directory: cd ~/warp-dre-node
  6. Set all required variables: nano .env
    1. ENV - change to prod, if you run D.R.E. node in production mode
    2. NODE_JWK_KEY - paste your arweave wallet JSON string. Creation of the wallet is described in the pre requirements section
  7. Run docker compose up -d to start D.R.E. node
  8. Check if containers started successfully: docker ps
  9. Check if D.R.E. node is running: go to http://<instance ip>/status

DigitalOcean

Create droplet

  1. Go to droplet creation page (create -> droplets)
  2. Choose Debian 11 as OS
  3. Instance type
    1. Basic -> Regular -> 1Gb/1CPU instance - for test proposes
    2. General propose -> 8 GB/2 CPUs or bigger for production
  4. Enable backups (optional)
  5. Advanced options -> Add Initialization scripts -> Paste content to install docker and D.R.E.:
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
echo BEGIN
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
wget \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo useradd -g docker -s /bin/bash -m dre

cd /home/dre
mkdir warp-dre-node
export DRE_RELEASE=$(curl -sL https://api.github.com/repos/warp-contracts/warp-dre-node/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "export DRE_IMAGE_TAG=$DRE_RELEASE" >> .bashrc
wget -O- https://github.com/warp-contracts/warp-dre-node/releases/download/$DRE_RELEASE/docker-compose.yml > warp-dre-node/docker-compose.yml
echo $'env=prod\nNODE_JWK_KEY=' > warp-dre-node/.env
sudo chown -R dre warp-dre-node
echo END

Configure the instance and run D.R.E. node

  1. Login to the instance
  2. Login as dre user: sudo su dre
  3. Check if you have access to docker: docker ps. Check /var/log/user-data.log in case it's not accessible
  4. Go to warp-dre-node directory: cd ~/warp-dre-node
  5. Set all required variables: nano .env
    1. ENV - change to prod, if you run D.R.E. node in production mode
    2. NODE_JWK_KEY - paste your arweave wallet JSON string. Creation of the wallet is described in the pre requirements section
  6. Run docker compose up -d to start D.R.E. node
  7. Check if containers started successfully: docker ps
  8. Check if D.R.E. node is running: go to http://<instance ip>/status

Kubernetes (Helm)

Create secret:

kubectl create secret generic dre --from-env-file=.env

Install/update helm chart:

helm upgrade --install warp-dre-node ./helm

Environment variables

We configure D.R.E. using dotenv. It means we can modify the configuration using environment variables or .env file.

You can check out the default values in the .env.defaults file.

VariableRequiredDescription
APPSYNC_PUBLISH_STATEtruePublish state into the appsync. Requires non-empty APPSYNC_KEY.
APPSYNC_KEYtrue/falseAWS AppSync key.
NODE_JWK_KEYtrueJWK key of Arweave wallet. See more in Pre requirements section.
PUBSUB_TYPEtrueTransport for node pub/sub. The node gets information about new blocks with it. Can be streamr or redis.
STREAMR_STREAM_IDif PUBSUB_TYPE=streamrRequired when PUBSUB_TYPE is streamr. Streamr stream id
GW_PORTif PUBSUB_TYPE='redis'Port to Redis pubsub instance
GW_HOSTif PUBSUB_TYPE='redis'Host to Redis pubsub instance
GW_USERNAMEif PUBSUB_TYPE='redis'Username for authenticating to Redis pubsub instance
GW_PASSWORDif PUBSUB_TYPE='redis'Password for authenticating to Redis pubsub instance
GW_TLSif PUBSUB_TYPE='redis'TLS enabled/disabled for Redis pubsub instance
GW_ENABLE_OFFLINE_QUEUEif PUBSUB_TYPE='redis'https://luin.github.io/ioredis/interfaces/CommonRedisOptions.html#enableOfflineQueue
GW_LAZY_CONNECTif PUBSUB_TYPE='redis'https://luin.github.io/ioredis/interfaces/CommonRedisOptions.html#lazyConnect

Build docker image

Dev image (default platform)

Build dev tag image

docker buildx bake

Build image with custom tag:

TAG=myCustomTag docker buildx bake

If you want to build multiplatform images:

docker buildx create --name multibuilder
docker buildx use multibuilder