Commit dad7a9d3 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

reassign port numbers to 7050-7-60 range

reassign port numbers to 7050-7060 range to avoid conflicts with
Windows port usage (5000). Fixes #2283
https://github.com/hyperledger/fabric/issues/2283



Port assignments as follows:
7050 REST
7051 peer gRPC
7052 peer CLI
7053 peer events
7054 eCAP
7055 eCAA
7056 tCAP
7057 tCAA
7058 tlsCAP
7059 tlsCAA

NOTE: when this PR lands, it will require people to rebuild their Vagrant
development environment(s), so we will want to make an announcement.

Also @bcbrock recommended that we eventually seek a block of ports from IANA.
We should hold off on that until we sort out Consensus next.

Change-Id: I1e54d45589e155a69a2a779b1dac447d5473cf03
Signed-off-by: default avatarChristopher Ferris <chrisfer@us.ibm.com>
parent 1c982e87
......@@ -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
......@@ -5,4 +5,4 @@ vp0:
environment:
- CORE_PEER_ID=vp0
ports:
- 31315:31315
- 7053:7053
......@@ -5,6 +5,5 @@ vp0:
environment:
- CORE_PEER_ID=vp0
- CORE_PEER_PROFILE_ENABLED=true
ports:
- 5000:6060
ports:
- 7050:6060
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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:
......
......@@ -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:
......
......@@ -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
......@@ -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
......@@ -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
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
......@@ -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
......
......@@ -25,7 +25,7 @@ import sys, requests, json
import bdd_test_util
CORE_REST_PORT = 5000
CORE_REST_PORT = 7050
JSONRPC_VERSION = "2.0"
class ContainerData:
......
......@@ -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.
......
......@@ -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
......
......@@ -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 abstract class ChaincodeBase {
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 abstract class ChaincodeBase {
}
} 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 abstract class ChaincodeBase {
chatWithPeer(connection);
logger.trace("chatWithPeer DONE");
};
new Thread(chaincode).start();
new Thread(chaincode).start();
}
public ManagedChannel newPeerClientConnection() {
......@@ -110,11 +110,11 @@ public abstract class ChaincodeBase {
} 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 abstract class ChaincodeBase {
}
}
}
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 @@ public abstract class ChaincodeBase {
}
return ret;
}
protected ByteString queryHelper(ChaincodeStub stub, String function, String[] args) {
ByteString ret = queryRaw(stub, function, args);
if (ret == null) {
......@@ -221,4 +221,4 @@ public abstract class ChaincodeBase {
}
return ret;
}
}
\ No newline at end of file
}
......@@ -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() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment