Skip to content

Commit 5bc5227

Browse files
committed
FAB-1763 Rename **TEST_CHAINID** to test_chainid
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]>
1 parent add2776 commit 5bc5227

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

bddtests/features/bootstrap.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ Feature: Bootstrap
131131

132132
Examples: Orderer Options
133133
| ComposeFile | Waittime | OrdererSystemChainId |PolicyType | ConsensusType |
134-
| docker-compose-next-4.yml | 60 | **TEST_CHAINID** |unanimous | solo |
134+
| docker-compose-next-4.yml | 60 | test_chainid |unanimous | solo |

bddtests/steps/bootstrap_impl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def step_impl(context, chainId):
8484
@given(u'the orderer admins use the genesis block for chain "{chainId}" to configure orderers')
8585
def step_impl(context, chainId):
8686
pass
87-
#raise NotImplementedError(u'STEP: Given the orderer admins use the genesis block for chain "**TEST_CHAINID**" to configure orderers')
87+
#raise NotImplementedError(u'STEP: Given the orderer admins use the genesis block for chain "test_chainid" to configure orderers')
8888

8989
@given(u'the ordererBootstrapAdmin generates a GUUID to identify the orderer system chain and refer to it by name as "{ordererSystemChainId}"')
9090
def step_impl(context, ordererSystemChainId):

bddtests/steps/orderer_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from common.common_pb2 import Payload
3737

3838
# The default chain ID when the system is statically bootstrapped for testing
39-
TEST_CHAIN_ID = "**TEST_CHAINID**"
39+
TEST_CHAIN_ID = "test_chainid"
4040

4141
def _defaultDataFunction(index):
4242
payload = common_pb2.Payload(

common/util/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func ArrayToChaincodeArgs(args []string) [][]byte {
144144
return bargs
145145
}
146146

147-
const testchainid = "**TEST_CHAINID**"
147+
const testchainid = "test_chainid"
148148
const testorgid = "**TEST_ORGID**"
149149

150150
//GetTestChainID returns the CHAINID constant in use by orderer

docs/channel-setup.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ peer node start --peer-defaultchain=false
9292
```
9393

9494
```
95-
"--peer-defaultchain=true" is the default. It allow users continue to work with the default **TEST_CHAINID** without having to join a chain.
95+
"--peer-defaultchain=true" is the default. It allow users continue to work with the default "test_chainid" without having to join a chain.
9696
97-
"--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.
97+
"--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.
9898
9999
To join channels, a peer MUST be started with the "--peer-defaultchain=false" option.
100100
```

examples/ccchecker/ccchecker.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{"Chaincodes":
22
[
33
{"Name": "mycc",
4-
"InitArgs":[""],
4+
"InitArgs":[""],
55
"Path": "github.com/hyperledger/fabric/examples/ccchecker/chaincodes/newkeyperinvoke",
66
"NumFinalQueryAttempts": 10,
77
"NumberOfInvokes": 10,
@@ -14,5 +14,5 @@
1414
}
1515
],
1616
"TimeoutToAbortSecs": 60,
17-
"ChainName": "**TEST_CHAINID**"
17+
"ChainName": "test_chainid"
1818
}

orderer/common/bootstrap/provisional/provisional.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const (
4949
// networks. It it necessary to set and export this variable so that test
5050
// clients can connect without being rejected for targetting a chain which
5151
// does not exist.
52-
TestChainID = "**TEST_CHAINID**"
52+
TestChainID = "test_chainid"
5353

5454
// AcceptAllPolicyKey is the key of the AcceptAllPolicy.
5555
AcceptAllPolicyKey = "AcceptAllPolicy"

peer/node/start.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func startCmd() *cobra.Command {
5656
flags.BoolVarP(&chaincodeDevMode, "peer-chaincodedev", "", false,
5757
"Whether peer in chaincode development mode")
5858
flags.BoolVarP(&peerDefaultChain, "peer-defaultchain", "", true,
59-
"Whether to start peer with chain **TEST_CHAINID**")
59+
"Whether to start peer with chain test_chainid")
6060

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

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

200-
//this brings up all the chains (including **TEST_CHAINID**)
200+
//this brings up all the chains (including test_chainid)
201201
peer.Initialize(startDeliveryService)
202202

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

0 commit comments

Comments
 (0)