Learn how to build Dapps using: Open source tools (Truffle, IPFS, Lightwallet and BTC Relay), ConsenSys tools (BlockApps API and Microsoft Azure BlockApps nodes) and other ConsenSys tools (MetaMask, a Chrome Ethereum plugin, or uPort, an ID management system).
Eva Shon & Igor Lilic, ConsenSys
9. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP (using Web3.js)
Key
Smart Contract
nonce = 0
1 2 3
nonces prevent pushing
duplicate transactions and
increase for the lifetime of a key
DAPP pushes
compiled contract
to network
Compiled binary + ABI
10. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP (using Web3.js)
Key
nonce = 0
DAPP pushes
compiled contract
to network
Compiled binary + ABISmart Contract
After Contract
posted to
blockchain
returns
Address
Address added to ABI
1 2 3
4
11. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP (using Web3.js)
Key
Smart Contract
After Contract
posted to
blockchain
returns
Address
1 2 3
4
Contract Creation Transaction
Address added to ABI
nonce = 0
DAPP pushes
compiled contract
to network
Compiled binary + ABI
12. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP (using Web3.js)
Key
nonce = 1
Key
Frontend can
now make calls to
contract on blockchain:
Address + ABI + nonce
nonce = 0
DAPP pushes
compiled contract
to network
Smart Contract
1 2 3
After Contract
posted to
blockchain
returns
Address
4 5
Regular Transactions with Smart
Contracts on Blockchain
(Ether transfer or Function calls)
Compiled binary + ABI Address added to ABI
13. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP
Key
nonce = 1
Key
Frontend can
now make calls to
contract on blockchain:
Address + ABI + nonce
nonce = 0
DAPP pushes
compiled contract to
network
Compiled binarySmart Contract Address + ABI
1 2 3
After Contract
posted to
blockchain
returns
Address + ABI
4 5
… is a command-line tool to help you
compile, deploy, link and test
smart contracts
… and build a front-end
14. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP
Key
nonce = 1
Key
Frontend can
now make calls to
contract on blockchain:
Address + ABI + nonce
nonce = 0
DAPP pushes
compiled contract to
network
Compiled binarySmart Contract Address + ABI
1 2 3
After Contract
posted to
blockchain
returns
Address + ABI
4 5
… is a command-line tool to help you
compile, deploy, link and test
smart contracts
… and build a front-end JavaScript, SASS, ES6 and JSX
Mocha and Chai
15. truffle.readthedocs.iotruffle.readthedocs.io
Ethereum Node
Ethereum / or Private Network
Solidity Compiler
DAPP
Key Key
Smart Contract
Keystore
Transactions can be
signed in the Ethereum
Node by Web3.js, or
signed in the front-end
and pushed to the node
as a “raw transaction”
(our next topic… :)
All Transactions* must be signed
with keys and require gas
* any changes to state (writes, etc.)
Compiled binary + ABI Address added to ABI
20. truffle.readthedocs.iotruffle.readthedocs.io
Compile smart contracts (do you have solc installed?)
$ truffle compile
Deploy smart contract to blockchain
Run an Ethereum node (like testrpc)
$ truffle deploy
Run truffle tests from test/ directory
$ truffle test
Run a server from localhost
$ truffle serve
25. github.com/ConsenSys/eth-lightwallet
Lightwallet Features
HD Wallet
- 12 word seed generates HD tree of addresses
- Private key encrypted in browser (+ Password)
- Lost private key? Can regenerate with 12 word seed
External transactions
- Transactions not signed by an Ethereum client
- For example using github.com/ConsenSys/hooked-web3-provider