-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Blockchain Bingo to Ecosystem Showcase #3888
base: master
Are you sure you want to change the base?
Conversation
Dear @dickhery, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA. If you decide to agree with it, please visit this issue and read the instructions there. Once you have signed it, re-trigger the workflow on this PR to see if your code can be merged. — The DFINITY Foundation |
I, dickhery, hereby agree to the DFINITY Foundation's CLA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea if I'm doing this right but what's the worst thing that could happen right?
🎉 Bingo on the Internet Computer 🎉
Welcome to Blockchain Bingo – an exciting decentralized Bingo game built on the Internet Computer Protocol (ICP)! Dive into a fair, transparent, and engaging gaming experience where you can play against users from around the world directly on the blockchain. Whether you're aiming for a Standard win or going for a complete Blackout, our platform ensures a seamless and fun experience for all players.
📖 Table of Contents
Description
Blockchain Bingo is a decentralized application (dApp) that brings the classic game of Bingo to the blockchain. Leveraging the power of the Internet Computer, Bingo offers a secure and transparent platform where players can generate unique Bingo cards, participate in real-time games, and experience the thrill of winning without any centralized authority.
🎲 How It Works
How to Play
Features
Game Types
Blockchain Bingo offers two exciting game types: Standard and Blackout. Each game type provides a unique Bingo experience tailored to different player preferences.
Standard Bingo:
Blackout Bingo:
What is ICP?
The Internet Computer Protocol (ICP) is a revolutionary blockchain technology that enables the creation of decentralized applications (dApps) with enhanced scalability, speed, and security. By leveraging ICP, Blockchain Bingo operates seamlessly on-chain, ensuring transparent game mechanics, secure transactions, and a trustless environment where players can enjoy Bingo without intermediaries.
User Guides
🔑 Creating or Changing Your Username
Navigate to the Chat Room within any game and click on the Create Username or Change Username button. Follow the prompts to set or update your display name, enhancing your interaction within the community.
🎮 Hosting a Game
Hosting your own Bingo game is simple and rewarding. Follow these steps to set up a game that attracts players and offers enticing rewards:
By hosting a game, you not only create an engaging experience for players but also earn a share of the prize pool, making it a rewarding endeavor.
💸 Financial Breakdown Example
This ensures that both the host and the platform are fairly compensated while providing a substantial prize for the winner.
🔒 Creating Private Games
To create a private game, add a password during the game setup process in the Host Bingo screen. This password will be required for players to join the game, ensuring that only invited or authorized participants can register and play.
Financial Breakdown
Understanding how funds are managed within Blockchain Bingo ensures transparency and trust. Here's a detailed breakdown of the financial aspects:
Additional ICP Fees:
Service Fee:
Host Percentage:
Prize Pool Allocation:
Claiming Winnings:
Installation
🛠️ Prerequisites
Before you begin, ensure you have met the following requirements:
💿 Clone the Repository
git clone https://github.com/yourusername/bingo.git cd bingo
📦 Install Backend Dependencies
Navigate to the root directory and install the necessary dependencies.
📦 Install Frontend Dependencies
Deployment
Deploying to the Internet Computer
Follow these steps to deploy Blockchain Bingo to the Internet Computer:
Start the DFX Replica:
Start the DFX local replica in the background.
Deploy the Canisters:
Deploy both backend and frontend canisters.
Generate Frontend Declarations:
After deployment, generate the frontend declarations to ensure the frontend has the latest interface.
Update Environment Variables:
Ensure that your
.env
file has the correct canister IDs as per the deployment.Deploy to the IC Network:
To deploy to the Internet Computer mainnet or a specific network, adjust your
dfx.json
and use the appropriate network flags.Access the Application:
Once deployed, your application will be available at:
Replace
your-canister-id
with your actual frontend canister ID fromcanister_ids.json
.Running Locally
If you want to test your project locally, follow these steps:
Start the Replica:
Deploy the Canisters:
Generate Frontend Declarations:
Start the Frontend Development Server:
Navigate to the frontend directory and start the development server.
cd src/bingo_frontend npm run dev
The frontend will be available at
http://localhost:3000
and proxy API requests to the replica at port 4943.Frontend Environment Variables
When hosting the frontend outside of DFX, ensure that the application does not fetch the root key in production. You may need to adjust environment variables accordingly:
DFX_NETWORK
toic
if you are using a bundler like Webpack.process.env.DFX_NETWORK
in the autogenerated declarations.dfx.json
by settingcanisters -> {asset_canister_id} -> declarations -> env_override
to replaceprocess.env.DFX_NETWORK
with a string.createActor
constructor as needed.Dependencies
Backend Dependencies
Ensure that the backend canister has the following dependencies installed:
Frontend Dependencies
The frontend relies on the following dependencies:
Development Dependencies
Ensure all dependencies are installed by running
npm install
in both the root and frontend directories as outlined in the Installation section.Geolocation API
🌐 Blockchain Bingo relies on an IP location API for geolocation to enforce geoblocking, ensuring compliance with regional regulations. The application is configured to work with the current setup, providing a seamless experience while maintaining necessary access restrictions.
Re-deployment Policy
You're welcome to re-deploy Blockchain Bingo as long as you adhere to the following conditions:
Feel free to customize and enhance the project to suit your needs, making it a great starting point for your own Internet Computer Protocol (ICP) Motoko projects.
For Developers
Blockchain Bingo serves as an excellent example for developers looking to build their own ICP-based dApps. Explore the project's structure, smart contract logic, and frontend integration to gain insights and inspiration for your endeavors.
Contact Page
Blockchain Bingo includes an integrated Contact Page where users can leave messages or feedback. These messages are accessible to admins through the authorized Principal ID in the
MenuScreen.jsx
file. If you have any questions, suggestions, or need support, feel free to reach out via the contact section within the app.Credits
This Bingo game was inspired and partially created by RichardHery.com. Special thanks to the Internet Computer development community for their support and resources. IP address data powered by IPinfo
License
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to reach out or contribute to the project! Let's make decentralized Bingo even more fun and engaging together.