Skip to content

Commit

Permalink
FAB-1763 Rename **TEST_CHAINID** to test_chainid
Browse files Browse the repository at this point in the history
Chainid becomes database name in CouchDB.

CouchDB naming conventions:

Only lowercase characters (a-z), digits (0-9), and any of the
characters _, $, (, ), +, -, and / are allowed. Must begin
with a letter.

Therefore, we either need to adopt these same restrictions for
chainid naming, or have a deterministic mapping of chainid to
a valid (and unique) CouchDB database name.

The complete fix will be delivered in FAB-1764.  In FAB-1763
we simply change '**TEST_CHAINID**' to 'test_chainid' in order
to unblock current failures.

Change-Id: Id274b37f5a07813b172db0e695ec803e63a09726
Signed-off-by: denyeart <[email protected]>
  • Loading branch information
denyeart committed Jan 19, 2017
1 parent add2776 commit 5bc5227
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bddtests/features/bootstrap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ Feature: Bootstrap

Examples: Orderer Options
| ComposeFile | Waittime | OrdererSystemChainId |PolicyType | ConsensusType |
| docker-compose-next-4.yml | 60 | **TEST_CHAINID** |unanimous | solo |
| docker-compose-next-4.yml | 60 | test_chainid |unanimous | solo |
2 changes: 1 addition & 1 deletion bddtests/steps/bootstrap_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def step_impl(context, chainId):
@given(u'the orderer admins use the genesis block for chain "{chainId}" to configure orderers')
def step_impl(context, chainId):
pass
#raise NotImplementedError(u'STEP: Given the orderer admins use the genesis block for chain "**TEST_CHAINID**" to configure orderers')
#raise NotImplementedError(u'STEP: Given the orderer admins use the genesis block for chain "test_chainid" to configure orderers')

@given(u'the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "{ordererSystemChainId}"')
def step_impl(context, ordererSystemChainId):
Expand Down
2 changes: 1 addition & 1 deletion bddtests/steps/orderer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from common.common_pb2 import Payload

# The default chain ID when the system is statically bootstrapped for testing
TEST_CHAIN_ID = "**TEST_CHAINID**"
TEST_CHAIN_ID = "test_chainid"

def _defaultDataFunction(index):
payload = common_pb2.Payload(
Expand Down
2 changes: 1 addition & 1 deletion common/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func ArrayToChaincodeArgs(args []string) [][]byte {
return bargs
}

const testchainid = "**TEST_CHAINID**"
const testchainid = "test_chainid"
const testorgid = "**TEST_ORGID**"

//GetTestChainID returns the CHAINID constant in use by orderer
Expand Down
4 changes: 2 additions & 2 deletions docs/channel-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ peer node start --peer-defaultchain=false
```

```
"--peer-defaultchain=true" is the default. It allow users continue to work with the default **TEST_CHAINID** without having to join a chain.
"--peer-defaultchain=true" is the default. It allow users continue to work with the default "test_chainid" without having to join a chain.
"--peer-defaultchain=false" starts the peer with only the channels that were joined by the peer. If the peer never joined a channel it would start up without any channels. In particular, it does not have the default **TEST_CHAINID** support.
"--peer-defaultchain=false" starts the peer with only the channels that were joined by the peer. If the peer never joined a channel it would start up without any channels. In particular, it does not have the default "test_chainid" support.
To join channels, a peer MUST be started with the "--peer-defaultchain=false" option.
```
Expand Down
4 changes: 2 additions & 2 deletions examples/ccchecker/ccchecker.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{"Chaincodes":
[
{"Name": "mycc",
"InitArgs":[""],
"InitArgs":[""],
"Path": "github.com/hyperledger/fabric/examples/ccchecker/chaincodes/newkeyperinvoke",
"NumFinalQueryAttempts": 10,
"NumberOfInvokes": 10,
Expand All @@ -14,5 +14,5 @@
}
],
"TimeoutToAbortSecs": 60,
"ChainName": "**TEST_CHAINID**"
"ChainName": "test_chainid"
}
2 changes: 1 addition & 1 deletion orderer/common/bootstrap/provisional/provisional.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const (
// networks. It it necessary to set and export this variable so that test
// clients can connect without being rejected for targetting a chain which
// does not exist.
TestChainID = "**TEST_CHAINID**"
TestChainID = "test_chainid"

// AcceptAllPolicyKey is the key of the AcceptAllPolicy.
AcceptAllPolicyKey = "AcceptAllPolicy"
Expand Down
6 changes: 3 additions & 3 deletions peer/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func startCmd() *cobra.Command {
flags.BoolVarP(&chaincodeDevMode, "peer-chaincodedev", "", false,
"Whether peer in chaincode development mode")
flags.BoolVarP(&peerDefaultChain, "peer-defaultchain", "", true,
"Whether to start peer with chain **TEST_CHAINID**")
"Whether to start peer with chain test_chainid")

return nodeStartCmd
}
Expand Down Expand Up @@ -183,7 +183,7 @@ func serve(args []string) error {
panic(fmt.Sprintf("Unable to create genesis block for [%s] due to [%s]", chainID, err))
}

//this creates **TEST_CHAINID** and and sets up gossip
//this creates test_chainid and sets up gossip
if err = peer.CreateChainFromBlock(block); err == nil {
fmt.Printf("create chain [%s]", chainID)
chaincode.DeploySysCCs(chainID)
Expand All @@ -197,7 +197,7 @@ func serve(args []string) error {
}
}

//this brings up all the chains (including **TEST_CHAINID**)
//this brings up all the chains (including test_chainid)
peer.Initialize(startDeliveryService)

logger.Infof("Starting peer with ID=%s, network ID=%s, address=%s",
Expand Down

0 comments on commit 5bc5227

Please sign in to comment.