Skip to content

Latest commit

 

History

History
123 lines (80 loc) · 2.84 KB

SETUP.md

File metadata and controls

123 lines (80 loc) · 2.84 KB

Setup Guide

Prerequisite

  • Server Requirement

    • Operating System: Linux (linux/amd64, linux/arm64)
    • Min Requirement: 1 vCPU, 1GB RAM / 20GB Disk, Static IP
    • Suggested Requirement: 2 vCPU, 4GB RAM / 50GB SSD, Static IP
  • Docker installation: https://docs.docker.com/engine/install/ubuntu/

Quick run

  1. Getting API Key from API Provider
  1. Prepare a .env file and copy paste it from .env.sample and edit to your own need
# Use your fav text editor, vim/nano
nano .env
  1. Pull the docker images from https://hub.docker.com/r/chasmtech/chasm-scout
docker pull chasmtech/chasm-scout:latest
  1. Run the file
docker run -d --restart=always --env-file ./.env -p 3001:3001 --name scout chasmtech/chasm-scout

Run docker from codebase

1. Download Codebase

Download the codebase

# Download Via SSH
git clone [email protected]:ChasmNetwork/chasm-scout.git
# Download Via HTTPS
git clone https://github.com/ChasmNetwork/chasm-scout.git

Navigate to the project directory

cd chasm-scout

2. Getting API Key and UID from Chasm

  • Follow the steps provided by Chasm Network to obtain your API key and UID.

3. Getting API Key from API Provider

4. Setup .env

To the run command below replacing the path to your .env file

# Copy dot env
cp .env.sample .env

Update the .env file

5. Running the server with Docker

Scouts need to establish an internet connection with the orchestrator. This requires ensuring that the PORT specified in .env is reachable on the Docker Container via the internet. This involves either opening the port on the firewall or configuring port forwarding.

# Build Docker Image
docker build --tag 'chasm_scout' .
# Run docker
# Can consider adding --restart=always flag to always restart for production
# Note: Remember to change the port
docker run --env-file ./.env -p 3001:3001 --name scout chasm_scout

Alternative: Docker Compose

PORT=3001 docker compose up -d

6. Verifying the Setup

Access the running application at http://:3001 to verify the setup.

Check the Docker container logs for any issues:

docker logs scout

Run via Nodejs

Make sure your node.js version are >21 and have bun installed

bun i
bun run build
bun run dist/server/express.js

Troubleshooting

  • Environment Variables: Double-check that all required environment variables are set correctly in the .env file.

Additional Resources