-
Install node 6LTS+ and truffle, install metamask in Chrome
-
Open a terminal and make a new directory
$ mkdir handson
-
Change to the newly created directory
$ cd handson
-
Download this project:
$ truffle unbox hidde-jan/lb-handson
-
Install needed depedencies
$ npm install
-
Starts the dummy ethereum blockchain
$ truffle develop
(If you want extra details, like the ethereum calls and transactions, you can start a separate terminal, then go to the same directory and run:)
$ truffle develop --log
-
In the truffle terminal, compile the included smart contracts
truffle(develop)> compile
-
Migrate the compiled contracts to the blockchain
truffle(develop)> migrate
-
Open a separate terminal window, go to the same directory (with
cd
) and start the web server:$ npm run dev
-
Open
localhost:3000
in Chrome. It should say "EtherCerts" at the top of the page. -
(Next steps follow intructions from Truffle's pet-shop tutorial which provides helpful images)
-
Configure metamask by clicking on the icon in the top right corner. Accept the terms and conditions. In the password screen, click "Import Existing DEN". Use the following seed phrase:
candy maple cake sugar pudding cream honey rich smooth crumble sweet treat
Enter any password of your liking.
- Next, click where it says 'Main network'. A dropdown appears. Click on "Custom RPC".
- Enter
http://localhost:9545
and click save. - Reload
http://localhost:3000
. At the top of the page, both "your address" and "contract address" should be filled.
- Try to issue a new certificate to yourself.
- Fill in your own name and the address from the top of the page.
- Click the 'Issue' button.
- Accept the transaction.
- Validate the newly issued certificate
- Copy the json of the certificate.
- Paste it into the field at the bottom of the page.
- Click 'Validate'.
- Change something and check if it is still valid.
- Edit your name in the validation field, or change your grade.
- Is it still valid?
- Revoke the certificate and check if it is still valid.
- Click the revoke button for the certificate.
- Accept the transaction.
- Did it work? Why not?
- Try to revoke it again, increase the gas.
- Does it work now?
- Check if the certificate is still valid.