Skip to content

omega000133/lotterylatamnodes-backend

Repository files navigation

Deployment Guide

Initial Setup

Install Dependencies

Ensure you have the following installed on your system:

  • Python (3.10+)
  • pip (Python package manager)
  • Virtualenv

Clone the repo and change directory

git clone https://github.com/clock-workorange/LotteryLatamNodesBack.git
cd LotteryLatamNodesBack

Create a Virtual Environment and Install dependencies

  1. Create a virtual environment:
  python3 -m venv .venv
  1. Activate the virtual environment:
source .venv/bin/activate
  1. Install other dependencies listed in requirements
pip install -r requirements/dev.txt

Configuration

Database Configuration

  1. Create database
  • Install postgresql on system
  • Create Database on on postgresql
  1. Change .env file configuration
nano .env
DB_USER=postgres
DB_HOST=localhost
DB_PASSWORD=localhost_pwd

Database migration and Create super user

Database migration

python manage.py makemigrations
python manage.py migrate

Create super user

python manage.py createsuperuser

Running server

sh start.sh
sh celery_db.sh
sh celery_info.sh

Configuration default delegator data

Open django shell

python manage.py shell

Running task manually

from latam_nodes.delegator.tasks import save_delegators_task, create_ticket

save_delegators_task()
create_ticket()

Testing Guide

Login admin page

Go to Admin page

username: test
password: testpassword

That info is from python manage.py createsuperuser

Create Packpot

Create Packpot

  • Winning percentage: Percentage number of Reward that delegators will get
  • Ticket cost: Cost per ticket(Delegators will get staking amount / ticket cost's ticket for free)
  • Draw date: The date the Lottery ends(You have to set this value after now)

About

The LATAMNodes lottery allows you to participate by staking your $TIA tokens with LATAMNodes through your preferred wallet. Tickets are distributed based on the amount of TIA staked.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors