This repository holds all the smart contracts that are going to be used on the game Crypto Wars.
-
Install truffle and an ethereum client. For local development, try EthereumJS TestRPC.
npm install -g truffle npm install -g ganache-cli truffle version # Truffle v4.1.11 (core: 4.1.11) # Solidity v0.4.24 (solc-js)
-
Install dependencies.
npm i # or yarn
-
Compile the contracts.
truffle compile
-
Run the tests.
npm run test
-
Run test coverage.
npm run coverage
-
Run local testrpc.
npm run rpc
-
Migrate the contracts.
truffle migrate
-
a. Run the web app locally.
npm run start # to use your local RPC network # Open http://localhost:4200 on your favorite web3 browser # Remember to switch your network on Metamask to localhost 8545
-
b. To run the web app with the PoA e11 (311) network.
- Console 1:
./scripts/full-node.sh # this will create a local full node of the e11 Proof of Authority chain (311)
- Console 2:
npm run start:poa # this will start the angular server with the PoA environment. # Remember to switch your network on Metamask to http://localhost:8311
Lastly open http://localhost:4200 and on Metamask connect to http://localhost:8311
truffle migrate --network=e11
-
Duplicate the file
src/scripts/contributors.sample.json
and name itcontributors.json
- Add all the accounts you want to send to
- Set the amount of ether and e11 you want to send
-
truffle exec ./scripts/send-testnet-tokens.js --network=e11
NOTE: This project is still a WIP, we encourage you to create a Pull Request and to participate in the ongoing discussions here.