-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmp
78 lines (37 loc) · 11.9 KB
/
tmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/ && export CORE_PEER_ADDRESS=org1peer0:30110 && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel join -b $CHANNEL_NAME.block'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/ && export CORE_PEER_ADDRESS=org2peer0:30110 && export CORE_PEER_LOCALMSPID="Org2MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel join -b $CHANNEL_NAME.block'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/ && export CORE_PEER_ADDRESS=org1peer0:30110 && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel update -o orderer:31010 -c $CHANNEL_NAME -f /fabric/channel-artifacts/Org1MSPanchors.tx --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/ && export CORE_PEER_ADDRESS=org2peer0:30110 && export CORE_PEER_LOCALMSPID="Org2MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel update -o orderer:31010 -c $CHANNEL_NAME -f /fabric/channel-artifacts/Org2MSPanchors.tx --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem'
-----
package_ID muss übertragen werden
-----
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CC_RUNTIME_LANGUAGE="golang" && export CHAINCODE_VERSION="1.0" && export FABRIC_CFG_PATH="/etc/hyperledger/fabric" && export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_ADDRESS="org1peer0:30110" && export CHANNEL_NAME=mychannel && export ORDERER_CA="/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem" && peer lifecycle chaincode approveformyorg -o orderer:31010 --ordererTLSHostnameOverride orderer --tls --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --init-required --package-id fabcar_1.0:a6c665ce97362d64a45a339e0c1d3fbc3602c2b9cc4b67fd20e95b11a1f63650'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt && export CC_RUNTIME_LANGUAGE="golang" && export CHAINCODE_VERSION="1.0" && export FABRIC_CFG_PATH="/etc/hyperledger/fabric" && export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp" && export CORE_PEER_LOCALMSPID="Org2MSP" && export CORE_PEER_ADDRESS="org2peer0:30110" && export CHANNEL_NAME=mychannel && export ORDERER_CA="/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem" && peer lifecycle chaincode approveformyorg -o orderer:31010 --ordererTLSHostnameOverride orderer --tls --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --version ${VERSION} --init-required --package-id fabcar_1.0:a6c665ce97362d64a45a339e0c1d3fbc3602c2b9cc4b67fd20e95b11a1f63650'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CC_RUNTIME_LANGUAGE="golang" && export CHAINCODE_VERSION="1.0" && export FABRIC_CFG_PATH="/etc/hyperledger/fabric" && export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_ADDRESS="org1peer0:30110" && export CHANNEL_NAME=mychannel && export ORDERER_CA="/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem" && peer lifecycle chaincode commit -o orderer:31010 --ordererTLSHostnameOverride orderer --tls --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name fabcar --peerAddresses $CORE_PEER_ADDRESS --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE --peerAddresses org2peer0:30110 --tlsRootCertFiles /fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt --version ${VERSION} --init-required'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CC_RUNTIME_LANGUAGE="golang" && export CHAINCODE_VERSION="1.0" && export FABRIC_CFG_PATH="/etc/hyperledger/fabric" && export CORE_PEER_MSPCONFIGPATH="/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_ADDRESS="org1peer0:30110" && export CHANNEL_NAME=mychannel && export ORDERER_CA="/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem" && peer chaincode invoke -o orderer:31010 --ordererTLSHostnameOverride orderer --tls --cafile $ORDERER_CA -C $CHANNEL_NAME -n fabcar --peerAddresses $CORE_PEER_ADDRESS --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE --peerAddresses org2peer0:30110 --tlsRootCertFiles /fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt --isInit -c '{"function":"initLedger","Args":[]}''
--> herausfinden, wie man über oc mit den Anführungszeichen umgeht. Problem: ' '""''
peer chaincode invoke -o orderer:31010 --isInit --tls true --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc --peerAddresses org1peer0:30110 --tlsRootCertFiles /fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt --peerAddresses peer0.org2peer0:30110 --tlsRootCertFiles /fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt -c '{"Args":["Init","a","100","b","100"]}' --waitForEvent
oc logs org1peer0-57c864f778-27sng -c peer &> /Users/robinklemens/Documents/GitHub/hl-fabric-2.0-openshift-byfn/logs
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/ && export CORE_PEER_ADDRESS=org1peer0:30110 && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel update -o orderer:31010 -c $CHANNEL_NAME -f /fabric/channel-artifacts/Org1MSPanchors.tx --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem'
oc -n "myproject" exec fabric-tools -- bash -c 'export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/ && export CORE_PEER_ADDRESS=org2peer0:30110 && export CORE_PEER_LOCALMSPID="Org2MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org2.example.com/peers/org2peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/ && peer channel update -o orderer:31010 -c $CHANNEL_NAME -f /fabric/channel-artifacts/Org2MSPanchors.tx --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem'
oc -n "myproject" exec fabric-tools -- bash -c '/fabric/scripts/deployCC.sh'
oc -n "myproject" cp scripts fabric-tools:/fabric
peer chaincode query -C $CHANNEL_NAME -n fabcar -c '{"Args":["queryAllCars"]}' >&log.txt
GO111MODULE=on
peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile /Users/robinklemens/Documents/GitHub/fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n fabcar --peerAddresses localhost:7051 --tlsRootCertFiles /Users/robinklemens/Documents/GitHub/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles /Users/robinklemens/Documents/GitHub/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --isInit -c '{"function":"initLedger","Args":[]}'
peer channel list -o orderer:31010 --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem --certfile fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt
peer channel list -o orderer:31010 --ordererTLSHostnameOverride orderer --tls --cafile $ORDERER_CA --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
--certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
--clientauth Use mutual TLS when communicating with the orderer endpoint
--connTimeout duration Timeout for client to connect (default 3s)
--keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
-o, --orderer string Ordering service endpoint
--ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer.
--tls Use TLS when communicating with the orderer endpoint
peer channel list -o orderer:31010 --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem --certfile /fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/server.crt
export CORE_PEER_MSPCONFIGPATH=/fabric/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/ && export CORE_PEER_ADDRESS=org1peer0:30110 && export CORE_PEER_LOCALMSPID="Org1MSP" && export CORE_PEER_TLS_ROOTCERT_FILE=/fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt && export CHANNEL_NAME=mychannel && export FABRIC_CFG_PATH=/fabric/config/
peer chaincode query -C $CHANNEL_NAME -n --name fabcar --peerAddresses org1peer0:30110 --tlsRootCertFiles fabric/crypto-config/peerOrganizations/org1.example.com/peers/org1peer0/tls/ca.crt -c '{"Args":["queryAllCars"]}'
peer channel list -o orderer:31010 --tls --cafile /fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer/msp/tlscacerts/tlsca.example.com-cert.pem'
peer chaincode query -C $CHANNEL_NAME -n fabcar -c '{"Args":["queryAllCars"]}'