Blockchain: Difference between revisions

From UNamur InfoSec
Jump to navigation Jump to search
No edit summary
No edit summary
Line 65: Line 65:
Demo:<br>
Demo:<br>
https://www.youtube.com/watch?v=lULuJt8Crdo<br>
https://www.youtube.com/watch?v=lULuJt8Crdo<br>
== Get Bitcoin Blocks & Transactions ==
#!/bin/bash <br>
for block_id in {220000..220001}<br>
do<br>
blockHash=`bitcoin-cli getblockhash $block_id`<br>
echo "Block $block_id: $blockHash" >> blockHash.txt<br>
echo "Block $block_id: $blockHash" >> txn.txt<br>
echo "`bitcoin-cli getblock $blockHash`" >>txn.txt<br>
echo "" >> txn.txt<br>
done<br>
exit 0<br><br>


== HyperLedger ==
== HyperLedger ==

Revision as of 11:05, 19 February 2018

Blockchain and Smart Contract State of the art

Download: https://goo.gl/UyEDi7

Useful link to learn and install Bitcoin Blockchain

https://bitcore.io/guides/fullnode
https://en.bitcoin.it/wiki/Main_Page
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md
https://dev.visucore.com/bitcoin/doxygen/
https://github.com/bitcoin-blockexplorer/insight_ui
https://github.com/bitpay/insight

Ethereum Blockchain and Smart Contract

Development Environment
Virtual Box
Install Ubuntu 16.04.3 (64bits)
Curl: sudo apt-get install curl
Npm: sudo apt-get install -y npm
Nvm:
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
nvm ls-remote
nvm install 8.5.0
nvm use 8.5.0
node -v
Chrome
Wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Sudo dpkg -i google-chrome-stable_current_amd6.deb
Sudo apt-get -fy install
Atom IDE
Download from atom.io
Sudo apt-get install -f
Sudo dpkg -i atom-amd64.deb
Apm install language-ethereum
Metamask Chrome Plug-in: Search in google and add to chrome
Ethereum
Sudo apt-get install software-properties-common
Sudo add-apt-repository -y ppa:ethereum/ethereum
Sudo apt-get update
Sudo apt-get install -y ethereum
Truffle
Npm init -y -> package.json
Npm install -g truffle
Npm install -g ethereumjs-testrpc
Not support OS Ubuntu (fsevents 1.1.2)
Require OS: Arch or Darwin

Build Smart Contract
PET SHOP
npm install -g truffle
npm install -g ethereumjs-testrpc
truffle unbox pet-shop
truffle compile
Testrpc -p 8545
Geth attach http://127.0.0.1:8545
truffle migrate
npm run dev

Ref:
http://truffleframework.com/docs/getting_started/installation
http://truffleframework.com/boxes/
http://truffleframework.com/tutorials/pet-shop

Demo:
https://www.youtube.com/watch?v=lULuJt8Crdo

Get Bitcoin Blocks & Transactions

  1. !/bin/bash

for block_id in {220000..220001}
do
blockHash=`bitcoin-cli getblockhash $block_id`
echo "Block $block_id: $blockHash" >> blockHash.txt
echo "Block $block_id: $blockHash" >> txn.txt
echo "`bitcoin-cli getblock $blockHash`" >>txn.txt
echo "" >> txn.txt
done
exit 0


HyperLedger

https://hyperledger.github.io/composer/

Internet of Things

https://nodered.org/