Pulling and setting the submodule
git submodule update --remote --recursive
Run the local node:
- make sure you have
local-node-setup.sh
,store-instantiate-contracts.sh
anddocker/*.sh
as executables - run
./local-node-setup.sh
- run
./store-instantiate-contracts.sh
This will provide you with Admin and 10 players with chain balance in uscrt
player | pj-nft-xp | scrt balance |
---|---|---|
1 | 0 | 1000 |
2 | 100 | 2000 |
3 | 200 | 2000 |
4 | 300 | 1000 |
5 | 300 | 10000 |
6 | 400 | 10000 |
7 | 400 | 10000 |
8 | 500 | 10000 |
9 | 0 | 0 |
- Run local chain
- Store contracts
- Instantiate pj-nft contract with account
admin
- Initially NFT distribution 8 different NFTs at different levels belongs to different 8 accounts
admin
CallBatchMintNFT
with the set metadata- DAO calls
MintNFTClones
(for a few NFTs so new users can have some)
- Instantiate pj-dao contract with account
admin
- Admin sends in scrt to pj DAO
- Provide the same 8 accounts (as NFT contract) with pjc
- Initialise to use the pj-nft contract address
-
Describe rules
-
Player 9 arrives on landing page
- Connect to wallet
- New Player page (button to start playing)
- DAO tx() ->
joinDao()
-> call back: on success redirect to user home page - Dao contract mints NFT to player 9
- NFT display in player's inventory
-
(optional) Player 9 attempts to starts game
- button to start game ()
- DAO tx() ->
CreateNewGameRoom
-> call back:Error::not_enough_scrt
- popup? button to collateralise
- NFT tx() ->
collateral_init
-> pending
-
(optional) manually provide collateral (nodejs script?)
-
Player 9 starts game again -> success
-
Player 1 arrives on landing page
- Connect to wallet
- Game Query: Sees active games (the one with Player 9)
- NFT Query: Sees owned NFTs of wallet. use
tokens
query to get a list of token_ids then get each token's metadata viaNftInfo
query
Tokens { owner: HumanAddr, /// optional address of the querier if different from the owner viewer: Option<HumanAddr>, /// optional viewing key viewing_key: Option<String>, /// paginate by providing the last token_id received in the previous query start_after: Option<String>, /// optional number of token ids to display limit: Option<u32>, }, NftInfo { token_id: String },
The
NftInfo
returned is in the form of:NftInfo { token_uri: Option<String>, extension: Option<Extension>, },
- using the
NftInfo.extensions.description
as thexp
- using the
NftInfo.extension.attributes
as the colour displays
- joins player 9 with
join
game with a selected dice set - DAO tx() ->
joinGame(nft_id)
-> call back:Success (game_id)
-> redirect to game page
-
Player 1 and Player 9 roll dice - button
- DAO tx() ->
roll(game_id)
-> call back:dice outcome {}
- Query: display dice outcome to both parties
- DAO tx() ->
-
Reroll
- DAO tx() ->
reroll(game_id, number_of_dic)
->dice outcome {}
- DAO tx() ->
-
End game
- DAO tx() ->
endGame(game_id)
->pending_other_player
/game ended
- if game ended -> home page
- DAO tx() ->
-
Show balance update
- if Player 9 loses, DAO will exercise the transfers
endGame()
should trigger check collateral
- if Player 9 loses, DAO will exercise the transfers
- Landing page
- All active / waiting games
- Join Dao button
- Join Dao popup?
- join Dao button
- Home page
- see all games
- join game
- start new game
- user balance
- user dice set nfts
- game page
- see what the other person has rolled
- see own dice metadata and info (query blockchain for metadata)
- reroll button after 1st roll
-
joinDao
-
CreateNewGameRoom
-
joinGame
-
roll
-
reroll
-
endGame
-
getActiveGames
-
mint
-
setMetadata (from DAO)
-
collateral_init
-
collateralise
-
uncollateralise
-
getNFTs (dice level, colours, )