Tutorial Setup Hyperledger Explorer dengan fabric dan composer – vps AWS & Ubuntu 16.04
Assalamualaikum wbt.
Hyperledger explorer merupakan dashboard pemantauan transaksi block dalam block,bilangan peers / node,transaksi (tx) yang dintegrasikan dengan hyperledger fabric. Ini juga boleh dikonfigurasi bersama hyperledger composer. Step pemasangan adalah berbeza2 mengikut operating system yg kita guna , Biasa kita guna ubuntu 16.04 atau 18.04 (tidak stabil lagi) dan guna Mac. Jika menggunakan windows masih tidak stabil kerana isu security.
Berikut merupakan langkah pemasangan di cloud vps dengan OS Ubuntu 16.04.
Keperluan asas yang perlu ada :
- nodejs 6.9.x (Note that v7.x is not yet supported)
- mysql 5.7 or greater
- docker 17.06.2-ce [https://www.docker.com/community-edition]
- docker-compose 1.14.0 [https://docs.docker.com/compose/]
- fabric 1.2
Step 1:
git clone https://github.com/sakoula/blockchain-explorer.git
Step 2:
Install Mysql database (5,7)
sudo apt-get update
sudo apt-get install mysql-server
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
mysql -u root -p (login db)
create databases
fabricexplorer Step 3: Import Database mysql -u root -p < db/fabricexplorer.sql Step 4: Build Network - (Guna bfyn- fabric sample network) git clone -b master https://github.com/hyperledger/fabric-samples.git cd fabric-samplescurl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.1 1.2.1 0.4.10 Step 5.Integrate Hyperledger Explorer + fabric ubahsuai file config.json dan edit seperti yang di bawah: ** Perlu hati2 sebab kesilapan pada path dsb menyebabkan Hyperledger Explorer tidak memaparkan data. files config.json { "network-config": { "org1": { "name": "peerOrg1", "mspid": "Org1MSP", "peer1": { "requests": "grpcs://127.0.0.1:7051", "events": "grpcs://127.0.0.1:7053", "server-hostname": "peer0.org1.example.com", "tls_cacerts": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" }, "peer2": { "requests": "grpcs://127.0.0.1:8051", "events": "grpcs://127.0.0.1:8053", "server-hostname": "peer1.org1.example.com", "tls_cacerts": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" }, "admin": { "key": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore", "cert": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts" } }, "org2": { "name": "peerOrg2", "mspid": "Org2MSP", "peer1": { "requests": "grpcs://127.0.0.1:9051", "events": "grpcs://127.0.0.1:9053", "server-hostname": "peer0.org2.example.com", "tls_cacerts": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" }, "peer2": { "requests": "grpcs://127.0.0.1:10051", "events": "grpcs://127.0.0.1:10053", "server-hostname": "peer1.org2.example.com", "tls_cacerts": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" }, "admin": { "key": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore", "cert": "/home/playground/fabric-samples/first-network/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts" } } }, "host":"localhost", "port":"8080", "channel": "mychannel", "GOPATH":"../artifacts", "keyValueStore":"/tmp/fabric-client-kvs", "eventWaitTime":"30000", "mysql":{ "host":"127.0.0.1", "port":"3306", "database":"fabricexplorer", "username":"root", "passwd":"root" } } Step 6.Run Hyperledger fabric Samples cd fabric-samples/first-network/ ./byfn.sh -m generate ./byfn.sh -m up
Step 7.Run Hyperledger Explorer
node main.js
./start.sh
Step 8.Akses ke localhost:8080
Jika anda membuat transaksi seperti verify, submission data ke blockchain network, paparan block,transaksi akan dapat dilihat disini.
Sekian untuk perkongsian
Terima Kasih.
Recent Comments