Color Brain is decentralized application (dapp) powered by cartesi rollups technology.
How It Works: Derek selects a random color within a given array (red, green, blue, yellow). The user inputs their guess, and the game informs them whether their guess of Derek's choosen color, is correct or incorrect. The game can continue until the correct color is guessed.
Below you'll find instructions on how setting up this dapp locally.
Here are some packages you need to have installed on your PC:
-
npm install -g @cartesi/cli
- Clone this repo
git clone https://github.com/Joshaw-k/color_brain
- Install NPM packages
yarn install
- Build and run the dapp via
cartesi-cli
andcartesi build
cartesi run
- Make an advance request.
cartesi send generic
- Choose Foundry as the preferred chain.
❯ Foundry
Arbitrum Sepolia
Base Sepolia
OP Sepolia
Sepolia
Arbitrum One
Base
Ethereum
OP Mainnet
- Press Enter for the default RPC URL.
RPC URL http://127.0.0.1:8545
- Choose Mnemonic as the preferred wallet option.
❯ Mnemonic
Private Key
- Press Enter for the default Mnemonic phrase.
Mnemonic (test test test test test test test test test test test junk)
- Choose your preferred account.
❯ 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 9993.476291596530017783 ETH
0x70997970C51812dc3A010C7d01b50e0d17dc79C8 9899.778501376664201744 ETH
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC 10000 ETH
0x90F79bf6EB2c4f870365E785982E1f101E93b906 10000 ETH
0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 10000 ETH
0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc 10000 ETH
0x976EA74026E726554dB657fA54763abd0C3a0aa9 10000 ETH
0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 10000 ETH
0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f 10000 ETH
0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 10000 ETH
- Press Enter for the default Application address.
Application address (0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e)
- Choose String encoding as the preferred Input option.
❯ String encoding
Hex string encoding
ABI encoding
- Input your guess string.
Input (as string): red
- Check the running node in your terminal for the result.
validator-1 | color on derek's mind is green
validator-1 | color you choose is red
validator-1 | You didn't get into Derek's mind. Try harderrrrrr
We welcome contributions from the community! If you'd like to contribute to Color Brain, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
- Please ensure that your code adheres to the project's coding standards and includes appropriate tests.
Color Brain is released under the MIT License.
Color Brain is built on top of the Cartesi platform and utilizes various open-source libraries and tools. We would like to express our gratitude to the developers and contributors of these projects.