-
Prerequisites
Please follow the instructions in this page and install all the tool
-
Clone the repo
cd into the test-network directory inside fabric-sample
-
Bring up test network, added the -ca flag to use the CA
./network.sh up createChannel -c mychannel -ca
-
Deploy the smart contract basic
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go
-
Run application
cd into asset-transfer-basic/application-gateway-go
go run .
-
Get Transaction Detail
cd back to the test-network directory
run
./network.sh getBlock -num <newest|oldest|config|(number)>
see the block detail in block folder
-
Clean up
./network.sh down
# To use cryptogen to create organization artifacts, delete the -ca flag
./network.sh up createChannel -c mychannel
# To use user instead of admin to invoke the chaincode
change the 'Admin' in certPath and keyPath of the file asset-transfer-basic/application-gatway-go/assetTransfer.go to 'User1'
Note - only the admin will be able to transferAsset, updateAsset or createAsset
--> asset-transfer-basic/chaincode-go/smartcontract.go
--> asset-transfer-basic/application-gateway-go
--> test-network/configtx/configtx.yaml
--> test-network/organizations/fabric-ca/registerEnroll.sh
--> test-network/network.sh