variables.sh 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/usr/bin/env bash
  2. # Before running `make`, config this files
  3. # Define some global variables for usage. Will be included by func.sh.
  4. # Name of app channel, need to align with the gen_artifacts.sh
  5. SYS_CHANNEL="testchainid"
  6. APP_CHANNEL="businesschannel"
  7. # Client cmd execute timeout and retry times
  8. TIMEOUT="30"
  9. MAX_RETRY=5
  10. # Organization and peers
  11. ORGS=( 1 2 )
  12. PEERS=( 0 1 )
  13. # MSP related paths
  14. ORDERER_TLS_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
  15. ORDERER_MSP=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp
  16. ORDERER_TLS_ROOTCERT=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt
  17. ORG1_PEER0_TLS_ROOTCERT=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
  18. ORG1_PEER1_TLS_ROOTCERT=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
  19. ORG2_PEER0_TLS_ROOTCERT=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
  20. ORG2_PEER1_TLS_ROOTCERT=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt
  21. ORDERER_ADMIN_MSP=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp
  22. ORG1_ADMIN_MSP=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
  23. ORG2_ADMIN_MSP=/etc/hyperledger/fabric/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
  24. # Node URLS
  25. ORDERER_URL="orderer.example.com:7050"
  26. ORG1_PEER0_URL="peer0.org1.example.com:7051"
  27. ORG1_PEER1_URL="peer1.org1.example.com:7051"
  28. ORG2_PEER0_URL="peer0.org2.example.com:7051"
  29. ORG2_PEER1_URL="peer1.org2.example.com:7051"
  30. # Chaincode related
  31. CC_NAME="mycc"
  32. #CC_PATH="github.com/hyperledger/fabric/examples/chaincode/go/foodchain"
  33. CC_PATH="examples/chaincode/go/chaincode_example02"
  34. CC_INIT_VERSION=1.0
  35. CC_UPGRADE_VERSION=1.1
  36. CC_INIT_ARGS='{"Args":["init","a","100","b","200"]}'
  37. CC_UPGRADE_ARGS='{"Args":["upgrade","a","100","b","200"]}'
  38. CC_INVOKE_ARGS='{"Args":["invoke","a","b","10"]}'
  39. CC_QUERY_ARGS='{"Args":["query","a"]}'
  40. # TLS config
  41. CORE_PEER_TLS_ENABLED="true"
  42. # Generate configs
  43. APP_CHANNEL_TX=channel.tx
  44. ORDERER_GENESIS=orderer.genesis.block
  45. GEN_IMG=yeasy/hyperledger-fabric:1.0.5 # working dir is `/go/src/github.com/hyperledger/fabric`
  46. GEN_CONTAINER=generator
  47. FABRIC_CFG_PATH=/etc/hyperledger/fabric
  48. CHANNEL_ARTIFACTS=channel-artifacts
  49. CRYPTO_CONFIG=crypto-config
  50. ORDERER_GENESIS=orderer.genesis.block
  51. ORDERER_PROFILE=TwoOrgsOrdererGenesis
  52. APP_CHANNEL_TX=new_${APP_CHANNEL}.tx
  53. UPDATE_ANCHOR_ORG1_TX=Org1MSPanchors.tx
  54. UPDATE_ANCHOR_ORG2_TX=Org2MSPanchors.tx
  55. # CONFIGTXLATOR
  56. CTL_IMG=yeasy/hyperledger-fabric:1.0.5
  57. CTL_CONTAINER=configtxlator
  58. CTL_BASE_URL=http://127.0.0.1:7059
  59. CTL_ENCODE_URL=${CTL_BASE_URL}/protolator/encode
  60. CTL_DECODE_URL=${CTL_BASE_URL}/protolator/decode
  61. CTL_COMPARE_URL=${CTL_BASE_URL}/configtxlator/compute/update-from-configs
  62. ORDERER_GENESIS_JSON=${ORDERER_GENESIS}.json
  63. ORDERER_GENESIS_PAYLOAD_JSON=${ORDERER_GENESIS}_payload.json
  64. ORDERER_GENESIS_UPDATED_BLOCK=orderer.genesis.updated.block
  65. ORDERER_GENESIS_UPDATED_JSON=${ORDERER_GENESIS_UPDATED_BLOCK}.json
  66. PAYLOAD_PATH=".data.data[0].payload"
  67. MAX_BATCH_SIZE_PATH=".data.data[0].payload.data.config.channel_group.groups.Orderer.values.BatchSize.value.max_message_count"