chips-blockchain / bet

Licence: other
This repository holds the implementation code of Pangea Poker white paper: https://bit.ly/3bdCz0Z

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
TeX
3793 projects
Roff
2310 projects
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to bet

PlayPiano
Implement and simulate piano on web page.
Stars: ✭ 16 (+6.67%)
Mutual labels:  players
pyradox
Python parser for Paradox .txt files.
Stars: ✭ 28 (+86.67%)
Mutual labels:  gaming
felfele
Decentralized social application that respects your privacy
Stars: ✭ 30 (+100%)
Mutual labels:  decentralized-application
pluribus-hand-parser
Parsing the hand histories that poker AI Pluribus played
Stars: ✭ 54 (+260%)
Mutual labels:  poker
kasir
Cashier Management & Inventory Management System
Stars: ✭ 28 (+86.67%)
Mutual labels:  cashier
arch-guide
My installation instructions and guide for Arch Linux
Stars: ✭ 25 (+66.67%)
Mutual labels:  gaming
horadric-helper
A WebComponents library that allows you to display tooltips from ARPG games on you webstie using Html tags.
Stars: ✭ 32 (+113.33%)
Mutual labels:  gaming
lambda-moo-programming
Lambda MOO Programming collects and updates numerous MOO guides in one place and includes an updated and expanded version of the MOO Programmer's Manual in markdown and HTML5. It also includes the ToastStunt Programmers Guide and links to ToastStunt references.
Stars: ✭ 40 (+166.67%)
Mutual labels:  gaming
MetropolisLauncher
A data-heavy Emulation & Gaming front-end for Windows
Stars: ✭ 35 (+133.33%)
Mutual labels:  gaming
MicrosoftCloudWorkshop-Asia
Microsoft Cloud Workshop Asia for Intelligent Cloud / Intelligent Edge
Stars: ✭ 20 (+33.33%)
Mutual labels:  gaming
TommyGun
A retro development IDE for the creation of games on 8-bit computers.
Stars: ✭ 37 (+146.67%)
Mutual labels:  gaming
awesome-gnu-linux-gaming
A curated list of awesome GNU/Linux tips & tricks, games, tools, and resources - Mirrored from: https://gitlab.com/linuxcafefederation/awesome-gnu-linux-gaming.git
Stars: ✭ 135 (+800%)
Mutual labels:  gaming
texas-poker-engine
Dummy Texas Poker Engine open source edition
Stars: ✭ 4 (-73.33%)
Mutual labels:  poker
fullscreenizer
Source Code of Fullscreenizer
Stars: ✭ 56 (+273.33%)
Mutual labels:  gaming
poinz
Distributed Planning Poker
Stars: ✭ 105 (+600%)
Mutual labels:  poker
OoT-Interactive-Map
Interactive Map for the world of Zelda: Ocarina of Time
Stars: ✭ 22 (+46.67%)
Mutual labels:  gaming
argent
ARGENT: a Xaserious DOOM (4) to DooM (classic) weapon mod.
Stars: ✭ 17 (+13.33%)
Mutual labels:  gaming
oversmash
Overwatch API library for player details and career stats
Stars: ✭ 42 (+180%)
Mutual labels:  gaming
awesome-game-essays
Thoughtful and noteworthy links to awesome videogame "essay" kind of content .🎮
Stars: ✭ 25 (+66.67%)
Mutual labels:  gaming
valheim-ecs-fargate-cdk
AWS CDK/Cloudformation to deploy a Valheim Server using ECS Fargate!
Stars: ✭ 66 (+340%)
Mutual labels:  gaming

bet CD

Pangea-Bet

Abstract

Bet is a decentralized adopatable gaming platform that meet the needs of any card game and predictable betting scenarios. The initial draft is written by jl777 is here. The underlying cryptocurrency that bet uses is CHIPS and for real time betting and bet uses CHIPS over LN.

The detailed technical whitepaper is here.

Configuration

Bet can be played with or without LN. please go through the existing tradeoffs we have at the moment to understand the ecosystem in a better way also please go through the bet without ln on how to play poker without using ln and it contains some nice info about various methods and info about various tx's involved during the gameplay.

To Play

It's simple, just follow these steps to play poker on bet plarform using CHIPS.

  • Setup: Setup the nodes by following any of the approaches mentioned in the setup documentation.
  • Load the funds: Load the chips wallet with whatever the amount of the CHIPS that you willing to play. Lets say if you are joining the talbe of stake_size 10 CHIPS, its always advisable to load the CHIPS wallet with >10 CHIPS why because the actions occur during the game are recorded in the CHIPS blockchain and every action of user costs 0.0005 CHIPS tx_fee to the user.
To get the chips address on the setup node run
$chips-cli getnewaddress
You will get an address and to this address deposit CHIPS to play.

  • Withdraw funds: Needless to say, once the game is done, its always advisable to move funds back to your secure wallet. Before withdrawing the funds, if there is any issues like player disconnection, loss of funds like that happens then raise the dispute with the cashier node as mentioned below and then withdraw the funds.
cd
cd bet/privatebet
./bet game solve

Withdraw using the following command
./bet withdraw <amount> <to_your_chips_address>

Setup

There are many different ways in which you can setup the nodes to play the poker using bet. Here are some of the ways in which you can setup the nodes:

  • The easy approach - Using the docker
  • The hardway way - By compiling the chips and bet repos all the way.
  • Using the precompiled binaries
  • Using the compilation script

Irrespective of whichever approach you follow, the prerequisites and configuration of nodes remain same

Prerequisites

For Player and Dealer nodes
  • Ports used by the respective entities must be open. Below are the list of the ports used and should be remained open incase if you have any firewall configurations.
* 7797 - This port is used to have pub-sub communication between Dealer and player nodes.
* 7798 - This port is used to have pull-push communication between Dealer and player nodes.
* 7901 - This port is used to have pub-sub communication between Cashier and any other{player,dealer} nodes.
* 7902 - This port is used to have push-pull communication between Cashier and any other{player,dealer} nodes.
* 9000 - This port is used to have websocket communication between GUI and {player,dealer} nodes.
* 1234 - This is the port on which the webserver runs on, this port should be opened if the player is hosting its own GUI.

For Dealer and Cashier nodes

  • The dealer and cashier nodes should need the static public IP for the nodes on which they setup.

Configuring the nodes

The behaviour of the node is based on how you configure it. We can enable/disable few functionalities of the players and dealers by making corresponding settings in the configuration files. All the configuration files are located in the path./bet/privatebet/config.

Lets take a look into the details of what these configuration settings mean:

  1. For Player configuration follow this link
  2. For Dealer configuration follow this link
  3. For Cashier configuration follow this link

Setting up the nodes

Now lets take a look into one by one approach and you can follow either of these approaches to setup the chips and bet nodes.

Approach1 :- Playing using Docker - It all takes few commands with the setup time <5 mins

The docker image is built on top of the ubuntu 20.04 base image for bet. The simplest way to play poker is using the docker images. All the docker images for the bet are maintained here

https://hub.docker.com/r/sg777/bet/tags

Pull the latest tag (at the time of writing this v1.5 is the latest tag) and do the following to setup the nodes and play

step1 :- Pulling the docker image

docker pull sg777/bet:v1.5

step2 :- Running the docker image

Note: At the moment the docker setup only works if the host network is shared with the docker image. Since you sharing the host network with the docker please be make sure to stop chipsd and bet if any running in the host machine.

The docker image can be run with various options, here we see few such ways which are important to know.

To share host n/w
docker run -it --net=host sg777/bet:v1.5

--OR with chosen name to a container

docker run -it --name poker --net=host sg777/bet:v1.5
To share host n/w and to run bet using gdb
docker run -it --net=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --name poker sg777/bet:v1.5
To share host n/w, to run bet using gdb and to use locally available preloaded chips blocks

Lets say your machine already has chips installed in you can mount the path of .chips directory path on to the docker image, else follow these steps to download the chips bootstrap node.

cd && mkdir chips_bootstrap
cd chips_bootstrap
wget https://eu.bootstrap.dexstats.info/CHIPS-bootstrap.tar.gz
tar --overwrite -xvf "$bootstrap_node"
wget https://raw.githubusercontent.com/chips-blockchain/bet/master/privatebet/config/chips.conf

Then run the docker as follows:

docker run -it --net=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /root/chips_bootstrap:/root/.chips:rw --name poker sg777/bet:v1.5

--OR without debug option

docker run -it --net=host -v /root/chips_bootstrap:/root/.chips:rw --name poker sg777/bet:v1.5

cd && ./chips/src/chipsd &

Note: Here /root/chips_bootstrap is the path on my local machine where(Here you have to provide the path on your machine) in which i downloaded chips bootstrap as mentioned above and i'm mounting this to the path /root/.chips on the docker image. If you start the docker image with this approach you can simply skip step3.

step3 :- Running chips node

Once you have access to the docker shell, you can load the chips from the chips bootstrap node. Running the below script pulls the bootstrap node and configures the chips node.

cd && ./load_bootstrap_node.sh

Then run the chips daemon

./chips/src/chipsd &

step4 :- If you are a player run the player as follows

cd
./bet/privatebet/bet player

step4 :- If you are the dealer run the dealer as follows

cd
./bet/privatebet/bet dcv <host_ip>

step5 :- Hosting the GUI

Using the GUI hosted by the cashier and dealer nodes

GUI can be hosted by anyone, by default the GUI is hosted by all the cashier nodes and dealer nodes can also host the GUI as a service they provide to its players. After starting the player node with ./bet player in the above step, in the logs you see the list of the servers where the GUI hosted something like below:

[client.c:bet_player_handle_stack_info_resp:1345] Player can use any of the GUI's hosted by cashiers to connect to backend
[config.c:bet_display_cashier_hosted_gui:236] http://141.94.227.65:1234/
[config.c:bet_display_cashier_hosted_gui:236] http://141.94.227.66:1234/
[config.c:bet_display_cashier_hosted_gui:236] http://141.94.227.67:1234/
[config.c:bet_display_cashier_hosted_gui:236] http://141.94.227.68:1234/
[config.c:bet_display_cashier_hosted_gui:236] http://159.69.23.30:1234/

You can access any of these links in your browser and from which you can connect to the players backend which you setup in the step 4.

Hosting own GUI

In case if you like to host the GUI, please note that the GUI server is running on the port 1234, so for this you need to start the docker image as mentioned below:

docker run -it -p 1234:1234 sg777/bet:v1.5

Note: v1.5 is latest tag at the time of this writing, always pull the docker image with the latest tag to avoid the manual process of updating and compiling the git repos manually.

cd
cd pangea-poker
npm start &

Once you hosted your own GUI, from your local browser you can access the GUI using http://localhost:1234/.

step6 :- Playing

Now we have everything ready to play. All you need to just connect to player backend from GUI and play. Lets play

NOTE: Irrespective of whichever approach you follow in setting up the nodes, the steps3-6 remains same.

Approach2 :- Compiling the repos from scratch

Compilation Guidelines

  1. Compiling only bet repo
  2. Compiling all the repos needed on Ubuntu
  3. Detailed compilation of all the repos needed on various platforms

Approach3 :- Using the precompiled binaries

We making automated binary releases for various platforms. The latest binaries from here can be taken to setup the nodes.

Downloading precomipled binaries & CHIPS bootstrap node

  1. Precompiled binaries
  2. CHIPS bootstrap node

Approach4 :- Using the installation script

If you wish to install everything required for setting up Pangea Poker, you can use the following command to auto-install Pangea Poker:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/chips-blockchain/bet/master/tools/install-pangea.sh)"

Coomunication b/w Bet Nodes

The communication b/w the nodes at very high level is described here.

CHIPS & LN Upgrade

Here contains the list of API's that bet uses from chips and ln. So whenever any upstream changes made to either chips and ln repos one must be careful to check if there is any change in these API functionalities, inputs and outputs.

Glossary

Many of the times we use short hand abbreviations, so glossary for it is here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].