Crypto bets game (Alchemy project).
To test it clon this repo in your drive and follow next steps.
Open a terminal and run hardhat local node
> cd ./smartcontract
> npm install
> npx hardhat node
1. Open a new terminal
> cd ./smartcontract
2. Run command:
> npx hardhat run scripts/deploy.js --network localhost
2. Change "dot_env (exmple).txt" to ".env"
3. Fulfill parameters
4. Run command:
> npx hardhat run scripts/deploy.js --network goerli
Important:
- Copy deploymet address and paste it in ./web/src/utils/constant.js
Open a new terminal and go to web directory
> cd ./web
> npm install
> npm start
Open a new terminal or do it over the one used to deploy the smartcontract for local test change GOERLY constant in App.js to false;
> cd ./smartcontract
> npx hardhat test test/bets.js --network localhost
> cd ./smartcontract
> npx hardhat run test/bets2.js --network localhost
- Recompiling smartcontract can affect JSON abi, if so, copy "/smartcontract/artifacts/contracts/Bets.sol/bets.json" to "/web/src/utils/bets.json"
- Redeploying smartcontract will affect deployment address, if so, copy smartcontact deployment address on ./web/src/utils/constant.js