This code is open, but not open source. It is not licensed, which means you cannot use it freely for your own applications. You cannot "base your code on CryptoBlades", nor use our code for anything. At all. This is not permissible under our license terms (which do not exist).
99999999
(or some other high number so you can deploy).You should now have 100 fake eth! You're now fake rich.
npm install
mv .env.local .env
(copy the example env to your local so it can be used)npm run contract:prepare
(this builds your contracts)npm run contract:deploy
(this deploys your contracts to your local blockchain)npm run start:frontend
For Windows developers experiencing errors follow these steps:
rm -r build
npm run contract:prepare
(this builds your contracts)rm -r build/contracts
npm run contract:deploy
npm run start:frontend
If you're using VSCode, we recommend these extensions: Auto Rename Tag, EditorConfig for VSCode, Eslint, Github Pull Requests, Gitlens, Javascript and Typescript, Live Share, Solidity, Typescript Hero, Vetur
There are optional environment variables, most of which have sensible defaults if copied from .env.local
:
VUE_APP_API_URL
- the API URL to use - defaults to prod (which will throw CORS errors on local)contracts
contains the solidity contracts for the gamefrontend
contains the Vue code for the frontendmigrations
contains migration filestest
contains testsnpm run start:frontend
- start up a server for the Vue frontendnpm run lint
- run lint checking for all modulesnpm run contract:prepare
- extract the ABI and re-compile Truffle contractsnpm run contract:deploy
- deploy the Truffle contracts for testingnpm run test:local
- run tests via hardhat, careful, this is not using migrations but rather fixtures which should be kept up to date (/test/helpers/prepareContracts.js
)- rm -rf build/
To run tests locally simply run
npm run test:local
NOTE: Careful, this is not using migrations but rather fixtures which should be kept up to date (
/test/helpers/prepareContracts.js
)
cd frontend
- navigate to frontend foldernpm run setup-app-config
-Initial setup of app-config.json fileThis repository uses Truffle, but if for some reason, you'd prefer using hardhat for development, with an ephemeral local blockchain, you can do so too:
Turn on the Hardhat node:
npx hardhat node
Generate Hardhat artifacts:
npx hardhat compile
Deploy to the Hardhat node:
export ETH_DEV_RPC_PORT=8545 && npm run deploy --reset
Run the frontend pointing to hardhat:
export VUE_APP_NETWORK_ID=31337 && npm run start:frontend
If you get any issues during deployment, run:
truffle compile --all
{{$t('keyName')}}
i18n.t('keyName')
{{$t('keyName', someValue)}}
and use it in en.json:
"keyName": "This is {someValue} !"
<p v-html="$t('keyName'})"></p>
with "keyName": "This is <b>bold</b>"