-
Notifications
You must be signed in to change notification settings - Fork 6
For developers: launching the application
git clone https://github.com/Mycelium-Lab/FairFight
Switch terminal directory to evm
cd PATH/TO/FairFight/evm
Create .env
file and add your PRIVATE_KEY
(PRIVATE_KEY_EMERALD
can be the same)
PRIVATE_KEY=""
PRIVATE_KEY_EMERALD=""
Install dependencies
npm install
Run local blockchain
npx hardhat node
In the different terminal deploy smart contracts in this sequences so that the address of contracts on the test network does not have to be changed
npx hardhat run scripts/FairFight/deployWithTestToken.js --network testnet
npx hardhat run scripts/FairFight/mintTestToken.js --network testnet
npx hardhat run scripts/FairFight/NFT/deployTest.js --network testnet
npx hardhat run scripts/Lootbox/deployTest.js --network testnet
Create database in PostgreSQL and fill it with data from the file tables.sql
in psql terminal.
\i PATH/TO/FairFight/tables.sql
Run redis-server
On Linux
sudo systemctl start redis
Create .env
file in the base directory with this data
DB
from your PostgreSQL, PRIVATE_KEY_EMERALD
and PRIVATE_KEY_TEST
can be the same as PRIVATE_KEY
DB=""
DB_USER=""
DB_PASSWORD=""
REDIS_HOST=""
REDIS_PORT=""
PRIVATE_KEY=""
PRIVATE_KEY_EMERALD=""
PRIVATE_KEY_TEST=""
Install dependencies in base directory
npm install
Run server
- Development
npm run dev:se
In the different terminal
npm run dev:si
- Production
Install pm2
npm install pm2 -g
Run game
npm run prod
GAME IS STARTED ON http://localhost:5000/?network=31337 (network=31337 means local hardhat node)
If your changing JS files in lib
directory except for /lib/game
than you should launch webpack
Go to lib
directory
Install dependencies
npm install
Run webpack in watch mode
npm run watch
or just build
npm run build