#53 [Intermediate] Raw JavaScript Smart Contracts Testing & Continuation of #50
Details
It is far easier and safer to develop smart contracts while building the test before/during the development.
The main testing framework used for Solidity testing is truffles with ganache, with a smaller group of people using https://dapp.tools/ (see https://www.meetup.com/BokkyPooBahs-Ethereum-Workshop/events/250157264/).
In today's session, we will be building our own testing framework using bash scripts, geth and JavaScript. MarkPooBah will be impressed with my JavaScript-jockeying. OK, maybe not.
Some of the advantages of building your own framework are:
• You force yourself to understand how smart contracts and transactions work with the actual blockchain software, not a JavaScript simulator blockchain
• You won't get caught up in the version upgrade differences in truffles, ganache and the Solidity compiler
• You can avoid the npm dependency hell
Some of the disadvantages of building your own framework are:
• Most other developers will not understand your testing framework
• There are tedious little details you have to code for yourself
We will walk through building our testing framework, including:
• Creating some bash scripts (works on Linux and OS/X, and on Windows with some additional tools)
• Using the command line Solidity compiler to generate the Application Binary Interface and bytecode
• Deploying smart contracts
• Submitting transactions and reading results
Bring your laptop along, as you should follow through the exercises. The exercises will be documented in https://github.com/bokkypoobah/BokkyPooBahsEthereumWorkshop/wiki/Workshop-%2353-Raw-JavaScript-Smart-Contracts-Testing as we go along.
Before attending the workshop, download the binaries for `geth` from https://github.com/ethereum/go-ethereum/releases . You won't need a synced mainnet or testnet chain as we will use the local `--dev` blockchain.
See https://github.com/bokkypoobah/BokkyPooBahsEthereumWorkshop/wiki/Workshop-%2350-Back-To-The-Basics for some of the exercises.
References:
• http://remix.ethereum.org
• https://tiswww.case.edu/php/chet/bash/bashref.html
• https://github.com/bokkypoobah/BokkyPooBahsEthereumWorkshop/wiki/Workshop-%2331-%5BIntroduction%5D-Blockchains-&-Crypto-Safety,-And-Smart-Contracts-%231
• https://ethereum.stackexchange.com/
• https://consensys.github.io/smart-contract-best-practices/
• https://github.com/ethereum/wiki/wiki/JavaScript-API
• https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
---
Ropsten Testnet Ethers:
• You can transfer Ropsten Testnet ethers (RtETH) from my account 0xD8C2eEe8D6a390932Ca4fdC46aaE38a8056FeA4f (https://ropsten.etherscan.io/address/0xD8C2eEe8D6a390932Ca4fdC46aaE38a8056FeA4f) using the private key `a19f68b6a1e08d7984b727451bf81991d6ae85c60310ca10e5b9a7a6a1ccb355` to unlock my account and transfer a few RtETH into your own Ropsten account
• Alternatively, use that bitfwd's faucet - https://faucet.bitfwd.xyz/
•• Don't mix up your Testnet account with your Mainnet account
Housekeeping:
• Meet 10 minutes before the start at 16:50, in the lobby of 155 Clarence Street, Sydney
• If arriving later, please ping the BokkyPooBah's Ethereum Workshop Chat (https://t.me/joinchat/Ep-XOkwa_uns--L08HhRTw) group and someone will come down to get you
• Bring your laptop along as we go through exercises
• Bring your hardware wallet (Ledger Nano S or Trezor) just in case you need to use it
• There will be some refreshments. Donations to cover expenses: $30 (those who can afford it), $20 (those who can almost afford it), $0 (those who really cannot afford it).
• The topic details for these workshops can change up to the last minute
• If you have successfully RSVPed or are on the waitlist, please review your RSVP status and cancel your RSVP/waitlist ASAP if you cannot make it to free up the spot for other people
• People from Tyro do not have to RSVP
• This workshop will be repeated to cater for the demand
