Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vvizardev/coinflip-cob-game
coinflip-cob-game : This is the coinflip program for CobGame studios.
https://github.com/vvizardev/coinflip-cob-game
backend coinflip frontend game smartcontract solana
Last synced: 11 days ago
JSON representation
coinflip-cob-game : This is the coinflip program for CobGame studios.
- Host: GitHub
- URL: https://github.com/vvizardev/coinflip-cob-game
- Owner: vvizardev
- Created: 2024-07-02T05:55:24.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-05T19:15:54.000Z (4 months ago)
- Last Synced: 2025-01-25T17:19:04.287Z (11 days ago)
- Topics: backend, coinflip, frontend, game, smartcontract, solana
- Language: TypeScript
- Homepage:
- Size: 869 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# coinflip-cob-game
This is the coinflip program for CobGame studios.📞 Cᴏɴᴛᴀᴄᴛ ᴍᴇ Oɴ ʜᴇʀᴇ: 👆🏻
## Install Dependencies
- Install `node` and `yarn`
- Install `ts-node` as global command
- Confirm the solana wallet preparation: `/home/---/.config/solana/id.json` in test case## Usage
- Main script source for all functionality is here: `/cli/script.ts`
- Program account types are declared here: `/cli/types.ts`
- Idl to make the JS binding easy is here: `/cli/coinflip.ts`Able to test the script functions working in this way.
- Change commands properly in the main functions of the `script.ts` file to call the other functions
- Confirm the `ANCHOR_WALLET` environment variable of the `ts-node` script in `package.json`
- Run `yarn ts-node`# Features
## How to deploy this program?
First of all, you have to git clone in your PC.
In the folder `coinflip`, in the terminal
1. `yarn`2. `anchor build`
In the last sentence you can see:
```
To deploy this program:
$ solana program deploy /home/ubuntu/apollo/Kob-game-coinflip/coinflip/target/deploy/coinflip.so
The program address will default to this keypair (override with --program-id):
/home/ubuntu/apollo/Kob-game-coinflip/coinflip/target/deploy/coinflip-keypair.json
```
3. `solana-keygen pubkey /home/ubuntu/apollo/Kob-game-coinflip/coinflip/target/deploy/coinflip-keypair.json`
4. You can get the pubkey of the `program ID : ex."5N...x6k"`
5. Please add this pubkey to the lib.rs
`line 17: declare_id!("5N...x6k");`
6. Please add this pubkey to the Anchor.toml
`line 4: staking = "5N...x6k"`
7. Please add this pubkey to the types.ts
`line 6: export const STAKING_PROGRAM_ID = new PublicKey("5N...x6k");`
8. `anchor build` again
9. `solana program deploy /home/.../backend/target/deploy/staking.so`
Then, you can enjoy this program 🎭## How to use?
### A Project Owner
First of all, open the directory and `yarn`#### Initproject
```js
yarn ts-node initialize -e devnet -r https://api.devnet.solana.com -k /home/ubuntu/fury/deploy-keypair.json
```#### Update
```js
yarn ts-node update -a Am9xhPPVCfDZFDabcGgmQ8GTMdsbqEt1qVXbyhTxybAp -f 2.5 -e devnet -r https://api.devnet.solana.com -k /home/ubuntu/fury/deploy-keypair.json
```#### Withdraw
```js
yarn ts-node withdraw -a 2.5 -e devnet -r https://api.devnet.solana.com -k /home/ubuntu/fury/deploy-keypair.json
```