GithubHelp home page GithubHelp logo

mercurybot-deploy's Introduction

Deploy MercuryBot to VPS Instance

Minimum Server Requirement

* OS: Ubuntu
* RAM: 256 MB
* CPU: 1 Core
* DISK: 8 GB

Instructions for Ubuntu. You must copy & paste the entire command blocks below when running the commands, not one line at a time.

1) VPS Preparation

For obvious security reason, you should NOT run this application as root user. Setup an unprivileaged user account with sudo access using the following command:

adduser --disabled-password --gecos '' mercury && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
adduser mercury sudo && \
chown -R mercury:mercury /home/mercury/.*

Next, we'll install required initial tools:

apt-get install wget unzip make -y

Lastly setup ssh public key authentication by following this guide: https://serverpilot.io/docs/how-to-use-ssh-public-key-authentication

Login as mercury (newly setup user) and continue with the remaining steps below.

2) Download Deployment Files

wget https://github.com/latheesan-k/MercuryBot-Deploy/archive/refs/heads/main.zip && \
unzip main.zip && \
mv MercuryBot-Deploy-main MercuryBot && \
rm -f main.zip

3) Install Dependencies (Docker & Self-Signed SSL Certificates)

cd MercuryBot && \
make install && \
make ssl

โš ๏ธ After installing the dependencies, don't forget to restart your server with sudo reboot command

4) Run MercuryBot Application

Modify the MercuryBot/docker-compose.yml with appropriate settings:

environment:
  API_USER: dev
  API_PASS: dev
  NETWORK: testnet
  • API_USER Authentication username
  • API_PASS Authentication password
  • NETWORK Cardano network (use testnet or mainnet)

Execute the following command to boot up the application:

make up

MercuryBot will be running on: https://your-server-ip

Verify the application running correctly using the following curl command:

curl --insecure --location --request GET 'https://your-server-ip' \
--header 'X-API-USER: dev' \
--header 'X-API-PASS: dev'

You should see a response like this:

{"status":200,"data":{"message":"Welcome to MercuryBot 1.0.0","version":"cardano-cli 1.27.0 - linux-x86_64 - ghc-8.10","build":"git rev 8fe46140a52810b6ca456be01d652ca08fe730bf"}}

5) Available Make Commands

  • up Turn on / restart the application
  • down Turn off the application
  • upgrade Download the latest version & restart the application
  • status View the status of the running application
  • stats View the resource usage (CPU, RAM, IO etc...) by the application
  • logs View application logs
  • shell Drop into running application's container shell
  • install Installs docker
  • ssl Generates new apache self-signed certificates

mercurybot-deploy's People

Contributors

latheesan-k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.