A simple business card smart contract example (impressed by samples from Ethereum Development Course - Blockchain at Berkeley)
- download and install Node.js
npm updatenpm install -g trufflenpm install -g ganache-cli- download and install Git for Windows (optional - to use Git Bash)
mkdir cardAppcd cardAppmkdir cardcd cardtruffle init- copy files from this repo to corresponding subfolders of a card folder
ganache-cli(cmd window)truffle compile(now you need to switch to Git Bash)truffle migratetruffle consoleCard.addressvar card = Card.at(Card.address)cardcard.getCard();
npm install -g create-react-appcreate-react app cardUI- replace config.json with a file from this repo
cd cardUInpm installnpm start(you will see an app page in a browser at localhost:3000)- copy files from this repo to corresponding subfolders of a cardUI folder
- for updating EthereumSetup.js file you'll need a contract address (copy output of
card.addresscomand from truffle console) and ABI (copy output fromJSON.stringify(card.abi)from truffle console) - save project - page in a browser will refreshed. At this point you must see some contact information on that page
- if you want to use plain 'vanilla' JavaScript, navigate to localhost:3000/test.html (youll need to copy contract address and ABI from EthereumSetup.js to this file to get it to work)