In the following guide, we will cover all the necessary steps to set up an Arweave gateway, add it to Media Network and then serve its content to end-users through it.
A Unix OS (Debian 10 preferable)
Docker and Docker Compose LTS
There are several million transactions on the Arweave chain. In order to effectively serve content on the gateway you'll need a decent sized computer. The ideal specs for a Gateway should have the following:
16GB RAM (ideally 32GB RAM)
~4TB of SSD storage available
Intel i5 / AMD FX or greater, +4 vCPUs should be more than enough, these are typically Intel Xeon CPUs.
Copy sudo apt update ; \ sudo apt -y install tmux curl nano apt-transport-https ca-certificates curl gnupg2 software-properties-common
Add Docker’s official GPG key:
Import Docker GPG key used for signing Docker packages.
Copy curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Add the Docker repository to Debian 10
Add Docker repository which contain the latest stable releases of Docker CE.
Copy sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/debian \ $( lsb_release -cs ) \ stable"
Copy sudo apt update ; \ sudo apt -y install docker-ce docker-ce-cli containerd.io
This installation will add docker group to the system without any users. Add your user account to the group to run docker commands as non-privileged user.
Copy sudo usermod -aG docker $USER newgrp docker
Check docker and compose version
Copy $ docker version Client: Docker Engine - Community Version: 19.03 .2 API version: 1.40 Go version: go1.12.8 Git commit: 6a30dfc Built: Thu Aug 29 05:29:29 2019 OS/Arch: linux/amd64 Experimental: false
Server: Docker Engine - Community Engine: Version: 19.03 .2 API version: 1.40 ( minimum version 1.12 ) Go version: go1.12.8 Git commit: 6a30dfc Built: Thu Aug 29 05:28:05 2019 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2 .6 GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc: Version: 1.0 .0-rc8 GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f docker-init: Version: 0.18 .0 GitCommit: fec3683
Log out and log back in so that your group membership is re-evaluated.
Clone gateway repo
Copy git clone https://github.com/mediafoundation/arweave-gateway.git
By default, there is a default environment you can use located at
.env.docker in the repository.
DATABASE_HOST=postgres DATABASE_PORT=5432 DATABASE_USER=arweave DATABASE_PASSWORD=arweave DATABASE_NAME=arweave
ENVIRONMENT=public MANIFESTS=0 BIP39=0 PORT=3000
INDICES=["App-Name", "app", "domain", "namespace"]
CACHING=1 CACHE_FOLDER=/gateway/cache CACHE_OFFSET=0
Make sure you copy this configuration to
You can start the server with
Copy npm run docker:start
docker-compose up --build -d
You can spin down the
docker-compose cluster with.
Copy npm run docker:stop
Adding files to Arweave
You can add any type of content to Arweave. In this case we will put some text content into a
.txt file called
mytextfile.txt and put the text
"ARWEAVE TEST - VERSION 1" in it. Make sure you first install and load your Arweave wallet with AR tokens to be able to add files to the Arweave Network. You can buy AR in the following
markets. In this specific case, the price to deploy a txt file was 0.000001824540 AR Copy echo "ARWEAVE TEST - VERSION 1" > mytextfile.txt
You can read the file's contents using the cat command:
Upload mytextfile.txt to Arweave:
Copy arweave deploy mytextfile.txt Copy Enter your encryption passphrase to decrypt mcCDEo4G6F5QkHPtouxm64__djLfKr6las39rpKSAOc
Path: mytextfile.txt Size: 25.00 Bytes
ID: 6KZ2ok0JV21mtzUdo5WT_ErcuoLk9-MZcPWLX5LPmK8 Price: 0.000001824540 AR
- Content-Type:text/plain - User-Agent:ArweaveDeploy/1.9.1
Address: mcCDEo4G6F5QkHPtouxm64__djLfKr6las39rpKSAOc Current balance: 2.480000000000 AR Balance after uploading: 2.479998175460 AR
Carefully check the above details are correct, then Type CONFIRM to complete this upload CONFIRM Your file is deploying ! 🚀 Once your file is mined into a block it 'll be available on the following URL
You can check its status using ' arweave status 6KZ2ok0JV21mtzUdo5WT_ErcuoLk9-MZcPWLX5LPmK8'
You can now access any content hosted on the Arweave network, for example the file we've just deployed
mytextfile.txt using Arweave's txID:
Copy curl http://localhost:3000/6KZ2ok0JV21mtzUdo5WT_ErcuoLk9-MZcPWLX5LPmK8
You can test if the server and the GraphQL queries are working locally by navigating with a browser to:
This webpage should look similar to.