/color_brain

Primary LanguageJavaScript


Color Brain

The Color Brain dapp documentation.

About

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.

Getting Started

Below you'll find instructions on how setting up this dapp locally.

Prerequisites

Here are some packages you need to have installed on your PC:

Installation

  1. Clone this repo
    git clone https://github.com/Joshaw-k/color_brain
  2. Install NPM packages
    yarn install
  3. Build and run the dapp via cartesi-cli
    cartesi build
    and
    cartesi run

(back to top)

Usage

  1. Make an advance request.
   cartesi send generic
  1. Choose Foundry as the preferred chain.
❯ Foundry
  Arbitrum Sepolia
  Base Sepolia
  OP Sepolia
  Sepolia
  Arbitrum One
  Base
  Ethereum
  OP Mainnet
  1. Press Enter for the default RPC URL.
RPC URL http://127.0.0.1:8545
  1. Choose Mnemonic as the preferred wallet option.
❯ Mnemonic
  Private Key
  1. Press Enter for the default Mnemonic phrase.
Mnemonic (test test test test test test test test test test test junk)
  1. 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
  1. Press Enter for the default Application address.
Application address (0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e)
  1. Choose String encoding as the preferred Input option.
❯ String encoding
  Hex string encoding
  ABI encoding
  1. Input your guess string.
Input (as string): red
  1. 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

(back to top)

Contributing

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.

License

Color Brain is released under the MIT License.

Acknowledgments

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.