🛠️
Stacks Documentation
  • Start Here
  • 🧠Concepts
    • Stacks 101
      • What Is Stacks?
      • Bitcoin Connection
      • Proof of Transfer
      • Stacks Among Other Layers
      • Financial Incentive and Security Budget
    • Network Fundamentals
      • Network Basics
      • Mainnet and Testnets
      • Accounts
      • Authentication
      • Bitcoin Name System
      • SIPs
      • Technical Specifications
    • Block Production
      • Mining
      • Signing
      • Bitcoin Finality
      • Bitcoin Reorgs
      • Stacking
    • Transactions
      • How Transactions Work
      • Post Conditions
    • Clarity
      • Overview
      • Decidability
    • sBTC
      • Core Features
      • sBTC Operations
        • Deposit
        • Withdrawal
        • Deposit vs Withdrawal Times
      • Emily API
      • Peg Wallet UTXO
      • Clarity Contracts
        • sBTC Registry
        • sBTC Token
        • sBTC Deposit
        • sBTC Withdrawal
      • Auxiliary Features
        • Transaction Fee Sponsorship
        • Signer Wallet Rotation
      • Walkthroughs
        • Signer Process Walkthrough
        • sBTC Transaction Walkthrough
      • sBTC FAQ
    • Gaia
      • Configuration
      • Deploy Gaia Hub
      • Amazon EC2
      • Linux
      • Mac OS
  • 🛠️Guides & Tutorials
    • Developer Quickstart
    • Clarity Crash Course
    • Build a Borrowing & Lending Protocol
    • Bitcoin Integration
      • Sending Bitcoin with Leather Wallet
      • Verifying a Bitcoin Transaction
      • Parsing a Bitcoin Transaction
    • Create Tokens
      • Creating a NFT
      • Creating a Fungible Token
    • Build a Frontend
      • Post Conditions with Stacks.js
      • Authentication with Stacks.js
      • Sending Transactions with Stacks.js
    • Testing Smart Contracts
      • Fuzz Testing
    • Run a Node
      • Run a Node with Docker
      • Run a Node with Digital Ocean
      • Run a Node with a Hosted Provider
      • Run a Node with Quicknode
      • Run a Bitcoin Node
      • Run a Pruned Bitcoin Node
    • Run a Miner
      • Miner Prerequisites
      • Miner Costs and Fees
      • Mine Testnet Stacks Tokens
      • Mine Mainnet Stacks Tokens
      • Verify Miner
    • Run a Signer
      • Signer Quickstart
      • How to Read Signer Logs
      • How to Monitor a Signer
      • Best practices for running a Signer
      • OpSec Best Practices
    • sBTC
      • How to Run an sBTC Signer
      • Best practices for running an sBTC Signer
      • How to Use the sBTC Bridge
      • Earn sBTC Rewards
    • Stack STX
      • Solo Stack
      • Operate a Pool
      • Stack with a Pool
      • Increase Stacked Position
      • Stop Stacking
    • Oracles
    • Community Tutorials
  • 📚Reference
    • API
    • Clarity Types
    • Clarity Functions
    • Clarity Keywords
    • Stacks Node Configuration
    • Signer Configuration
    • Stacks Tooling
  • 🏗️Example Contracts
    • Audited Starter Contracts
    • Stacking
    • BNS
    • Multi Send
  • 🧡Press & Top Links
    • 🔶2024
      • 🔸January 2024
      • 🔸February 2024
      • 🔸March 2024
      • 🔸April 2024
      • 🔸May 2024
      • 🔸June 2024
      • 🔸July 2024
      • 🔸August 2024
      • 🔸September 2024
      • 🔸October 2024
      • 🔸November 2024
      • 🔸December 2024
    • 🔶2025
      • 🔸January 2025
      • 🔸February 2025
      • 🔸March 2025
  • 🧡Bitcoin Theses and Reports
    • 🟠Bitcoin Theses
    • 📙Bitcoin Reports
  • Contribute
Powered by GitBook
On this page

Was this helpful?

  1. Concepts
  2. Gaia

Linux

PreviousAmazon EC2NextMac OS

Last updated 1 year ago

Was this helpful?

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 and in your OS. For our example we install docker with:

curl -fsSL https://download.docker.com/linux/debian/gpg | 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] https://download.docker.com/linux/debian \
  $(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 containerd.io

Install docker-compose by downloading the :

VERSION_DC=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
DESTINATION_DC=~/.docker/cli-plugins
mkdir -p ${DESTINATION_DC}
curl -SL https://github.com/docker/compose/releases/download/${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 https://github.com/stacks-network/gaia.git && 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 gaia.site.com and gaiarocks@mydomain.com accordingly. Note you need both for the SSL certificate to be created correctly.

export MYGAIADOMAIN=gaia.site.com
export MYGAIAEMAIL=gaiarocks@mydomain.com
cp sample-disk.env disk.env
sed -i 's/my-domain.com/'"$MYGAIADOMAIN"'/g' disk.env
sed -i 's/my-email@example.com/'"$MYGAIAEMAIL"'/g' disk.env

5. Start GAIA HUB service

To start GAIA HUB

./gaiahub.sh start

To stop GAIA HUB

./gaiahub.sh stop

To view GAIA HUB status

./gaiahub.sh 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": "https://gaia.site.com/reader/"
    }

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: https://gaia.mydomain.com
Generating some test keys...
Private key:  5aacc60fc2a429e1f02be139f3cac82061c6a980********************
Public key:   025691f17f2ab80dc4af363bb9c7aac59e9e1db6ae8ff668202582a3f4ec9678ff
Address:      15n8Xo8acRvSZghJG2dxJ8dCdzDMYicUuS
[DEBUG] connectToGaiaHub: https://gaia.mydomain.com/hub_info
[DEBUG] uploadToGaiaHub: uploading testing.txt to https://gaia.mydomain.com
File uploaded successfully.
Upload to gaia hub thinks it can read it from: https://gaia.mydomain.com/reader/15n8Xo8acRvSZghJG2dxJ8dCdzDMYicUuS/testing.txt
Hub info thinks it can read it from          : https://gaia.mydomain.com/reader/15n8Xo8acRvSZghJG2dxJ8dCdzDMYicUuS/testing.txt
Let's now try to fetch the uploaded file...
File fetched successfully. Contents of file: GAIA ROCKS!
🧠
docker
docker-compose
latest-release