Skip to content

elysia-dev/betos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Betos

Aptos price betting platform.

website-preview

Deployments

Code structure

This is basically Move project with several subdirs.

  • app: React frontend
  • cron: Serverless framework to call execute_round every 6 hour.
  • scripts: Admin scripts.

Getting started

Follow this to run on devnet.

$ aptos init --profile test
$ aptos init --profile test2

$ aptos move create-resource-account-and-publish-package --seed 3234 --address-name betos --named-addresses admin=test2 --profile test2 --skip-fetch-latest-git-deps --assume-yes
Do you want to publish this package under the resource account's address xxxx?

Set env vars

Create export-env.sh as below.

export APTOS_KEY=0x...
export TESTNET_BETOS_ADDRESS=0x...
export MAINNET_BETOS_ADDRESS=0x...

Test

aptos move test --ignore-compile-warnings

Run admin functions

Put the resource account address in xxxx.

source export-env.sh
cd scripts
yarn run ts-node execute.ts
yarn run ts-node execute.ts
yarn run ts-node execute.ts
# Now there are 3 rounds: 1 closed, 1 locked, 1 started
# Repeat `yarn run ts-node execute.ts` to progress

pause

You can pause like this.

source export-env.sh
aptos move run --function-id $MAINNET_BETOS_ADDRESS::prediction::pause --profile main

Main account info

main:
  private_key: "_"
  public_key: "_"
  account: c655e88231fc493c0e105caa6ad27849e6b432153ee2c3456e3d88e7a706b1b7
  rest_url: "https://fullnode.mainnet.aptoslabs.com"