SmartContract Development with Node.js, Solidity, Truffle :
- mkdir zero2hero-solidity-lesson1 && cd zero2hero-solidity-lesson1
- npm init -y # creates Node.js project
- truffle init # creates Truffle project
- npm install --save-dev truffle
- npx truffle compile
- npm install --save-dev ganache-cli
- npx ganache-cli --deterministic
- npx truffle migrate --network development # --reset if needed
- npx truffle console --network development
- const lesson = await Lesson.deployed();
- await lesson.setLesson("Solidity")
- await lesson.getLesson()
- (await lesson.getLesson()).toString()
How to use OpenZeppelin Contracts
- npm install --save-dev @openzeppelin/contracts
Unit Tests
- Make sure you are running a local blockchain(Ganache)
- npm install --save-dev chai
- npx truffle test
Resources:
Unit Test - Moloch Testing Guide:
————
Rasim Sen - Blockchain Architect
zero2hero
WhatsApp: +447470914266
Meetup: zero2hero-training
YouTube: zero2hero.training
Twitter: zero2hero_uk
Facebook: zero2hero.training
Instagram: zero2hero.training
Email: info@zero2hero.training