This repository holds all the smart contracts that are going to be used on the game Crypto Wars Please check the documentation for more details.
A portal just opened up and a medieval army emerged to shatter your world to almost nothing. Now it’s in your hands to rebuild your civilization - a new chance to reclaim what’s yours. Travel from realm to realm and rise from the ashes.
-
Install truffle and an ethereum client. For local development, try EthereumJS TestRPC.
npm install -g truffle npm install -g ethereumjs-testrpc # or ganache-cli truffle version # Truffle v4.1.7 (core: 4.1.7) # Solidity v0.4.23 (solc-js)
-
Install dependencies.
npm i # or yarn
-
Compile the contracts.
truffle compile
-
Run the tests.
npm run test
-
Compile the docs.
npm run doxity init npm run docs
-
Run test coverage.
npm run coverage
-
Run local testrpc.
npm run rpc
-
Migrate the contracts.
truffle migrate
9a. 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
9b. To run the web app with the PoA e11 (311) network.
- Console 1:
./script/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
-
./scripts/full-node.sh
# Console 1 -
geth attach http://localhost:8311
# Console 2personal.importRawKey("secret","password")
personal.unlockAccount("0xAddress", "password", 0)
-
truffle migrate --network=e11
# Console 3 -
Update contract addresses on
scripts/contracts.json
-
Copy
build/contracts
folder and paste it onsrc/assets/contracts
-
Duplicate the file
src/script/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
-
./scripts/full-node.sh
# Console 1 -
geth attach http://localhost:8311
# Console 2personal.importRawKey("secret","password")
personal.unlockAccount("0xAddress", "password", 0)
-
truffle exec ./scripts/send-testnet-tokens.js --network=e11
# Console 3