SmartContract-Entwicklung mit Node.js, Solidity, Truffle :
- mkdir zero2hero-solidity-lesson1 && cd zero2hero-solidity-lesson1
- npm init -y # erstellt Node.js-Projekt
- truffle init # erstellt Truffle-Projekt
- npm install --save-dev truffle
- npx truffle compile
- npm install --save-dev ganache-cli
- npx ganache-cli --deterministic
- npx truffle migrate --network development # --reset falls nötig
- npx truffle console --network development
- const lesson = await Lesson.deployed();
- await lesson.setLesson("Solidity")
- await lesson.getLesson()
- (await lesson.getLesson()).toString()
Wie man OpenZeppelin Contracts verwendet
- npm install --save-dev @openzeppelin/contracts
Unit-Tests
- Stelle sicher, dass du eine lokale Blockchain (Ganache) betreibst
- npm install --save-dev chai
- npx truffle test
Ressourcen:
Unit-Test - Moloch-Testleitfaden:
————
Rasim Sen - Blockchain-Architekt
zero2hero
WhatsApp: +447470914266
Meetup: zero2hero-training
YouTube: zero2hero.training
Twitter: zero2hero_uk
Facebook: zero2hero.training
Instagram: zero2hero.training
E-Mail: info@zero2hero.training