Linux Foundation Hyperledger Fabric hyperledger composer playground hyperledger composer playground tutorial
# application schema
Business Application -> Hyperledger Composer -> Blockchain ( Hyperledger Fabric)
user app to communicate with Ethereum
- Metamask ( chrome extension )
- Mist browser
Rinkeby ethereum account charger Rinkeby ethereum charger
- external ( user account, common for all networks )
- internal ( contract account, specific for each network )
balance
storage - data storage
code - compiled machine code
- NodeJS ( min version 8.0.1 )
# ganache-cli
const Web3 = require('web3')
const web3 = new Web3("http://localhost:8545")
console.log(web3.eth.getAccounts().then(e=>console.log(e)))
http://solidity.readthedocs.io/en/latest/
- create project
npm init
npm install -save solc
- contract creation ( solidity compiler )
- local testing ( Mocha framework )
# npm install mocha ganache-cli web3@1.0.0-beta.26
npm install mocha ganache-cli web3
- deployment ( script )
truffle
code examples references source code of the smart contracts
Open the package installation manager in atom and search for 'language-ethereum'. After installing the package, you might have to manually change the highlighter in the .sol file. Look for the selector at the bottom right of your editor window.
- fixed array
uint[5] exampleOfFixedArray;
- dynamic array
string[] public exampleOfDynamicPublicArray;
- public/private ( default - public )
- view/constant ( return field, return constant)
- pure ( don't use any contract-variables to manipulate, 'pure' functions )
- payable
- eccak256
built in, which is a version of SHA3. A hash function basically maps an input string into a random 256-bit hexidecimal number.
example:
//b1f078126895a1424524de5321b339ab00408010b7cf0e6ed451514981e58aa9
keccak256("aaaac");