Before deploying the contract or starting the GUI, start ganache or ganache-cli with the commands:
ganache-cli -p 7545 -h 0.0.0.0 -l 100000000000 -i 1337 --accounts 10 -e 10000 --seed 69420A brief description of the command:
-pport-hbind address--dbspecify a folder where to store all the transactions, otherwise they won't be saved-lset the block gas limit-inetwork id--accountsthe number of accounts to create-estarting eth balance of each account--seedspecify the seed to generate the same private key each time
Then connect the ganache network to your Metamask account.
However, it is recommended to use the provided docker image to run the project (see (this section)[#docker])
Inside the client folder you can find the code of the GUI.
To run the GUI:
cd client
npm startYou can create a .env file containing your custom ganache instance (defaults to ws://127.0.0.1 if not specified):
# inside client/.env
REACT_APP_CHAIN_URL='ws(s)://you_chain_url:port'Inside truffle, instead, you can find the code to deploy the smart contract. To deploy the contract:
cd truffle
./compile.shYou can create a .env file containing your custom ganache instance (defaults to ws://127.0.0.1 if not specified):
# inside truffle/.env
REACT_APP_CHAIN_URL='ws(s)://you_chain_url:port'To start the project with docker, edit the .env file inside the root of the project:
export CLIENT_ENV=developmentHere's a recap of all the .env files you can setup (it is not mandatory, the defaults values are enough to start the app locally):
BingoEth/
├── client/
│ └── .env <- REACT_APP_CHAIN_URL='...'
├── truffle/
│ └── .env <- CHIAN='...'
└── .env <- export CLIENT_ENV=...Finally:
docker compose upNow you can access the app at http://localhost:3000 (development) or http://localhost:80 (production).