An overview of what blockchain is, how the Ethereum blockchain works, and how you can deploy and interact with smart contracts on Ethereum, all from within the JVM, thanks to web3j.
6. Ethereum
• The world computer
• Turing-complete virtual machine
• Public blockchain (mainnet & testnet)
7. Ether
• The fuel of the Ethereum blockchain
• Pay miners to process transactions
• Market capitalisation ~$1bn USD (Bitcoin ~$10bn)
• Associated with an address + wallet file
0x19e03255f667bdfd50a32722df860b1eeaf4d635
8. Obtaining Ether
• Buy it
• Find someone
• Kraken
• BTC Markets
• Mine it
• mainnet => requires dedicated GPUs
• testnet => quick using your CPU
• Refer to Geth/Parity mining docs
9. Smart Contracts
• Computerised contract
• Code + data that lives on the blockchain at an
address
• Transactions call functions => state transition
25. Ethereum Smart Contracts
• Usually written in Solidity
• Statically typed high level language
• Compiled to Ethereum Virtual Machine (EVM) byte
code
• Create Java wrappers with web3j
26. Greeter.sol
contract mortal {
address owner;
function mortal() { owner = msg.sender; }
function kill() { if (msg.sender == owner) suicide(owner); }
}
contract greeter is mortal {
string greeting;
// constructor
function greeter(string _greeting) public {
greeting = _greeting;
}
// getter
function greet() constant returns (string) {
return greeting;
}
}