Sample Ethereum Smart Contract to create your resume.
Follow the steps described here below to install, deploy and run the Dapp.
git clone https://github.com/sarbogast/ethereum-cv.git
$ cd ethereum-cv
$ npm install
Start testrpc or your private chain
Edit the file "truffle.js" and set the port number according your Ethereum node.
$ truffle compile
$ truffle migrate
Open the Metamask extension on Chrome and switch it to the address of your Ethereum node.
Import the accounts defined in your Ethereum node.
$ npm run dev
The experience of your resume can be added only by the owner of the smart contract. From Metamask, switch your account to the account used to deploy the contract.
From the Geth console, this account can be identified by running this command:
# eth.coinbase
From testrpc, the default account is the account[0]
From your browser, open the URL: http://localhost:8080
As the owner of the Smart Contract, add a new experience.
Metasmask will ask you to confirm the transaction.
If it's not already the case, start the mining process.
From the Geth console, start the following command:
# miner.start()`
From testrpc, the mining is already started.
When the block is mined, the experiences will be automatically displayed.
This step is empty to avoid 13 steps :-)
- Add an experience with an account that is not the contract's owner. The new experience should not be appended to the list.
- Switch to an account that is not the contract's owner and try to refresh the page. You should able to see all experiences.
- Display the events: ** Uncomment the div section from the index.html file ** Uncomment the code located into the listenToEvents function
- Is Metasmask slow ? try to disable and enable the extension.
- This behaviour happens sometimes mainly when we work with a private chain.
- when you switch the account from Metamask, don't forget to refresh the page of your application to ensure to get the current account set on Metamask.
Have fun !!!
ChainSkills Team - 2017