diff --git a/bddtests/docker-compose-1-devmode.yml b/bddtests/docker-compose-1-devmode.yml index 6a9ce286cf3..f89d03cf025 100755 --- a/bddtests/docker-compose-1-devmode.yml +++ b/bddtests/docker-compose-1-devmode.yml @@ -10,7 +10,7 @@ ccenv: image: hyperledger/fabric-ccenv environment: - CORE_CHAINCODE_ID_NAME=testCC - - CORE_PEER_ADDRESS=vp0:30303 + - CORE_PEER_ADDRESS=vp0:7051 command: bash -c "GOBIN=/opt/gopath/bin go install github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 && /opt/gopath/bin/chaincode_example02" links: - - vp0 \ No newline at end of file + - vp0 diff --git a/bddtests/docker-compose-1-exp.yml b/bddtests/docker-compose-1-exp.yml index 51c30cd4c7d..9173c1f6026 100644 --- a/bddtests/docker-compose-1-exp.yml +++ b/bddtests/docker-compose-1-exp.yml @@ -5,4 +5,4 @@ vp0: environment: - CORE_PEER_ID=vp0 ports: - - 31315:31315 + - 7053:7053 diff --git a/bddtests/docker-compose-1-profiling.yml b/bddtests/docker-compose-1-profiling.yml index 252e7b793af..ad798857bd0 100644 --- a/bddtests/docker-compose-1-profiling.yml +++ b/bddtests/docker-compose-1-profiling.yml @@ -5,6 +5,5 @@ vp0: environment: - CORE_PEER_ID=vp0 - CORE_PEER_PROFILE_ENABLED=true - ports: - - 5000:6060 - + ports: + - 7050:6060 diff --git a/bddtests/docker-compose-2-tls-basic.yml b/bddtests/docker-compose-2-tls-basic.yml index 05aa0e9a407..8e3f6229d1a 100644 --- a/bddtests/docker-compose-2-tls-basic.yml +++ b/bddtests/docker-compose-2-tls-basic.yml @@ -14,6 +14,6 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 diff --git a/bddtests/docker-compose-2.yml b/bddtests/docker-compose-2.yml index d96ba464827..aaf205ac629 100644 --- a/bddtests/docker-compose-2.yml +++ b/bddtests/docker-compose-2.yml @@ -12,6 +12,6 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 diff --git a/bddtests/docker-compose-3.yml b/bddtests/docker-compose-3.yml index 61e2e16fd32..261f688f34c 100644 --- a/bddtests/docker-compose-3.yml +++ b/bddtests/docker-compose-3.yml @@ -10,7 +10,7 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -19,6 +19,6 @@ vp2: service: vp0 environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 diff --git a/bddtests/docker-compose-4-consensus-base.yml b/bddtests/docker-compose-4-consensus-base.yml index f855ae29941..08d1ab3770c 100644 --- a/bddtests/docker-compose-4-consensus-base.yml +++ b/bddtests/docker-compose-4-consensus-base.yml @@ -4,9 +4,9 @@ vpBase: service: vp environment: - CORE_SECURITY_ENABLED=true - - CORE_PEER_PKI_ECA_PADDR=membersrvc0:50051 - - CORE_PEER_PKI_TCA_PADDR=membersrvc0:50051 - - CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:50051 + - CORE_PEER_PKI_ECA_PADDR=membersrvc0:7054 + - CORE_PEER_PKI_TCA_PADDR=membersrvc0:7054 + - CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:7054 - CORE_PEER_PKI_TLS_ROOTCERT_FILE=./bddtests/tlsca.cert # TODO: Currently required due to issue reading obbca configuration location - CORE_PBFT_GENERAL_N=4 diff --git a/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml b/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml index bbc5480e81b..2652cb01297 100644 --- a/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml +++ b/bddtests/docker-compose-4-consensus-batch-1-byzantine.yml @@ -20,7 +20,7 @@ vp1: service: vpBatch environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp1 - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy links: @@ -33,7 +33,7 @@ vp2: service: vpBatch environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp2 - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ links: @@ -46,10 +46,10 @@ vp3: service: vpBatch environment: - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp3 - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL - - CORE_PBFT_GENERAL_BYZANTINE=true + - CORE_PBFT_GENERAL_BYZANTINE=true links: - membersrvc0 - vp0 diff --git a/bddtests/docker-compose-4-consensus-batch.yml b/bddtests/docker-compose-4-consensus-batch.yml index b9c498a7f50..274ca7e5360 100644 --- a/bddtests/docker-compose-4-consensus-batch.yml +++ b/bddtests/docker-compose-4-consensus-batch.yml @@ -14,8 +14,8 @@ vp0: - CORE_PEER_PROFILE_ENABLED=true links: - membersrvc0 - ports: - - 5000:6060 + ports: + - 7050:6060 vp1: @@ -24,7 +24,7 @@ vp1: service: vpBatch environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp1 - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy links: @@ -37,7 +37,7 @@ vp2: service: vpBatch environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp2 - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ links: @@ -50,7 +50,7 @@ vp3: service: vpBatch environment: - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp3 - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL links: diff --git a/bddtests/docker-compose-4-consensus-noops.yml b/bddtests/docker-compose-4-consensus-noops.yml index 771905fd1d0..7ba08ae1b0c 100644 --- a/bddtests/docker-compose-4-consensus-noops.yml +++ b/bddtests/docker-compose-4-consensus-noops.yml @@ -14,7 +14,7 @@ vp0: links: - membersrvc0 ports: - - 5000:5000 + - 7050:7050 vp1: extends: @@ -22,7 +22,7 @@ vp1: service: vpBase environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp1 - CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy links: @@ -35,7 +35,7 @@ vp2: service: vpBase environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp2 - CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ links: @@ -48,7 +48,7 @@ vp3: service: vpBase environment: - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_SECURITY_ENROLLID=test_vp3 - CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL links: diff --git a/bddtests/docker-compose-4-consensus-nvp0.yml b/bddtests/docker-compose-4-consensus-nvp0.yml index 2d32b0ddbdb..455027c719a 100644 --- a/bddtests/docker-compose-4-consensus-nvp0.yml +++ b/bddtests/docker-compose-4-consensus-nvp0.yml @@ -4,11 +4,10 @@ nvp0: service: vpBase environment: - CORE_PEER_VALIDATOR_ENABLED=false - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 - CORE_PEER_ID=nvp0 - CORE_SECURITY_ENROLLID=test_nvp0 - CORE_SECURITY_ENROLLSECRET=iywrPBDEPl0K links: - membersrvc0 - vp0 - diff --git a/bddtests/docker-compose-4.yml b/bddtests/docker-compose-4.yml index 914db06f201..fa1ca1e78af 100644 --- a/bddtests/docker-compose-4.yml +++ b/bddtests/docker-compose-4.yml @@ -10,7 +10,7 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -19,7 +19,7 @@ vp2: service: vp0 environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -28,6 +28,6 @@ vp3: service: vp0 environment: - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 diff --git a/bddtests/docker-compose-5.yml b/bddtests/docker-compose-5.yml index 869543b9ded..6149dd0affa 100644 --- a/bddtests/docker-compose-5.yml +++ b/bddtests/docker-compose-5.yml @@ -10,7 +10,7 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -19,7 +19,7 @@ vp2: service: vp0 environment: - CORE_PEER_ID=vp2 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -28,7 +28,7 @@ vp3: service: vp0 environment: - CORE_PEER_ID=vp3 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 @@ -37,6 +37,6 @@ vp4: service: vp0 environment: - CORE_PEER_ID=vp4 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 diff --git a/bddtests/docker-compose-sdk-node.yml b/bddtests/docker-compose-sdk-node.yml index 27239a8a8a6..4db31fd2c48 100644 --- a/bddtests/docker-compose-sdk-node.yml +++ b/bddtests/docker-compose-sdk-node.yml @@ -1,12 +1,11 @@ sampleApp0: image: hyperledger-sdk-node environment: - - MEMBERSRVC_ADDRESS=membersrvc0:50051 - - PEER_ADDRESS=vp0:30303 + - MEMBERSRVC_ADDRESS=membersrvc0:7054 + - PEER_ADDRESS=vp0:7051 - KEY_VALUE_STORE=/tmp/hl_sdk_node_key_value_store # Startup of peer must be delayed to allow membersrvc to come up first command: node sampleSDKApp links: - membersrvc0 - vp0 - diff --git a/bddtests/steps/bdd_grpc_util.py b/bddtests/steps/bdd_grpc_util.py index 8c621ffee9c..1ae32e8dd74 100644 --- a/bddtests/steps/bdd_grpc_util.py +++ b/bddtests/steps/bdd_grpc_util.py @@ -35,7 +35,7 @@ def getTxResult(context, enrollId): (channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) stub = devops_pb2.beta_create_Devops_stub(channel) - + txRequest = devops_pb2.TransactionRequest(transactionUuid = context.transactionID) response = stub.GetTransactionResult(txRequest, 2) assert response.status == fabric_pb2.Response.SUCCESS, 'Failure getting Transaction Result from {0}, for user "{1}": {2}'.format(userRegistration.composeService,enrollId, response.msg) @@ -45,7 +45,7 @@ def getTxResult(context, enrollId): return txResult def getGRPCChannel(ipAddress): - channel = implementations.insecure_channel(ipAddress, 30303) + channel = implementations.insecure_channel(ipAddress, 7051) print("Returning GRPC for address: {0}".format(ipAddress)) return channel @@ -58,7 +58,7 @@ def getGRPCChannelAndUser(context, enrollId): channel = getGRPCChannel(ipAddress) - return (channel, userRegistration) + return (channel, userRegistration) def getDeployment(context, ccAlias): @@ -69,9 +69,9 @@ def getDeployment(context, ccAlias): else: context.deployments = {} if ccAlias in context.deployments: - deployment = context.deployments[ccAlias] + deployment = context.deployments[ccAlias] # else: - # raise Exception("Deployment alias not found: '{0}'. Are you sure you have deployed a chaincode with this alias?".format(ccAlias)) + # raise Exception("Deployment alias not found: '{0}'. Are you sure you have deployed a chaincode with this alias?".format(ccAlias)) return deployment def deployChaincode(context, enrollId, chaincodePath, ccAlias, ctor): @@ -106,17 +106,17 @@ def invokeChaincode(context, enrollId, ccAlias, functionName): # Create a new ChaincodeSpec by copying the deployed one newChaincodeSpec = chaincode_pb2.ChaincodeSpec() newChaincodeSpec.CopyFrom(deployedCcSpec) - + # Update hte chaincodeSpec ctorMsg for invoke args = getArgsFromContextForUser(context, enrollId) - - chaincodeInput = chaincode_pb2.ChaincodeInput(function = functionName, args = args ) + + chaincodeInput = chaincode_pb2.ChaincodeInput(function = functionName, args = args ) newChaincodeSpec.ctorMsg.CopyFrom(chaincodeInput) ccInvocationSpec = chaincode_pb2.ChaincodeInvocationSpec(chaincodeSpec = newChaincodeSpec) (channel, userRegistration) = getGRPCChannelAndUser(context, enrollId) - + stub = devops_pb2.beta_create_Devops_stub(channel) response = stub.Invoke(ccInvocationSpec,2) return response diff --git a/bddtests/steps/peer_basic_impl.py b/bddtests/steps/peer_basic_impl.py index c4b285b80d6..e802e7aaf7d 100644 --- a/bddtests/steps/peer_basic_impl.py +++ b/bddtests/steps/peer_basic_impl.py @@ -25,7 +25,7 @@ import bdd_test_util -CORE_REST_PORT = 5000 +CORE_REST_PORT = 7050 JSONRPC_VERSION = "2.0" class ContainerData: diff --git a/core/chaincode/chaincode_support.go b/core/chaincode/chaincode_support.go index e1c303e947a..71b461effb4 100644 --- a/core/chaincode/chaincode_support.go +++ b/core/chaincode/chaincode_support.go @@ -47,7 +47,7 @@ const ( DevModeUserRunsChaincode string = "dev" chaincodeStartupTimeoutDefault int = 5000 chaincodeInstallPathDefault string = "/opt/gopath/bin/" - peerAddressDefault string = "0.0.0.0:30303" + peerAddressDefault string = "0.0.0.0:7051" ) // chains is a map between different blockchains and their ChaincodeSupport. diff --git a/core/chaincode/chaincodetest.yaml b/core/chaincode/chaincodetest.yaml index ab6a75cc6e1..48197d052ca 100644 --- a/core/chaincode/chaincodetest.yaml +++ b/core/chaincode/chaincodetest.yaml @@ -81,7 +81,7 @@ eca: cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -98,7 +98,7 @@ rest: enabled: true # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 ############################################################################### @@ -226,7 +226,7 @@ peer: events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the # validator sends diff --git a/core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/ChaincodeBase.java b/core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/ChaincodeBase.java index 9f085fe531d..ea5a8dbcdd9 100644 --- a/core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/ChaincodeBase.java +++ b/core/chaincode/shim/java/src/main/java/org/hyperledger/java/shim/ChaincodeBase.java @@ -50,7 +50,7 @@ public abstract class ChaincodeBase { public abstract String getChaincodeID(); public static final String DEFAULT_HOST = "127.0.0.1"; - public static final int DEFAULT_PORT = 30303; + public static final int DEFAULT_PORT = 7051; private String host = DEFAULT_HOST; private int port = DEFAULT_PORT; @@ -64,7 +64,7 @@ public void start(String[] args) { options.addOption("a", "peerAddress", true, "Address of peer to connect to"); options.addOption("s", "securityEnabled", false, "Present if security is enabled"); options.addOption("i", "id", true, "Identity of chaincode"); - + try { CommandLine cl = new DefaultParser().parse(options, args); if (cl.hasOption('a')) { @@ -81,9 +81,9 @@ public void start(String[] args) { } } catch (Exception e) { logger.warn("cli parsing failed with exception",e); - + } - + Runnable chaincode = () -> { logger.trace("chaincode started"); ManagedChannel connection = newPeerClientConnection(); @@ -91,7 +91,7 @@ public void start(String[] args) { chatWithPeer(connection); logger.trace("chatWithPeer DONE"); }; - new Thread(chaincode).start(); + new Thread(chaincode).start(); } public ManagedChannel newPeerClientConnection() { @@ -110,11 +110,11 @@ public ManagedChannel newPeerClientConnection() { } else { builder.usePlaintext(true); } - + return builder.build(); } - public void chatWithPeer(ManagedChannel connection) { + public void chatWithPeer(ManagedChannel connection) { // Establish stream with validating peer ChaincodeSupportStub stub = ChaincodeSupportGrpc.newStub(connection); @@ -196,15 +196,15 @@ public void onCompleted() { } } } - + public ByteString runRaw(ChaincodeStub stub, String function, String[] args) { return null; } - + public ByteString queryRaw(ChaincodeStub stub, String function, String[] args) { return null; } - + protected ByteString runHelper(ChaincodeStub stub, String function, String[] args) { ByteString ret = runRaw(stub, function, args); if (ret == null) { @@ -213,7 +213,7 @@ protected ByteString runHelper(ChaincodeStub stub, String function, String[] arg } return ret; } - + protected ByteString queryHelper(ChaincodeStub stub, String function, String[] args) { ByteString ret = queryRaw(stub, function, args); if (ret == null) { @@ -221,4 +221,4 @@ protected ByteString queryHelper(ChaincodeStub stub, String function, String[] a } return ret; } -} \ No newline at end of file +} diff --git a/core/comm/connection_test.go b/core/comm/connection_test.go index bc4a2300efb..1841dbf77d5 100644 --- a/core/comm/connection_test.go +++ b/core/comm/connection_test.go @@ -29,7 +29,7 @@ func TestConnection_Correct(t *testing.T) { func TestConnection_WrongAddress(t *testing.T) { config.SetupTestConfig("./../../peer") viper.Set("ledger.blockchain.deploy-system-chaincode", "false") - viper.Set("peer.address", "0.0.0.0:30304") + viper.Set("peer.address", "0.0.0.0:7052") var tmpConn *grpc.ClientConn var err error if TLSEnabled() { diff --git a/core/fsm_test.go b/core/fsm_test.go index 106cc2efa9c..59af9dd04bd 100644 --- a/core/fsm_test.go +++ b/core/fsm_test.go @@ -23,7 +23,7 @@ import ( ) func simulateConn(tb testing.TB) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") err := peerConn.FSM.Event("HELLO") if err != nil { @@ -38,7 +38,7 @@ func simulateConn(tb testing.TB) { } func TestFSM_PeerConnection(t *testing.T) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") err := peerConn.FSM.Event("HELLO") if err != nil { @@ -55,7 +55,7 @@ func TestFSM_PeerConnection(t *testing.T) { } func TestFSM_PeerConnection2(t *testing.T) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") err := peerConn.FSM.Event("HELLO") if err != nil { @@ -72,7 +72,7 @@ func TestFSM_PeerConnection2(t *testing.T) { } func TestFSM_PeerConnection_BadState_1(t *testing.T) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") // Try to move from created state err := peerConn.FSM.Event("GET_PEERS") @@ -93,7 +93,7 @@ func TestFSM_PeerConnection_BadState_1(t *testing.T) { } func TestFSM_PeerConnection_BadState_2(t *testing.T) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") // Try to move from created state err := peerConn.FSM.Event("GET_PEERS") @@ -108,7 +108,7 @@ func TestFSM_PeerConnection_BadState_2(t *testing.T) { } func TestFSM_PeerConnection_BadEvent(t *testing.T) { - peerConn := NewPeerConnectionFSM("10.10.10.10:30303") + peerConn := NewPeerConnectionFSM("10.10.10.10:7051") // Try to move from created state err := peerConn.FSM.Event("UNDEFINED_EVENT") diff --git a/core/ledger/genesis/genesis_test.yaml b/core/ledger/genesis/genesis_test.yaml index c9449032e59..496f52b5d3a 100644 --- a/core/ledger/genesis/genesis_test.yaml +++ b/core/ledger/genesis/genesis_test.yaml @@ -7,7 +7,7 @@ cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -19,7 +19,7 @@ cli: rest: # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 @@ -54,7 +54,7 @@ peer: RUN CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install && cp $GOPATH/src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin # The Address this Peer will bind to for providing services - address: 0.0.0.0:30303 + address: 0.0.0.0:7051 # Whether the Peer should programmatically determine the address to bind to. This case is useful for docker containers. addressAutoDetect: false @@ -66,7 +66,7 @@ peer: level: DEBUG # Peer port to accept connections on - port: 30303 + port: 7051 # Peer's setting for GOMAXPROCS gomaxprocs: 2 workers: 2 @@ -101,10 +101,10 @@ peer: # testNodes: # - node : 1 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # - node : 2 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # Should the discovered nodes and their reputations # be stored in DB and persisted between restarts @@ -141,7 +141,7 @@ peer: ############################################################################### validator: enabled: false - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 # TLS Settings for p2p communications tls: enabled: false diff --git a/core/rest/api_test.go b/core/rest/api_test.go index 05eb214c093..11636796c93 100644 --- a/core/rest/api_test.go +++ b/core/rest/api_test.go @@ -49,7 +49,7 @@ type peerInfo struct { func (p *peerInfo) GetPeers() (*protos.PeersMessage, error) { peers := []*protos.PeerEndpoint{} - pe1 := &protos.PeerEndpoint{ID: &protos.PeerID{Name: viper.GetString("peer.id")}, Address: "localhost:30303", Type: protos.PeerEndpoint_VALIDATOR} + pe1 := &protos.PeerEndpoint{ID: &protos.PeerID{Name: viper.GetString("peer.id")}, Address: "localhost:7051", Type: protos.PeerEndpoint_VALIDATOR} peers = append(peers, pe1) /* @@ -66,7 +66,7 @@ func (p *peerInfo) GetPeers() (*protos.PeersMessage, error) { } func (p *peerInfo) GetPeerEndpoint() (*protos.PeerEndpoint, error) { - pe := &protos.PeerEndpoint{ID: &protos.PeerID{Name: viper.GetString("peer.id")}, Address: "localhost:30303", Type: protos.PeerEndpoint_VALIDATOR} + pe := &protos.PeerEndpoint{ID: &protos.PeerID{Name: viper.GetString("peer.id")}, Address: "localhost:7051", Type: protos.PeerEndpoint_VALIDATOR} return pe, nil } diff --git a/core/rest/rest_api.json b/core/rest/rest_api.json index 29e9525e43a..d2fbb9deadb 100644 --- a/core/rest/rest_api.json +++ b/core/rest/rest_api.json @@ -5,7 +5,7 @@ "description": "Interact with the enterprise blockchain through Hyperledger Fabric API", "version": "1.0.0" }, - "host": "127.0.0.1:5000", + "host": "127.0.0.1:7050", "schemes": [ "http" ], diff --git a/core/rest/rest_test.yaml b/core/rest/rest_test.yaml index 4acbe820fda..06d937d07af 100644 --- a/core/rest/rest_test.yaml +++ b/core/rest/rest_test.yaml @@ -6,7 +6,7 @@ cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -23,7 +23,7 @@ rest: enabled: true # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 validPatterns: @@ -96,9 +96,9 @@ peer: networkId: dev # The Address this Peer will listen on - listenAddress: 0.0.0.0:30303 + listenAddress: 0.0.0.0:7051 # The Address this Peer will bind to for providing services - address: 0.0.0.0:30303 + address: 0.0.0.0:7051 # Whether the Peer should programmatically determine the address to bind to. # This case is useful for docker containers. addressAutoDetect: false @@ -145,7 +145,7 @@ peer: events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the # validator sends @@ -156,7 +156,7 @@ peer: # if 0, if buffer full, will block and guarantee the event will be sent out # if > 0, if buffer full, blocks till timeout timeout: 10 - + # TLS Settings for p2p communications tls: enabled: false @@ -170,11 +170,11 @@ peer: # PKI member services properties pki: eca: - paddr: localhost:50051 + paddr: localhost:7054 tca: - paddr: localhost:50051 + paddr: localhost:7054 tlsca: - paddr: localhost:50051 + paddr: localhost:7054 tls: enabled: false rootcert: @@ -197,10 +197,10 @@ peer: # testNodes: # - node : 1 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # - node : 2 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # Should the discovered nodes and their reputations # be stored in DB and persisted between restarts @@ -261,7 +261,7 @@ vm: # If you have your own ipam & dns-server for cluster you can use them to create container efficient. # NetworkMode Sets the networking mode for the container. Supported standard values are: `host`(default),`bridge`,`ipvlan`,`none` # dns A list of DNS servers for the container to use. - # note: not support customize for `Privileged` + # note: not support customize for `Privileged` # LogConfig sets the logging driver (Type) and related options (Config) for Docker # you can refer https://docs.docker.com/engine/admin/logging/overview/ for more detail configruation. hostConfig: @@ -273,7 +273,7 @@ vm: Config: max-size: "50m" max-file: "5" - + ############################################################################### # # Chaincode section @@ -326,7 +326,7 @@ chaincode: # the image installpath: /opt/gopath/bin/ - # keepalive in seconds. In situations where the communiction goes through a + # keepalive in seconds. In situations where the communiction goes through a # proxy that does not support keep-alive, this parameter will maintain connection # between peer and chaincode. # A value <= 0 turns keepalive off diff --git a/devenv/Vagrantfile b/devenv/Vagrantfile index b1b099139f6..8d9d6999daf 100644 --- a/devenv/Vagrantfile +++ b/devenv/Vagrantfile @@ -34,10 +34,10 @@ Vagrant.configure('2') do |config| config.vm.box = "hyperledger/fabric-baseimage" config.vm.box_version = ENV['USE_LOCAL_BASEIMAGE'] ? "0": baseimage_release # Vagrant does not support versioning local images, the local version is always implicitly version 0 - config.vm.network :forwarded_port, guest: 5000, host: 5000 # Openchain REST services - config.vm.network :forwarded_port, guest: 30303, host: 30303 # Openchain gRPC services - config.vm.network :forwarded_port, guest: 50051, host: 50051 # Membership service - config.vm.network :forwarded_port, guest: 31315, host: 31315 # GRPCCient gRPC services + config.vm.network :forwarded_port, guest: 7050, host: 7050 # Openchain REST services + config.vm.network :forwarded_port, guest: 7051, host: 7051 # Openchain gRPC services + config.vm.network :forwarded_port, guest: 7054, host: 7054 # Membership service + config.vm.network :forwarded_port, guest: 7053, host: 7053 # GRPCCient gRPC services config.vm.synced_folder "..", "#{SRCMOUNT}" config.vm.synced_folder "..", "/opt/gopath/src/github.com/hyperledger/fabric" diff --git a/docs/API/CoreAPI.md b/docs/API/CoreAPI.md index b80e059eff7..90145d93a5f 100644 --- a/docs/API/CoreAPI.md +++ b/docs/API/CoreAPI.md @@ -23,11 +23,11 @@ To view the currently available CLI commands, execute the following: You will see output similar to the example below (**NOTE:** rootcommand below is hardcoded in [main.go](https://github.com/hyperledger/fabric/blob/master/main.go). Currently, the build will create a *peer* executable file). ``` - Usage: + Usage: peer [flags] peer [command] - - Available Commands: + + Available Commands: version Print fabric peer version. node node specific commands. network network specific commands. @@ -80,9 +80,9 @@ With security enabled, modify the command to include the -u parameter passing th ### Verify Results -To verify that the block containing the latest transaction has been added to the blockchain, use the `/chain` REST endpoint from the command line. Target the IP address of either a validating or a non-validating node. In the example below, 172.17.0.2 is the IP address of a validating or a non-validating node and 5000 is the REST interface port defined in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml). +To verify that the block containing the latest transaction has been added to the blockchain, use the `/chain` REST endpoint from the command line. Target the IP address of either a validating or a non-validating node. In the example below, 172.17.0.2 is the IP address of a validating or a non-validating node and 7050 is the REST interface port defined in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml). -`curl 172.17.0.2:5000/chain` +`curl 172.17.0.2:7050/chain` An example of the response is below. @@ -103,9 +103,9 @@ message BlockchainInfo { } ``` -To verify that a specific block is inside the blockchain, use the `/chain/blocks/{Block}` REST endpoint. Likewise, target the IP address of either a validating or a non-validating node on port 5000. +To verify that a specific block is inside the blockchain, use the `/chain/blocks/{Block}` REST endpoint. Likewise, target the IP address of either a validating or a non-validating node on port 7050. -`curl 172.17.0.2:5000/chain/blocks/0` +`curl 172.17.0.2:7050/chain/blocks/0` The returned Block message structure is defined inside [fabric.proto](https://github.com/hyperledger/fabric/blob/master/protos/fabric.proto#L84). @@ -143,7 +143,7 @@ For additional information on the available CLI commands, please see the [protoc You can work with the REST API through any tool of your choice. For example, the curl command line utility or a browser based client such as the Firefox Rest Client or Chrome Postman. You can likewise trigger REST requests directly through [Swagger](http://swagger.io/). You can utilize the Swagger service directly or, if you prefer, you can set up Swagger locally by following the instructions [here](#to-set-up-swagger-ui). -**Note:** The default REST interface port is 5000. It can be configured in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml) using the `rest.address` property. If using Vagrant, the REST port mapping is defined in [Vagrantfile](https://github.com/hyperledger/fabric/blob/master/devenv/Vagrantfile). +**Note:** The default REST interface port is `7050`. It can be configured in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml) using the `rest.address` property. If using Vagrant, the REST port mapping is defined in [Vagrantfile](https://github.com/hyperledger/fabric/blob/master/devenv/Vagrantfile). **Note on constructing a test blockchain** If you want to test the REST API locally, construct a test blockchain by running the TestServerOpenchain_API_GetBlockCount test implemented inside [api_test.go](https://github.com/hyperledger/fabric/blob/master/core/rest/api_test.go). This test will create a test blockchain with 5 blocks. Subsequently restart the peer process. diff --git a/docs/Setup/Chaincode-setup.md b/docs/Setup/Chaincode-setup.md index f8c67a8be39..261e16bab34 100644 --- a/docs/Setup/Chaincode-setup.md +++ b/docs/Setup/Chaincode-setup.md @@ -86,14 +86,14 @@ To run the fabric-peer and fabric-membersrvc images, we'll use [Docker Compose]( membersrvc: image: hyperledger/fabric-membersrvc ports: - - "50051:50051" + - "7054:7054" command: membersrvc vp0: image: hyperledger/fabric-peer ports: - - "5000:5000" - - "30303:30303" - - "30304:30304" + - "7050:7050" + - "7051:7051" + - "7052:7052" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock @@ -198,7 +198,7 @@ When you are ready to start creating your own Go chaincode, create a new subdire Run the following chaincode command to start and register the chaincode with the validating peer: ``` -CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:30303 ./chaincode_example02 +CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7051 ./chaincode_example02 ``` The chaincode console will display the message "Received REGISTERED, ready for invocations", which indicates that the chaincode is ready to receive requests. Follow the steps below to send a chaincode deploy, invoke or query transaction. If the "Received REGISTERED" message is not displayed, then an error has occurred during the deployment; revisit the previous steps to resolve the issue. @@ -218,7 +218,7 @@ logging output from the `peer` and chaincodes. #### **Note on REST API port** -The default REST interface port is 5000. It can be configured in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml) using the `rest.address` property. If using Vagrant, the REST port mapping is defined in [Vagrantfile](https://github.com/hyperledger/fabric/blob/master/devenv/Vagrantfile). +The default REST interface port is `7050`. It can be configured in [core.yaml](https://github.com/hyperledger/fabric/blob/master/peer/core.yaml) using the `rest.address` property. If using Vagrant, the REST port mapping is defined in [Vagrantfile](https://github.com/hyperledger/fabric/blob/master/devenv/Vagrantfile). #### **Note on security functionality** @@ -246,7 +246,7 @@ To log in through the REST API, send a POST request to the `/registrar` endpoint **REST Request:** ``` -POST localhost:5000/registrar +POST localhost:7050/registrar { "enrollId": "jim", diff --git a/docs/Setup/Network-setup.md b/docs/Setup/Network-setup.md index b643d4c0d1f..5d9c491b3ea 100644 --- a/docs/Setup/Network-setup.md +++ b/docs/Setup/Network-setup.md @@ -123,9 +123,9 @@ Here's the docker-compose.yml for Docker on Mac or Windows: vp0: image: hyperledger/fabric-peer ports: - - "5000:5000" - - "30303:30303" - - "30304:30304" + - "7050:7050" + - "7051:7051" + - "7052:7052" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock @@ -156,7 +156,7 @@ vp1: service: vp0 environment: - CORE_PEER_ID=vp1 - - CORE_PEER_DISCOVERY_ROOTNODE=vp0:30303 + - CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051 links: - vp0 ``` @@ -164,7 +164,7 @@ vp1: If we wanted to use the docker command line to launch another peer, we need to get the IP address of the first validating peer, which will act as the root node to which the new peer(s) will connect. The address is printed out on the terminal window of the first peer (e.g. 172.17.0.2) and should be passed in with the `CORE_PEER_DISCOVERY_ROOTNODE` environment variable. ``` -docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 hyperledger/fabric-peer peer node start +docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:7051 hyperledger/fabric-peer peer node start ``` diff --git a/docs/Setup/NodeSDK-setup.md b/docs/Setup/NodeSDK-setup.md index f02d511df22..4d01becbdb0 100644 --- a/docs/Setup/NodeSDK-setup.md +++ b/docs/Setup/NodeSDK-setup.md @@ -62,10 +62,10 @@ var chain = hfc.newChain("targetChain"); chain.setKeyValStore( hfc.newFileKeyValStore('/tmp/keyValStore') ); // Set the URL for member services -chain.setMemberServicesUrl("grpc://localhost:50051"); +chain.setMemberServicesUrl("grpc://localhost:7054"); // Add a peer's URL -chain.addPeer("grpc://localhost:30303"); +chain.addPeer("grpc://localhost:7051"); // Enroll "WebAppAdmin" which is already registered because it is // listed in fabric/membersrvc/membersrvc.yaml with its one time password. diff --git a/docs/Setup/ca-setup.md b/docs/Setup/ca-setup.md index 81f48a5711f..2919bce0b2c 100644 --- a/docs/Setup/ca-setup.md +++ b/docs/Setup/ca-setup.md @@ -82,7 +82,7 @@ The corresponding docker-compose.yml for running Docker on Mac or Windows native membersrvc: image: hyperledger/fabric-membersrvc ports: - - "50051:50051" + - "7054:7054" command: membersrvc ``` @@ -112,14 +112,14 @@ The corresponding docker-compose.yml for running Docker on Mac or Windows native membersrvc: image: hyperledger/fabric-membersrvc ports: - - "50051:50051" + - "7054:7054" command: membersrvc vp0: image: hyperledger/fabric-peer ports: - - "5000:5000" - - "30303:30303" - - "30304:30304" + - "7050:7050" + - "7051:7051" + - "7052:7052" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock @@ -175,7 +175,7 @@ membersrvc: ``` ``` -docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_SECURITY_ENABLED=true -e CORE_SECURITY_PRIVACY=true -e CORE_PEER_PKI_ECA_PADDR=172.17.0.1:50051 -e CORE_PEER_PKI_TCA_PADDR=172.17.0.1:50051 -e CORE_PEER_PKI_TLSCA_PADDR=172.17.0.1:50051 -e CORE_SECURITY_ENROLLID=vp0 -e CORE_SECURITY_ENROLLSECRET=vp0_secret hyperledger/fabric-peer peer node start +docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_SECURITY_ENABLED=true -e CORE_SECURITY_PRIVACY=true -e CORE_PEER_PKI_ECA_PADDR=172.17.0.1:7054 -e CORE_PEER_PKI_TCA_PADDR=172.17.0.1:7054 -e CORE_PEER_PKI_TLSCA_PADDR=172.17.0.1:7054 -e CORE_SECURITY_ENROLLID=vp0 -e CORE_SECURITY_ENROLLSECRET=vp0_secret hyperledger/fabric-peer peer node start ``` Additionally, the validating peer `enrollID` and `enrollSecret` (`vp0` and `vp0_secret`) has to be added to [membersrvc.yaml](https://github.com/hyperledger/fabric/blob/master/membersrvc/membersrvc.yaml). diff --git a/docs/Setup/logging-control.md b/docs/Setup/logging-control.md index 0ac617d91e4..b0ad8d21816 100644 --- a/docs/Setup/logging-control.md +++ b/docs/Setup/logging-control.md @@ -12,9 +12,9 @@ All logs are currently directed to `stderr`, and the pretty-printing is currentl In pretty-printed logs the logging level is indicated both by color and by a 4-character code, e.g, "ERRO" for ERROR, "DEBU" for DEBUG, etc. In the logging context a _module_ is an arbitrary name (string) given by developers to groups of related messages. In the pretty-printed example below, the logging modules "peer", "rest" and "main" are generating logs. - 16:47:09.634 [peer] GetLocalAddress -> INFO 033 Auto detected peer address: 9.3.158.178:30303 + 16:47:09.634 [peer] GetLocalAddress -> INFO 033 Auto detected peer address: 9.3.158.178:7051 16:47:09.635 [rest] StartOpenchainRESTServer -> INFO 035 Initializing the REST service... - 16:47:09.635 [main] serve -> INFO 036 Starting peer with id=name:"vp1" , network id=dev, address=9.3.158.178:30303, discovery.rootnode=, validator=true + 16:47:09.635 [main] serve -> INFO 036 Starting peer with id=name:"vp1" , network id=dev, address=9.3.158.178:7051, discovery.rootnode=, validator=true An arbitrary number of logging modules can be created at runtime, therefore there is no "master list" of modules, and logging control constructs can not diff --git a/docs/protocol-spec.md b/docs/protocol-spec.md index 481d38cfb4c..d941c1f2b2b 100644 --- a/docs/protocol-spec.md +++ b/docs/protocol-spec.md @@ -2693,7 +2693,7 @@ Network Response: "ID": { "name": "vp1" }, - "address": "172.17.0.4:30303", + "address": "172.17.0.4:7051", "type": 1, "pkiID": "rUA+vX2jVCXev6JsXDNgNBMX03IV9mHRPWo6h6SI0KLMypBJLd+JoGGlqFgi+eq/" }, @@ -2701,7 +2701,7 @@ Network Response: "ID": { "name": "vp3" }, - "address": "172.17.0.5:30303", + "address": "172.17.0.5:7051", "type": 1, "pkiID": "OBduaZJ72gmM+B9wp3aErQlofE0ulQfXfTHh377ruJjOpsUn0MyvsJELUTHpAbHI" }, @@ -2709,7 +2709,7 @@ Network Response: "ID": { "name": "vp2" }, - "address": "172.17.0.6:30303", + "address": "172.17.0.6:7051", "type": 1, "pkiID": "GhtP0Y+o/XVmRNXGF6pcm9KLNTfCZp+XahTBqVRmaIumJZnBpom4ACayVbg4Q/Eb" } diff --git a/examples/chaincode/go/asset_management02/asset.yaml b/examples/chaincode/go/asset_management02/asset.yaml index 42febd0a14a..e74bb53ff1b 100755 --- a/examples/chaincode/go/asset_management02/asset.yaml +++ b/examples/chaincode/go/asset_management02/asset.yaml @@ -12,7 +12,7 @@ server: cadir: ".membersrvc" # port the CA services are listening on - port: ":50051" + port: ":7054" # TLS certificate and key file paths tls: @@ -56,7 +56,7 @@ aca: attribute-entry-10: bob;bank_a;account3;11111-00003;2015-02-02T00:00:00-03:00;; attribute-entry-11: bob;bank_a;contactInfo;bob@yahoo.com;2015-02-02T00:00:00-03:00;; - address: localhost:50051 + address: localhost:7054 server-name: acap enabled: true @@ -110,7 +110,7 @@ pki: cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -127,7 +127,7 @@ rest: enabled: true # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 ############################################################################### @@ -256,7 +256,7 @@ peer: events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the # validator sends @@ -285,11 +285,11 @@ peer: # PKI member services properties pki: eca: - paddr: localhost:50051 + paddr: localhost:7054 tca: - paddr: localhost:50051 + paddr: localhost:7054 tlsca: - paddr: localhost:50051 + paddr: localhost:7054 tls: enabled: false rootcert: diff --git a/examples/chaincode/go/asset_management_with_roles/asset.yaml b/examples/chaincode/go/asset_management_with_roles/asset.yaml index 244c72cbad2..145c5a36ecd 100644 --- a/examples/chaincode/go/asset_management_with_roles/asset.yaml +++ b/examples/chaincode/go/asset_management_with_roles/asset.yaml @@ -12,7 +12,7 @@ server: cadir: ".membersrvc" # port the CA services are listening on - port: ":50051" + port: ":7054" # TLS certificate and key file paths tls: @@ -50,7 +50,7 @@ aca: attribute-entry-2: admin;bank_a;role;assigner;2015-01-01T00:00:00-03:00;; attribute-entry-3: alice;bank_a;account;12345-56789;2016-01-01T00:00:00-03:00;; attribute-entry-4: bob;bank_a;account;23456-67890;2015-02-02T00:00:00-03:00;; - address: localhost:50051 + address: localhost:7054 server-name: acap enabled: true @@ -88,7 +88,7 @@ eca: cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -105,7 +105,7 @@ rest: enabled: true # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 ############################################################################### @@ -234,7 +234,7 @@ peer: events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the # validator sends @@ -260,11 +260,11 @@ peer: # PKI member services properties pki: eca: - paddr: localhost:50051 + paddr: localhost:7054 tca: - paddr: localhost:50051 + paddr: localhost:7054 tlsca: - paddr: localhost:50051 + paddr: localhost:7054 tls: enabled: false rootcert: diff --git a/examples/chaincode/go/utxo/README.md b/examples/chaincode/go/utxo/README.md index 438816b9440..5fd87a15bfe 100644 --- a/examples/chaincode/go/utxo/README.md +++ b/examples/chaincode/go/utxo/README.md @@ -29,7 +29,7 @@ peer node start In a second window, deploy the example UTXO chaincode ``` -CORE_PEER_ADDRESS=localhost:30303 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/utxo -c '{"Function":"init", "Args": []}' +CORE_PEER_ADDRESS=localhost:7051 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/utxo -c '{"Function":"init", "Args": []}' ``` Wait about 30 seconds for the chaincode to be deployed. Output from the window where the peer is running will indicate that this is successful. @@ -52,7 +52,7 @@ go test github.com/hyperledger/fabric/core/container -run=BuildImage_Peer Using the Docker image that we just built, start a peer within a container in `chaincodedev` mode. ``` -docker run -it -p 30303:30303 -p 31315:31315 hyperledger/fabric-peer peer node start --peer-chaincodedev +docker run -it -p 7051:7051 -p 7053:7053 hyperledger/fabric-peer peer node start --peer-chaincodedev ``` @@ -65,7 +65,7 @@ Build the UTXO chaincode. ``` cd $GOPATH/src/github.com/hyperledger/fabric/examples/chaincode/go/utxo/ go build -CORE_PEER_ADDRESS=172.17.0.2:30303 CORE_CHAINCODE_ID_NAME=utxo ./utxo +CORE_PEER_ADDRESS=172.17.0.2:7051 CORE_CHAINCODE_ID_NAME=utxo ./utxo ``` In another window, deploy the chaincode diff --git a/examples/events/block-listener/README.md b/examples/events/block-listener/README.md index aacb547fb69..f71df11d13f 100644 --- a/examples/events/block-listener/README.md +++ b/examples/events/block-listener/README.md @@ -14,25 +14,22 @@ block-listener.go will connect to a peer and receive blocks. For every transacti ```sh docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp0 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start -docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start +docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp1 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:7051 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start -docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp2 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start +docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp2 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:7051 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start -docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp3 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:30303 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start -``` +docker run --rm -it -e CORE_VM_ENDPOINT=http://172.17.0.1:2375 -e CORE_PEER_ID=vp3 -e CORE_PEER_ADDRESSAUTODETECT=true -e CORE_PEER_DISCOVERY_ROOTNODE=172.17.0.2:7051 -e CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft hyperledger/fabric-peer peer node start ## Attach event client to a Peer -```sh -./block-listener -events-address=172.17.0.2:31315 -``` +./block-listener -events-address=172.17.0.2:7054 -Event client should output "Event Address: 172.17.0.2:31315" and wait for events. +Event client should output "Event Address: 172.17.0.2:7054" and wait for events. ## Create a deploy transaction Submit a transaction to deploy chaincode_example02. ```sh -CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}' +CORE_PEER_ADDRESS=172.17.0.2:7051 peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}' ``` Notice success transaction in the events client. @@ -41,16 +38,15 @@ Notice success transaction in the events client. Send a valid invoke transaction to chaincode_example02. ```sh -CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b","10"]}' +CORE_PEER_ADDRESS=172.17.0.2:7051 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b","10"]}' ``` - Notice success transaction in events client. ## Create an invoke transaction - bad Send an invoke transaction with invalid parameters to chaincode_example02. ```sh -CORE_PEER_ADDRESS=172.17.0.2:30303 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b"]}' +CORE_PEER_ADDRESS=172.17.0.2:7051 peer chaincode invoke -n 1edd7021ab71b766f4928a9ef91182c018dffb86fef7a4b5a5516ac590a87957e21a62d939df817f5105f524abddcddfc7b1a60d780f02d8235bd7af9db81b66 -c '{"Function":"invoke", "Args": ["a","b"]}' ``` Notice error transaction in events client. diff --git a/examples/events/block-listener/block-listener.go b/examples/events/block-listener/block-listener.go index 14d2ff23e51..f4b80a09917 100644 --- a/examples/events/block-listener/block-listener.go +++ b/examples/events/block-listener/block-listener.go @@ -78,7 +78,7 @@ func createEventClient(eventAddress string, listenToRejections bool) *adapter { func main() { var eventAddress string var listenToRejections bool - flag.StringVar(&eventAddress, "events-address", "0.0.0.0:31315", "address of events server") + flag.StringVar(&eventAddress, "events-address", "0.0.0.0:7053", "address of events server") flag.BoolVar(&listenToRejections, "listen-to-rejections", false, "whether to listen to rejection events") flag.Parse() diff --git a/membersrvc/ca/ca_test.yaml b/membersrvc/ca/ca_test.yaml index aba7170b8c4..4c93f95e6ec 100644 --- a/membersrvc/ca/ca_test.yaml +++ b/membersrvc/ca/ca_test.yaml @@ -3,7 +3,7 @@ server: version: "0.1" rootpath: "." cadir: ".ca" - port: ":50951" + port: ":7056" tls: cert: @@ -19,7 +19,7 @@ server: cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -31,7 +31,7 @@ cli: rest: # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 @@ -67,9 +67,9 @@ peer: RUN CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install && cp $GOPATH/src/github.com/hyperledger/fabric/peer/core.yaml $GOPATH/bin # The Address this Peer will listen on - listenAddress: 0.0.0.0:30303 + listenAddress: 0.0.0.0:7051 # The Address this Peer will bind to for providing services - address: 0.0.0.0:30303 + address: 0.0.0.0:7051 # Whether the Peer should programmatically determine the address to bind to. This case is useful for docker containers. addressAutoDetect: false @@ -81,7 +81,7 @@ peer: level: DEBUG # Peer port to accept connections on - port: 30303 + port: 7051 # Peer's setting for GOMAXPROCS gomaxprocs: 2 workers: 2 @@ -107,11 +107,11 @@ peer: consensus: noops # List of validating peers. For MVP, assume list is static. - replicas: 172.17.0.2:30303 172.17.0.3:30303 172.17.0.4:30303 172.17.0.5:30303 + replicas: 172.17.0.2:7051 172.17.0.3:7051 172.17.0.4:7051 172.17.0.5:7051 events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the validator sends buffersize: 100 @@ -136,11 +136,11 @@ peer: # PKI member services properties pki: eca: - paddr: localhost:50051 + paddr: localhost:7054 tca: - paddr: localhost:50551 + paddr: localhost:7055 tlsca: - paddr: localhost:50951 + paddr: localhost:7056 # Peer discovery settings. Controls how this peer discovers other peers discovery: @@ -155,10 +155,10 @@ peer: # testNodes: # - node : 1 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # - node : 2 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # Should the discovered nodes and their reputations # be stored in DB and persisted between restarts @@ -195,7 +195,7 @@ peer: ############################################################################### validator: enabled: false - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 # TLS Settings for p2p communications tls: enabled: false @@ -311,12 +311,12 @@ security: privacy: false ports: - ecaP: ":50051" - ecaA: ":50052" - tcaP: ":50551" - tcaA: ":50552" - tlscaP: ":50951" - tlscaA: ":50952" + ecaP: ":7054" + ecaA: ":7055" + tcaP: ":7056" + tcaA: ":7057" + tlscaP: ":7058" + tlscaA: ":7059" hosts: eca: localhost @@ -360,7 +360,7 @@ aca: attribute-entry-1: test_user0;bank_a;position;Software Staff;2015-01-01T00:00:00-03:00;2015-07-12T23:59:59-03:00; attribute-entry-2: test_user0;bank_a;position;Software Engineer;2015-07-13T00:00:00-03:00;; attribute-entry-3: test_user0;bank_a;business_unit;Sales;2015-06-24T00:00:00-03:00;; - address: localhost:50951 + address: localhost:7056 server-name: acap enabled: true diff --git a/membersrvc/membersrvc.yaml b/membersrvc/membersrvc.yaml index af770d772da..b2cd2e19230 100644 --- a/membersrvc/membersrvc.yaml +++ b/membersrvc/membersrvc.yaml @@ -13,7 +13,7 @@ server: cadir: ".membersrvc" # port the CA services are listening on - port: ":50051" + port: ":7054" # TLS certificate and key file paths tls: @@ -165,7 +165,7 @@ aca: attribute-entry-10: bob;bank_a;account;23456-67890;2015-02-02T00:00:00-03:00;; attribute-entry-11: assigner;bank_a;role;assigner;2015-01-01T00:00:00-03:00;; - address: localhost:50051 + address: localhost:7054 server-name: acap # Enabling/disabling Attribute Certificate Authority, if ACA is enabled attributes will be added into the TCert. enabled: false diff --git a/peer/core.yaml b/peer/core.yaml index cd4ef2a2c53..9eb132ba02c 100644 --- a/peer/core.yaml +++ b/peer/core.yaml @@ -6,7 +6,7 @@ cli: # The address that the cli process will use for callbacks from chaincodes - address: 0.0.0.0:30304 + address: 0.0.0.0:7052 @@ -23,7 +23,7 @@ rest: enabled: true # The address that the REST service will listen on for incoming requests. - address: 0.0.0.0:5000 + address: 0.0.0.0:7050 validPatterns: @@ -92,9 +92,9 @@ peer: networkId: dev # The Address this Peer will listen on - listenAddress: 0.0.0.0:30303 + listenAddress: 0.0.0.0:7051 # The Address this Peer will bind to for providing services - address: 0.0.0.0:30303 + address: 0.0.0.0:7051 # Whether the Peer should programmatically determine the address to bind to. # This case is useful for docker containers. addressAutoDetect: false @@ -141,7 +141,7 @@ peer: events: # The address that the Event service will be enabled on the validator - address: 0.0.0.0:31315 + address: 0.0.0.0:7053 # total number of events that could be buffered without blocking the # validator sends @@ -166,11 +166,11 @@ peer: # PKI member services properties pki: eca: - paddr: localhost:50051 + paddr: localhost:7054 tca: - paddr: localhost:50051 + paddr: localhost:7054 tlsca: - paddr: localhost:50051 + paddr: localhost:7054 tls: enabled: false rootcert: @@ -193,10 +193,10 @@ peer: # testNodes: # - node : 1 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # - node : 2 # ip : 127.0.0.1 - # port : 30303 + # port : 7051 # Should the discovered nodes and their reputations # be stored in DB and persisted between restarts diff --git a/pub/fabric-membersrvc.md b/pub/fabric-membersrvc.md index 7e0254791c6..18127716364 100644 --- a/pub/fabric-membersrvc.md +++ b/pub/fabric-membersrvc.md @@ -30,7 +30,7 @@ The corresponding docker-compose.yml for running Docker on Mac or Windows native membersrvc: image: hyperledger/fabric-membersrvc ports: - - "50051:50051" + - "7054:7054" command: membersrvc ``` @@ -60,14 +60,14 @@ The corresponding docker-compose.yml for running Docker on Mac or Windows native membersrvc: image: hyperledger/fabric-membersrvc ports: - - "50051:50051" + - "7054:7054" command: membersrvc vp0: image: hyperledger/fabric-peer ports: - "5000:5000" - - "30303:30303" - - "30304:30304" + - "7051:7051" + - "7052:7052" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock diff --git a/pub/fabric-peer.md b/pub/fabric-peer.md index 77bfeaf54dd..99d2decd1af 100644 --- a/pub/fabric-peer.md +++ b/pub/fabric-peer.md @@ -54,9 +54,9 @@ The following docker-compose.yml could be used for running Docker for Mac or Win vp0: image: hyperledger/fabric-peer ports: - - "5000:5000" - - "30303:30303" - - "30304:30304" + - "7050:7050" + - "7051:7051" + - "7052:7052" environment: - CORE_PEER_ADDRESSAUTODETECT=true - CORE_VM_ENDPOINT=unix:///var/run/docker.sock diff --git a/scripts/goUnitTests.sh b/scripts/goUnitTests.sh index 806547b4d11..824841dad3c 100755 --- a/scripts/goUnitTests.sh +++ b/scripts/goUnitTests.sh @@ -10,7 +10,7 @@ PKGS=`go list github.com/hyperledger/fabric/... | grep -v /vendor/ | grep -v /ex echo "DONE!" echo -n "Starting peer.." -CID=`docker run -dit -p 30303:30303 hyperledger/fabric-peer peer node start` +CID=`docker run -dit -p 7051:7051 hyperledger/fabric-peer peer node start` cleanup() { echo "Stopping peer.." docker kill $CID 2>&1 > /dev/null diff --git a/sdk/node/bin/run-unit-tests.sh b/sdk/node/bin/run-unit-tests.sh index 95e9735b166..e74cb5f776c 100755 --- a/sdk/node/bin/run-unit-tests.sh +++ b/sdk/node/bin/run-unit-tests.sh @@ -153,7 +153,7 @@ startExampleInDevMode() { go build fi export CORE_CHAINCODE_ID_NAME=$2 - export CORE_PEER_ADDRESS=0.0.0.0:30303 + export CORE_PEER_ADDRESS=0.0.0.0:7051 startProcess "$EXE" "${EXE}.log" "$1" } diff --git a/sdk/node/bin/test.json b/sdk/node/bin/test.json index 33994e292ba..904f47a5d93 100644 --- a/sdk/node/bin/test.json +++ b/sdk/node/bin/test.json @@ -1,7 +1,7 @@ { - "memberServicesUrl": "grpc://localhost:50051", - "peers": [ "grpc://localhost:30303" ], - "registrar": { "name": "WebAppAdmin", "secret": "DJY27pEnl16d" }, + "memberServicesUrl": "grpc://localhost:7054", + "peers": [ "grpc://localhost:7051" ], + "registrar": { "name": "WebAppAdmin", "secret": "DJY27pEnl16d" }, "numUsers": 5, "iterations": 10, "tests": [ diff --git a/sdk/node/test/unit/asset-mgmt-with-roles.js b/sdk/node/test/unit/asset-mgmt-with-roles.js index bbd9863d7fc..9ec3de5a5d5 100644 --- a/sdk/node/test/unit/asset-mgmt-with-roles.js +++ b/sdk/node/test/unit/asset-mgmt-with-roles.js @@ -39,8 +39,8 @@ function setup(cb) { console.log("initializing ..."); var chain = hfc.newChain("testChain"); chain.setKeyValStore(hfc.newFileKeyValStore("/tmp/keyValStore")); - chain.setMemberServicesUrl("grpc://localhost:50051"); - chain.addPeer("grpc://localhost:30303"); + chain.setMemberServicesUrl("grpc://localhost:7054"); + chain.addPeer("grpc://localhost:7051"); if (devMode) chain.setDevMode(true); console.log("enrolling deployer ..."); chain.enroll("WebAppAdmin", "DJY27pEnl16d", function (err, user) { diff --git a/sdk/node/test/unit/asset-mgmt.js b/sdk/node/test/unit/asset-mgmt.js index 0e3e34d6413..653dabe8ae2 100644 --- a/sdk/node/test/unit/asset-mgmt.js +++ b/sdk/node/test/unit/asset-mgmt.js @@ -51,8 +51,8 @@ var testChaincodeID; // var chain = hfc.newChain("testChain"); chain.setKeyValStore(hfc.newFileKeyValStore('/tmp/keyValStore')); -chain.setMemberServicesUrl("grpc://localhost:50051"); -chain.addPeer("grpc://localhost:30303"); +chain.setMemberServicesUrl("grpc://localhost:7054"); +chain.addPeer("grpc://localhost:7051"); // // Set the chaincode deployment mode to either developent mode (user runs chaincode) diff --git a/sdk/node/test/unit/chain-tests.js b/sdk/node/test/unit/chain-tests.js index 990159345d0..62925d4c644 100644 --- a/sdk/node/test/unit/chain-tests.js +++ b/sdk/node/test/unit/chain-tests.js @@ -43,11 +43,11 @@ var chain = hfc.newChain("testChain"); chain.setKeyValStore(hfc.newFileKeyValStore('/tmp/keyValStore')); if (fs.existsSync("tlsca.cert")) { - chain.setMemberServicesUrl("grpcs://localhost:50051", fs.readFileSync('tlsca.cert')); + chain.setMemberServicesUrl("grpcs://localhost:7054", fs.readFileSync('tlsca.cert')); } else { - chain.setMemberServicesUrl("grpc://localhost:50051"); + chain.setMemberServicesUrl("grpc://localhost:7054"); } -chain.addPeer("grpc://localhost:30303"); +chain.addPeer("grpc://localhost:7051"); // // Set the chaincode deployment mode to either developent mode (user runs chaincode) diff --git a/sdk/node/test/unit/registrar.js b/sdk/node/test/unit/registrar.js index 2131b40c98a..61489f98954 100644 --- a/sdk/node/test/unit/registrar.js +++ b/sdk/node/test/unit/registrar.js @@ -67,7 +67,7 @@ function registrarTest(cb) { var found=""; chain.setKeyValStore(hfc.newFileKeyValStore(keyValStorePath)); - chain.setMemberServicesUrl("grpc://localhost:50051"); + chain.setMemberServicesUrl("grpc://localhost:7054"); chain.enroll("admin", "Xurw3yU9zI0l", function (err, admin) { if (err) return cb(err); chain.setRegistrar(admin); @@ -127,7 +127,7 @@ function enrollAgain(cb) { fs.renameSync(keyValStorePath,keyValStorePath2); var chain = hfc.newChain("testChain2"); chain.setKeyValStore(hfc.newFileKeyValStore('/tmp/keyValStore')); - chain.setMemberServicesUrl("grpc://localhost:50051"); + chain.setMemberServicesUrl("grpc://localhost:7054"); chain.enroll("admin", "Xurw3yU9zI0l", function (err, admin) { rmdir(keyValStorePath); fs.renameSync(keyValStorePath2,keyValStorePath); diff --git a/tools/busywork/bin/README.md b/tools/busywork/bin/README.md index 9b128f6fccb..1139a94272f 100644 --- a/tools/busywork/bin/README.md +++ b/tools/busywork/bin/README.md @@ -29,10 +29,10 @@ by other major scripts or test drivers. Scripts are typically documented in a * [fabricLogger](fabricLogger) is a simple script that converts a blockchain into a text file listing of transaction IDs. - + * [networkStatus](networkStatus) is a script that reports on the status of Hyperledger fabric peer networks created with **busywork** tools, with an - option to be used as a background *watchdog* on the health of the network. + option to be used as a background *watchdog* on the health of the network. * [pprofClient](pprofClient) is a script that takes profiles from the profiling server built into the Hyperledger fabric peer. @@ -42,11 +42,11 @@ by other major scripts or test drivers. Scripts are typically documented in a networks that do not rely on Docker-compose, or multiple physical or virtual nodes. The concept of a user-mode network is discussed [below](#userModeNetwork). - + * [wait-for-it](wait-for-it) is a general-purpose script that waits for a network service to be available with an optional timeout. **busywork** applications use `wait-for-it` to correctly sequence network startup. - + ## User-Mode Networks @@ -67,13 +67,13 @@ Starting a user-mode network of 10 peers running PBFT batch consensus is as as simple as userModeNetwork 10 - + Several useful options for setting up the network are also provided. Here is an example of setting up a 4-node network with security, PBFT Batch consensus and DEBUG-level logging in the peers userModeNetwork -security -batch -peerLogging debug 4 - + Normally the peer services are available on all system network interfaces (i.e., interface 0.0.0.0). The `-interface` option can be used to limit network services to a single interface, and can also be useful for creating @@ -89,8 +89,8 @@ default configuration parameters from the command line or from a script. For example CORE_SECURITY_TCERT_BATCH_SIZE=1000 userModeNetwork -security -batch 4 - - + + ## User-Mode Caveats @@ -110,7 +110,7 @@ The mechanism used to determine when the **membersrvc** server is up and running causes a (harmless) message like the following to appear at the top of the log file: - 2016/05/19 08:23:40 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 127.0.0.1:50051->127.0.0.1:49084: write: broken pipe" + 2016/05/19 08:23:40 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: write tcp 127.0.0.1:7054->127.0.0.1:49084: write: broken pipe" @@ -132,10 +132,10 @@ used. * `fabricLog` This is a text representation of the blockchain created by the [fabricLogger](fabricLogger) process that driver scripts invoke to validate transaction execution. - + * `membersrvc/` This directory contains the **membersrvc** database (`/data` - TBD) and the `/stderr` and `/stdout` logs from the **membersrvc** server. - + * `network` The network configuration is described [below](#network). * `pprof.*` If you use the [pprofClient](pprofClient) to collect profiles the @@ -143,7 +143,7 @@ used. * `vp[0,...N]/` These directories contain the validating peer databases `/data` and their `/stderr` and `/stdout` logs. - + * `*.chain` These files are created by the [checkAgreement](checkAgreement) script, and represent the blockchains as recorded on the different peers in the network. @@ -157,7 +157,7 @@ used. object. This is still a work in progress so some fields may be changed and/or added in the future, but this is an example of what one of these network descriptions looks like at present. - + ``` { "networkMode": "user", @@ -169,7 +169,7 @@ used. "consensus": "batch", "peerProfileServer": "true", "membersrvc": - { "service": "0.0.0.0:50051", + { "service": "0.0.0.0:7054", "pid": "93244" }, "peers": [ diff --git a/tools/busywork/bin/checkAgreement b/tools/busywork/bin/checkAgreement index d30dd958589..dc706ad6641 100755 --- a/tools/busywork/bin/checkAgreement +++ b/tools/busywork/bin/checkAgreement @@ -1,13 +1,13 @@ #!/usr/bin/tclsh # Copyright IBM Corp. 2016. All Rights Reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,7 +53,7 @@ the defaults for keeping/deleting the blockchain logs. Optional parameters. Default values are given after the : -h | -help | --help : None - + Print this usage message and exit normally. -dir : N/A @@ -71,7 +71,7 @@ Optional parameters. Default values are given after the : If one of these options is specified, then the log files are either kept or deleted regardless of the outcome of the comparison. --port : 5000 +-port : 7050 The default REST API port. Only used if explicit peers are used and an explicit peer specification does not include a port specifiaction. @@ -164,7 +164,7 @@ set options { {key -dir parms(dir) {} p_dir} {bool {-dupCheck -noDupCheck} parms(dupCheck) 0} {bool {-keep -delete} parms(keep) 0 p_keep} - {key -port parms(port) 5000} + {key -port parms(port) 7050} } @@ -194,7 +194,7 @@ if {[null [parms explicitPeers]]} { } else { parms peers [addPortToHosts [parms explicitPeers] [parms port]] } - + if {([llength [parms peers]] < 2) && ([parms dupCheck] && ([llength [parms peers]] == 0))} { note {} \ @@ -259,7 +259,7 @@ if {[llength $goodPeers] > 1} { } for {set i 0; set j 1} {$j < [llength $goodPeers]} {incr i; incr j} { - + if {[catch {exec diff -q \ [lindex $goodFiles $i] \ [lindex $goodFiles $j]}]} { diff --git a/tools/busywork/bin/fabricLogger b/tools/busywork/bin/fabricLogger index ac02ed1d26c..d3ab809d90b 100755 --- a/tools/busywork/bin/fabricLogger +++ b/tools/busywork/bin/fabricLogger @@ -1,13 +1,13 @@ #!/usr/bin/tclsh # Copyright IBM Corp. 2016. All Rights Reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -66,7 +66,7 @@ Options: In -follow mode, once the end of the current blockchain is reached fabricLogger will keep polling (alternate peers) at this frequency. If this is specified as 0 then fabricLogger will aggressively poll the set of peers - as fast as possible. + as fast as possible. -from [:] : Log all (currently existing) blocks @@ -112,7 +112,7 @@ Options: this list of PIDS. This flag is used to make drivers terminate more quickly if the logger fails.. --port : 5000 +-port : 7050 The default REST API port. } @@ -139,7 +139,7 @@ set options { {bool {-timestamp -noTimestamp} parms(timestamp) 0} {bool {-force -noForce} parms(force) 0} {key -killOnError parms(killPIDs) {}} - {key -port parms(port) 5000} + {key -port parms(port) 7050} } mapKeywordArgs $argv $options parms(explicitPeers) @@ -286,22 +286,22 @@ while {1} { "$peer @ block $block: ::http::geturl failed " \ "with [parms retry] retries : $token" } - + if {[http::ncode $token] == 404} { # End of blockchain - + http::cleanup $token if {![parms follow]} {exit 0} if {[parms followPoll] == 0} break after [parms followPoll] break } - + if {[http::ncode $token] != 200} { - + # Failure - + if {$retry > 0} { if {$retry == [parms retry]} { warn {} \ @@ -311,20 +311,20 @@ while {1} { http::cleanup $token continue } - + err {} \ "REST API call to $peer for block $block failed " \ "with [parms retry] retries" httpErrorExit $token } - + if {[catch {json::json2dict [http::data $token]} parse]} { err {} "$peer @ block $block: JSON response does not parse: $parse" forceBreakOrErrorExit $token } - + if {$block != 0} { - + if {[catch {dict get $parse transactions} transactions]} { err {} \ "$peer @ block $block: " \ @@ -333,12 +333,12 @@ while {1} { } foreach tx $transactions { - + # The chaincodeID comes back as bytes so that it can be # encrypted. We don't log it or the timestamp now. The # "UUID" for type 1 (deploy) transactions is actually the # chaincode name. - + if {[catch {dict get $tx type} type]} { err {} \ "$peer @ block $block: " \ diff --git a/tools/busywork/bin/userModeNetwork b/tools/busywork/bin/userModeNetwork index 2cf8a3eb393..bdeab1ce601 100755 --- a/tools/busywork/bin/userModeNetwork +++ b/tools/busywork/bin/userModeNetwork @@ -1,13 +1,13 @@ #!/usr/bin/tclsh # Copyright IBM Corp. 2016. All Rights Reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,7 +29,7 @@ Note: Although the peers run in user mode, any chaincodes will still be deployed in Docker containers. In order for a non-root user to use Docker, the user must have been set up with this ability in advance of executing this script, and the user will also need password-less "sudo" permission to clean up -root-owned log files created by containers. +root-owned log files created by containers. Optional arguments, with defaults after the colon: @@ -104,7 +104,7 @@ Optional arguments, with defaults after the colon: This option sets the logging level for the peers in the network. The full syntax of this option is documented in the fabric documentation, and - defaults to "warning". + defaults to "warning". -membersrvcLogging : See membersrvc.yaml @@ -154,11 +154,11 @@ proc pristine {} { note {} " Killing all running and stopped Docker containers" catch {exec docker ps -a -q | xargs docker rm -f} - + # This is hard to do as an 'exec' from Tcl, so we use the Make target. note {} " Removing all chaincode containers" catch {exec make -C [busywork::bin] docker_chaincode_clean} - + # Clean out BUSYWORK_HOME. If this fails, we blindly assume that we need # sudo privledge to clean out Docker logs and try again. That may fail # too, but we forge ahead anyway, hoping everything will be OK in the end. @@ -202,7 +202,7 @@ set options { {key -peerLogging parms(peerLogging) warning} {bool -stdio parms(stdio) 0} } - + # TBD: {key -membersrvcLogging parms(membersrvcLogging) ?} mapKeywordArgs $argv $options parms(nPeers) @@ -247,7 +247,7 @@ note {} "Running with $CONSENSUS_TO_PRETTY([parms consensus]) consensus" # names are test_vp. if {[parms security]} { - + busywork::usersAndPasswordsToArray ::parms security. parms vpUsers \ [mapeach user [parms security.users] { @@ -326,7 +326,7 @@ if {[parms security]} { # Set global configuration environment options that apply to all peers and -# membersrvc. +# membersrvc. set ::env(CORE_LOGGING_LEVEL) [parms peerLogging] set ::env(CORE_VM_ENDPOINT) [busywork::dockerEndpoint] @@ -364,10 +364,10 @@ puts $config " \"consensus\": \"$CONSENSUS_TO_MODE([parms consensus])\"," puts $config " \"peerProfileServer\": \"[? [parms profile] true false]\"," # Start membersrvc and wait until the service port is responding before -# continuing. +# continuing. if {[parms security]} { - + exec mkdir -p $BUSYWORK_HOME/membersrvc if {[parms stdio]} { set caStdout {} @@ -376,10 +376,10 @@ if {[parms security]} { set caStdout >$BUSYWORK_HOME/membersrvc/stdout set caStderr 2>$BUSYWORK_HOME/membersrvc/stderr } - - # FABRIC BUG - membersrvc can only run on 50051 + + # FABRIC BUG - membersrvc can only run on 7054 #set service [first [third [first $caMap]]] - set service {x 0.0.0.0 50051} + set service {x 0.0.0.0 7054} set ::env(SERVER_PORT) :[port $service] @@ -390,12 +390,12 @@ if {[parms security]} { set pid [exec $FABRIC/membersrvc/membersrvc $caStdout $caStderr &] networkTable CA [port $service] {} {} {} {} $pid - + puts $config " \"membersrvc\":" puts $config " { \"service\": \"[server $service]\"," puts $config " \"pid\": \"$pid\"" puts $config " }," - + if {![busywork::wait-for-it [server $service] [parms startupWait]]} { errorExit \ "The membersrvc server did not start up within [parms startupWait]" @@ -413,7 +413,7 @@ puts $config " \"peers\": \[" foreach clause $peerMap { foreach {peerN peerID portMap} $clause break - + exec mkdir -p $BUSYWORK_HOME/$peerID set peerDatabase $BUSYWORK_HOME/$peerID/data if {[parms stdio]} { @@ -438,7 +438,7 @@ foreach clause $peerMap { set ::env(CORE_PEER_VALIDATOR_EVENTS_ADDRESS) [server $events] set ::env(CORE_CLI_ADDRESS) [server $cli] set ::env(CORE_PEER_PROFILE_LISTENADDRESS) [server $profile] - + if {[parms nPeers] > 1} { if {$peerN == 0} { set peer0Address [server $grpc] @@ -457,7 +457,7 @@ foreach clause $peerMap { } else { set ::env(CORE_SECURITY_ENABLED) false } - + foreach clause $portMap { close [first $clause] } diff --git a/tools/busywork/counters/driver b/tools/busywork/counters/driver index 1b18269dbb4..23af5a0cb0f 100755 --- a/tools/busywork/counters/driver +++ b/tools/busywork/counters/driver @@ -1,13 +1,13 @@ #!/usr/bin/tclsh # Copyright IBM Corp. 2016. All Rights Reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,11 +35,11 @@ Note that the list of explict peers *must* contain all peers in the network. This is required for certain important consistency and correctness checks. Use -targetPeers to limit the peers that are actually targeted by the driver if reducing the number of targeted peers is important to the test. - + Optional parameters. Default values are given after the colon: -h | -help | --help : None - + Print this usage message and exit normally. -home : See below @@ -55,9 +55,9 @@ Optional parameters. Default values are given after the colon: not on the same machine as the client driver. -targetPeers : All - + Limit the run to targeting at most the first peers. - + -security | -noSecurity : -noSecurity If -security is selected then the network is assumed to be a secure @@ -73,7 +73,7 @@ Optional parameters. Default values are given after the colon: this many of the test users will be logged in and used randomly to send transactions. By default all test users are used. --port : 5000 +-port : 7050 The default REST API port. Only used if the peer specification does not include a port specifiaction. @@ -216,7 +216,7 @@ Optional parameters. Default values are given after the colon: In -interlockAbsolute mode the script fails if any interlock is not achieved within the -interlockTimeout. In -interlockProgress mode, the driver continues to attempt interlock as long as at least 1 transaction - completes within each timeout period. + completes within each timeout period. -convergeWait : 10s -convergePoll : 1s @@ -228,9 +228,9 @@ Optional parameters. Default values are given after the colon: not start checking until there is 100% consensus on the block height. These checks must converge within the -convergeWait time. The network is polled (and the current status printed) every -convergePoll - interval. + interval. --finalWait : 10s +-finalWait : 10s Always wait this duration at the end of the run before checking the final status for correctness. Wired things can still happen even if the @@ -343,7 +343,7 @@ set options { {key -targetPeers parms(targetPeers) 0 p_targetPeers} {bool {-security -noSecurity} parms(security) 0 p_security} {key -targetUsers parms(targetUsers) 0 p_targetUsers} - {key -port parms(port) 5000} + {key -port parms(port) 7050} {key -chaincodes parms(nChaincodes) 1} {key -ccPrefix parms(ccPrefix) cc} {bool {-deploy -noDeploy} parms(deploy) 1} @@ -422,7 +422,7 @@ if {[null [parms explicitPeers]]} { "The -security/-noSecurity flags are not allowed." } else { parms security [? {[parms network.security] eq "true"} 1 0] - } + } } else { parms originalPeers [addPortToHosts [parms explicitPeers] [parms port]] } @@ -609,7 +609,7 @@ if {[parms security]} { } else { note {} "Security is disabled" - + foreach peer [parms peers] { parms $peer,userBag [RandomBag new {{}}] } @@ -638,12 +638,12 @@ proc txSummary {} { note {} "[parms clients] clients will be activated" note {} "[parms countPerArray] transaction(s) will be issued to each array" note {} "[parms totalTransactions] total transaction(s) will be issued" -} +} set chaincodePath "github.com/hyperledger/fabric/tools/busywork/counters" if {[parms deploy]} { - + set chaincodeIDs {} for {set i 0} {$i < [parms nChaincodes]} {incr i} { lappend chaincodeIDs [parms ccPrefix]$i @@ -697,7 +697,7 @@ if {[parms deploy]} { if {[waitFor [parms chaincodeWait] {ping} 1s]} { errorExit "Wait for chaincode startup timed out" } - + } else { note {} "-noDeploy mode: Getting chaincode deployments from:" @@ -931,7 +931,7 @@ for {set i 0} {$i < [parms clients]} {incr i} { } } -# Start a 'pprofClient' if requested. +# Start a 'pprofClient' if requested. if {$p_pprofClient} { if {[catch \ @@ -990,7 +990,7 @@ if {[parms interlock] && ![parms noops]} { } return [expr {[llength $heights] == 1}] } - + note {} \ "Waiting up to [parms convergeWait] for block-height consensus, " \ "polling every [parms convergePoll]" @@ -1001,12 +1001,12 @@ if {[parms interlock] && ![parms noops]} { errorExit "Aborting due to block-height consensus timeout" } } - + } # We always wait -finalWait before continuing with the checks. Wierd things # can happen even after all TX have putatively been processed. - + note {} "Waiting [parms finalWait] before collecting the final status" after [durationToMs [parms finalWait]]