projectinca_game/README.md
2024-07-10 11:58:03 -04:00

2.4 KiB

Project INCA Game

Table of Contents


Introduction

This repository contains the proof-of-concept for the INCA Game, a mini app on Telegram with a Solana wallet support.

We provide the steps necessary to deploy the game on a Telegram bot. The bot is hosted first on a Full VM running on the ThreeFold Grid.

Overview

This project is a clone of the popular Telegram mini app, Hamster Kombat, that has been adapted for the INCA Project.

Prerequisites

To run on a 3Node on the ThreeFold Grid with a Full VM, you will need to prepare the VM:

apt update
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 18
npm install -g yarn

Set DNS Domain

Make sure the IPv4 address is pointing to your domain name (DNS A Record).

Set HTTPS

Set HTTPS by using a reverse proxy with Caddy. Adjust with your own domain.

caddy reverse-proxy -r --from <example.com> --to :5173

Set a Telegram Bot

You can use the Bot Father to create your bot.

  • Create a bot
/newbot
  • Create a mini app
/newapp
  • Make sure to put the URL of your domain when asked for an HTTPS URL

Start the Game

To get started with either the initial setup or the final version, follow these instructions:

  1. Clone the Repository:

    git clone https://git.ourworld.tf/tfgrid/projectinca_game
    cd projectinca_game
    
  2. Install Dependencies:

    npm install
    
  3. Run the Development Server:

    npm run dev -- --host
    
  4. Open Your Browser:

    Navigate to localhost to see the final version of the application.

References

This repository is based on the amazing work of nikandr-surkov.