-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
279a91b
commit e7f88ee
Showing
16 changed files
with
173 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
holdem-simple: | ||
zellij --layout layouts/holdem-simple.kdl | ||
|
||
holdem-multi: | ||
zellij --layout layouts/holdem-multi.kdl | ||
|
||
durak-simple: | ||
zellij --layout layouts/durak-simple.kdl | ||
|
||
demo-app: | ||
zellij --layout layouts/demo-app.kdl | ||
|
||
mtt-simple: | ||
zellij --layout layouts/mtt-simple.kdl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,3 @@ | ||
# Prepare Solana development environment | ||
# Dev Scripts for Race Development | ||
|
||
## Load Metaplex into local test validator | ||
|
||
```bash | ||
solana program dump -u m metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s token_metadata_program.so | ||
|
||
# This will reset the test-ledger | ||
solana-test-validator --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s token_metadata_program.so --reset | ||
``` | ||
|
||
## Create a token for testing | ||
|
||
```bash | ||
spl-token create-token | ||
|
||
spl-token create-account <TOKEN_ADDRESS> | ||
|
||
spl-token mint <TOKEN_ADDRESS> <AMOUNT> | ||
``` | ||
We use this token for following tests. | ||
|
||
## Deploy RACE contract to solana localnet | ||
|
||
``` shell | ||
just solana | ||
``` | ||
|
||
|
||
## Publish game bundle | ||
|
||
Uploaded NFT metadata on Arweave: | ||
|
||
- Chat: https://arweave.net/6SOGM007lgaeBH1SOJ-Ifm9eUUNz4kCdRqVJe-yl9_g | ||
- Raffle: https://arweave.net/hTlRRw2tZ2q_RpklixjRIzrR3PgAChBujAKzp6wknHs | ||
|
||
```shell | ||
just publish Chat https://arweave.net/6SOGM007lgaeBH1SOJ-Ifm9eUUNz4kCdRqVJe-yl9_g | ||
just publish Raffle https://arweave.net/hTlRRw2tZ2q_RpklixjRIzrR3PgAChBujAKzp6wknHs | ||
``` | ||
|
||
NFT addresses will be returned when upload succeed. Later we will use this NFT token address as **bundle address**. | ||
|
||
## Create game registration | ||
|
||
```shell | ||
just create-reg | ||
``` | ||
|
||
## Create game accounts | ||
|
||
To create games, a spec file in JSON is required. Replace the addresses with what you have, and save it as `spec.json`. | ||
|
||
```json | ||
{ | ||
"title": "<GAME TITLE>", | ||
"reg_addr": "<REPLACE WITH THE REGISTRATION ADDRESS>", | ||
"bundle_addr": "<REPLACE WITH THE BUNDLE ADDRESS>", | ||
"token_addr": "<REPLACE WITH THE TOKEN ADDRESS>", | ||
"max_players": 10, | ||
"min_deposit": 10, | ||
"max_deposit": 20, | ||
"data": [] | ||
} | ||
``` | ||
|
||
Create the game account with command line tool. | ||
|
||
```shell | ||
just create-game spec.json | ||
``` | ||
|
||
Game account address will be returned. | ||
|
||
## Generate a keypair for transactor | ||
|
||
```shell | ||
solana-keygen new -o transactor.json | ||
|
||
# Transfer some SOL to this new account | ||
solana transfer --allow-unfunded-recipient <TRANSACTOR PUBKEY> 2 | ||
``` | ||
|
||
## Create transactor configuration file | ||
|
||
```toml | ||
[transactor] | ||
port = 12003 | ||
endpoint = "ws://localhost:12003" | ||
chain = "solana" | ||
address = "<REPLACE WITH GENERATED KEYPAIR'S PUBLIC KEY>" | ||
reg_addresses = ["<REPLACE WITH THE REGISTRATION ADDRESS>"] | ||
|
||
[solana] | ||
keyfile = /path/to/transactor.json | ||
rpc = "http://localhost:8899" | ||
``` | ||
|
||
## Register server | ||
|
||
``` shell | ||
just dev-reg-transactor /path/to/transactor.toml | ||
``` | ||
|
||
## Start transactor | ||
|
||
```shell | ||
just dev-transactor /path/to/transactor.toml | ||
``` | ||
This folder contains the scripts and configurations for local development on Race Protocol. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
description = "Dev scripts for Race Protocol"; | ||
|
||
inputs = { | ||
nixpkgs = { url = "github:NixOS/nixpkgs/nixos-23.05"; }; | ||
flake-utils = { url = "github:numtide/flake-utils"; }; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
in | ||
{ | ||
devShell = pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
just | ||
zellij | ||
]; | ||
}; | ||
} | ||
); | ||
|
||
nixConfig = { | ||
bash-prompt-prefix = "[flake]"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"title": "Cash Table", | ||
"bundle": "../race-holdem/target/race_holdem_cash.wasm", | ||
"token": "FACADE_USDC", | ||
"maxPlayers": 6, | ||
"entryType": { | ||
"cash": { | ||
"minDeposit": 1000000, | ||
"maxDeposit": 3000000 | ||
} | ||
}, | ||
"data": [16,39,0,0,0,0,0,0,32,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.