This configuration will setup the following 4 docker containers:

  • Nginx with certbot on TCP ports 80 and 443.

  • Gaia hub on TCP port 3000.

  • Gaia admin on TCP port 8009.

  • Gaia reader on TCP port 8008

1. Update the system and install the dependencies and software we will use to test:

apt update && apt upgrade -y && apt install -y git vim gnupg jq

2. Install docker and docker-compose in your OS. For our example we install docker with:

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt update && apt install -y docker-ce docker-ce-cli

Install docker-compose by downloading the latest-release:

VERSION_DC=$(curl --silent | jq .name -r)
mkdir -p ${DESTINATION_DC}
curl -SL${VERSION_DC}/docker-compose-linux-x86_64 -o ${DESTINATION_DC}/docker-compose
chmod +x ${DESTINATION_DC}/docker-compose

3. Clone the GAIA repository and enter it's docker directory.

git clone && cd gaia/deploy/docker

4. Copy and edit appropriate .env file. In the folder ./deploy/docker/ they are different sample files for different configurations like using aws, azure or disk among others. In this example we will store the data locally so we will copy the disk file and update the domain and email fields. Please change and accordingly. Note you need both for the SSL certificate to be created correctly.

cp sample-disk.env disk.env
sed -i 's/'"$MYGAIADOMAIN"'/g' disk.env
sed -i 's/'"$MYGAIAEMAIL"'/g' disk.env

5. Start GAIA HUB service

To start GAIA HUB

./ start

To stop GAIA HUB

./ stop

To view GAIA HUB status

./ status

6. Verify server works locally with the following command:

curl -sk http://localhost/hub_info | jq

A correct result should look similar to this:

      "challenge_text": "[\"gaiahub\",\"0\",\"gaia-0\",\"blockstack_storage_please_sign\"]",
      "latest_auth_version": "v1",
      "max_file_upload_size_megabytes": 20,
      "read_url_prefix": ""

7. Test your GAIA HUB Running gaia_test.js will test your GAIA Hub, by trying to connect to it, uploading a file and downloading it again.

First install all required dependencies with:

npm install

Then, from the root folder of the project type:

node ./deploy/gaia_test.js https://yourgaiaurl

A correct result will be something like this:

Will run a test for the GAIA HUB:
Generating some test keys...
Private key:  5aacc60fc2a429e1f02be139f3cac82061c6a980********************
Public key:   025691f17f2ab80dc4af363bb9c7aac59e9e1db6ae8ff668202582a3f4ec9678ff
Address:      15n8Xo8acRvSZghJG2dxJ8dCdzDMYicUuS
[DEBUG] connectToGaiaHub:
[DEBUG] uploadToGaiaHub: uploading testing.txt to
File uploaded successfully.
Upload to gaia hub thinks it can read it from:
Hub info thinks it can read it from          :
Let's now try to fetch the uploaded file...
File fetched successfully. Contents of file: GAIA ROCKS!

Last updated