Skip to content

whuang8686/fxchaincode-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fxchaincode

Clear All docker & network

docker rm -f $(docker ps -aq)

docker network prune

Testing Using dev mode:

Navigate to the chaincode-docker-devmode directory of the fabric-samples clone:

cd fabric-samples

cd chaincode-docker-devmode

Terminal 1 - Start the network

docker-compose -f docker-compose-simple.yaml up

Terminal 2 - Build & start the chaincode

docker exec -it chaincode bash

cd fxchaincode

go build

CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./fxchaincode

Terminal 3 - Use the chaincode

docker exec -it cli bash

peer chaincode install -p chaincodedev/chaincode/fxchaincode -n mycc -v 0

peer chaincode instantiate -n mycc -v 0 -c '{"Args":[""]}' -C myc

Upgrade with the new version 1.0

CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:1 ./fxchaincode

peer chaincode install -p chaincodedev/chaincode/fxchaincode -n mycc -v 1

peer chaincode upgrade -n mycc2 -v 1 -c '{"Args":[""]}' -C myc

Terminal 4 - Start the ngix

cd go

docker-compose -f docker-compose.yml up

http://172.20.10.13:8080/?datadate=20181025&curr1=USD&curr2=TWD

Security Chaincode Functions:

  1. querySecurity(APIstub, args)
  2. initLedger(APIstub, args)
  3. createSecurity(APIstub, args)
  4. queryAllSecurities(APIstub, args)
  5. querySecurityStatus(APIstub, args)
  6. queryOwner(APIstub, args)
  7. queryOwnerAccount(APIstub, args)
  8. queryOwnerLength(APIstub, args)
  9. changeSecurity(APIstub, args)
  10. changeSecurityStatus(APIstub, args)
  11. changeOwnerAvaliable(APIstub, args)
  12. deleteSecurity(APIstub, args)
  13. deleteOwner(APIstub, args)
  14. updateOwnerInterest(APIstub, args)
  15. getHistoryForSecurity(APIstub, args)
  16. getHistoryTXIDForSecurity(APIstub, args)
  17. queryAllSecurityKeys(APIstub, args)
  18. changeBankSecurityTotals(APIstub, args)
  19. queryBankSecurityTotals(APIstub, args)
  20. querySecurityTotals(APIstub, args)

Account Chaincode Functions

  1. initAccount(APIstub, args)
  2. deleteAccount(APIstub, args)
  3. getStateAsBytes(APIstub, args)
  4. updateAccountStatus(APIstub, args)
  5. updateAccount(APIstub, args)
  6. updateAsset(APIstub, args)
  7. updateAssetBalance(APIstub, args)
  8. deleteAsset(APIstub, args)
  9. queryAsset(APIstub, args)
  10. queryAssetInfo(APIstub, args)
  11. queryAssetLength(APIstub, args)
  12. queryAccountStatus(APIstub, args)
  13. queryAllAccounts(APIstub, args)
  14. getHistoryForAccount(APIstub, args)
  15. getHistoryTXIDForAccount(APIstub, args)
  16. queryAllAccountKeys(APIstub, args)

Bank Chaincode Functions

  1. initBank(APIstub, args)
  2. updateBank(APIstub, args)
  3. deleteBank(APIstub, args)
  4. verifyBankList(APIstub, args)
  5. getStateAsBytes(APIstub, args)
  6. queryAllBanks(APIstub, args)
  7. getHistoryForBank(APIstub, args)
  8. getHistoryTXIDForBank(APIstub, args)
  9. queryAllBankKeys(APIstub, args)
  10. queryBankTotals(APIstub, args)

Transaction Chaincode Functions

  1. submitApproveTransaction(APIstub, args)
  2. submitEndDayTransaction(APIstub, args)
  3. securityTransfer(APIstub, args)
  4. securityCorrectTransfer(APIstub, args)
  5. queryTXIDTransactions(APIstub, args)
  6. queryTXKEYTransactions(APIstub, args)
  7. queryHistoryTXKEYTransactions(APIstub, args)
  8. getHistoryForTransaction(APIstub, args)
  9. getHistoryTXIDForTransaction(APIstub, args)
  10. getHistoryForQueuedTransaction(APIstub, args)
  11. getHistoryTXIDForQueuedTransaction(APIstub, args)
  12. queryAllTransactions(APIstub, args)
  13. queryAllQueuedTransactions(APIstub, args)
  14. queryAllHistoryTransactions(APIstub, args)
  15. queryAllTransactionKeys(APIstub, args)
  16. queryQueuedTransactionStatus(APIstub, args)
  17. queryHistoryTransactionStatus(APIstub, args)
  18. updateQueuedTransactionHcode(APIstub, args)
  19. updateHistoryTransactionHcode(APIstub, args)

Other Chaincode Functions

  1. mapFunction(APIstub, function, args)
  2. get(APIstub, function, args)
  3. put(APIstub, function, args)
  4. remove(APIstub, function, args)
  5. keys(APIstub, function, args)
  6. query(APIstub, function, args)# fxchaincode-master

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages