Skip to content

Latest commit

 

History

History

dev

Prepare Solana development environment

Load Metaplex into local test validator

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

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

just solana

Publish game bundle

Uploaded NFT metadata on Arweave:

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

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.

{
  "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.

just create-game spec.json

Game account address will be returned.

Generate a keypair for transactor

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

[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

just dev-reg-transactor /path/to/transactor.toml

Start transactor

just dev-transactor /path/to/transactor.toml