天天看點

Hyperledger Fabric Chaincode 開發本文節選自《Netkiller Blockchain 手劄》Netkiller Blockchain 手劄

中國廣東省深圳市龍華新區民治街道溪山美地

518131

+86 13113668890

文檔始創于2014-06-23

版權 © 2018 Netkiller(Neo Chan). All rights reserved.

版權聲明

轉載請與作者聯系,轉載時請務必标明文章原始出處和作者資訊及本聲明。

<a href="http://creativecommons.org/licenses/by/3.0/" target="_top"></a>

<a href="http://www.netkiller.cn/" target="_top">http://www.netkiller.cn</a>

<a href="http://netkiller.github.io/" target="_top">http://netkiller.github.io</a>

<a href="http://netkiller.sourceforge.net/" target="_top">http://netkiller.sourceforge.net</a>

<a href="http://172.16.0.1/images/weixin.jpg" target="_top"></a>

微信訂閱号 netkiller-ebook (微信掃描二維碼)

QQ:13721218 請注明“讀者”

QQ群:128659835 請注明“讀者”

目錄

6.1. 開發環境

6.2. chaincode 代碼

6.3. 啟動容器部署chaincode

6.4. 測試

chaincode 目錄是開發目錄

清理鏡像和容器

安裝所需鏡像

進入容器

編譯并部署chaincode

進入 chaincode 容器啟動 chaincode 程式。

CORE_CHAINCODE_ID_NAME=chaincode_example02:1.0 記住這裡的配置,下面會用到

進入 cli 容器

檢視 a,b 兩個賬号的餘額

a 向 b 轉賬 50

這是再檢視 a, b 兩個掌控的餘額應該是 a: 50 , B: 250

chaincode 終端也會顯示下面内容。