Build solidity with Angular front end, metamask and INFURA, using web3 on Rinkedby Test net
- This is demo how to build an contract by solidity on ethereum renkedby Test net.
- User Chome and install MetaMask on Chrome Web Store, resgister account and choose RinkedbyTestNet.
- Register InFura account to get the link (will use in RunStep).
- Open Window PowerSell on Win 10 (if you have not it, you can modify directly
process.env.PASSWORD
andprocess.env.INFURA_LINK
in file deploy.js inside src/app/ethereum folder ) and go to root project. - Run
npm install
first to install all dependences. - Run
$env:PASSWORD="your_password"
and run$env:INFURA_LINK="your_link_inifura"
- (You can ignore this step to run contract I deployed. Or you can deploy yourself by use this step ) Then run
npm run build-eth
, wait until Deploy completed!!!! And clickCtrl+C
many times to stop process. - Then run
ng serve --open
to open your angular front-end web app.
- After the project run on
localhost:4200
you will see some data gotten from server - Then you can choose candidate and click vote button. Then you will see the metamask Popup, click submit
- Wait a moment and see data will reload with vote increase 1.
- Click on metamask icon on chrome and you will see history or something like this.
- Enjoy.
You can only compile or build contract by following command:
- Run
npm run compile-eth
to Compile Contract. - Run
npm run deploy-eth
to Deploy our Contract. - Run
npm run build-eth
to Compile and Deploy our Contract. - Run
ng build
to build the project. The build artifacts will be stored in thedist/
directory. Use the--prod
flag for a production build.
- Internet
- Angular.io