diff --git a/fabric-client/lib/Chain.js b/fabric-client/lib/Chain.js index 952a2b4f46..97b3d430de 100644 --- a/fabric-client/lib/Chain.js +++ b/fabric-client/lib/Chain.js @@ -784,16 +784,11 @@ var Chain = class { */ loadConfigEnvelope(config_envelope) { logger.debug('loadConfigEnvelope - start'); - logger.debug('loadConfigEnvelope - Config channel_header.type :: %s', config_envelope.config.header.type); - logger.debug('loadConfigEnvelope - Config channel_header.tx_id :: %s', config_envelope.config.header.tx_id); - logger.debug('loadConfigEnvelope - Config channel_header.version :: %s', config_envelope.config.header.version); - let channel = config_envelope.config.channel; - logger.debug('loadConfigEnvelope - Channel version :: %s', channel.version); - logger.debug('loadConfigEnvelope - Channel mod policy :: %s', channel.mod_policy); + let group = config_envelope.config.channel_group; var found_MSPs = []; //save all the MSP's found - this.loadConfigGroup(channel, 'base', found_MSPs, true, false); + this.loadConfigGroup(group, 'base', found_MSPs, true, false); this._msp_manager.loadMSPs(found_MSPs); } diff --git a/fabric-client/lib/protos/common/configtx.proto b/fabric-client/lib/protos/common/configtx.proto index 50a621570a..614ed7a976 100644 --- a/fabric-client/lib/protos/common/configtx.proto +++ b/fabric-client/lib/protos/common/configtx.proto @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// XXX This is the older mechanism for specifying channel configuration -// it is intended to be removed once there is no more dependency on it. - syntax = "proto3"; import "common.proto"; @@ -65,8 +62,8 @@ message ConfigPolicySchema {} // Config represents the config for a particular channel message Config { - ChannelHeader header = 1; - ConfigGroup channel = 2; + uint64 sequence = 1; + ConfigGroup channel_group = 2; } message ConfigUpdateEnvelope { @@ -84,7 +81,7 @@ message ConfigUpdateEnvelope { // 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected // 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal message ConfigUpdate { - ChannelHeader header = 1; // Header scopes the update to a particular Channel + string channel_id = 1; // Which channel this config update is for ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions } diff --git a/test/fixtures/channel/configtx.yaml b/test/fixtures/channel/configtx.yaml index e0812e4134..dcec8416e8 100644 --- a/test/fixtures/channel/configtx.yaml +++ b/test/fixtures/channel/configtx.yaml @@ -146,7 +146,7 @@ Orderer: &OrdererDefaults OrdererType: solo Addresses: - - 127.0.0.1:7050 + - orderer:7050 # Batch Timeout: The amount of time to wait before creating a batch BatchTimeout: 10s @@ -170,7 +170,7 @@ Orderer: &OrdererDefaults # Brokers: A list of Kafka brokers to which the orderer connects # NOTE: Use IP:port notation Brokers: - - 127.0.0.1:9092 + - orderer:9092 # Organizations is the list of orgs which are defined as participants on # the orderer side of the network diff --git a/test/fixtures/channel/docker-compose.yaml b/test/fixtures/channel/docker-compose.yaml index 9c9b7ca937..e99f520f68 100644 --- a/test/fixtures/channel/docker-compose.yaml +++ b/test/fixtures/channel/docker-compose.yaml @@ -56,7 +56,6 @@ services: - CORE_PEER_ENDORSER_ENABLED=true - CORE_PEER_ID=peer0 - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/configtx/crypto-config/peerOrganizations/peerOrg1/peers/peerOrg1Peer1/ working_dir: /opt/gopath/src/github.com/hyperledger/fabric @@ -86,7 +85,6 @@ services: - CORE_PEER_ENDORSER_ENABLED=true - CORE_PEER_ID=peer1 - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/configtx/crypto-config/peerOrganizations/peerOrg1/peers/peerOrg1Peer2/ working_dir: /opt/gopath/src/github.com/hyperledger/fabric @@ -117,7 +115,6 @@ services: - CORE_PEER_ENDORSER_ENABLED=true - CORE_PEER_ID=peer2 - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org2MSP - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/configtx/crypto-config/peerOrganizations/peerOrg2/peers/peerOrg2Peer1/ working_dir: /opt/gopath/src/github.com/hyperledger/fabric @@ -149,7 +146,6 @@ services: - CORE_PEER_ENDORSER_ENABLED=true - CORE_PEER_ID=peer3 - CORE_PEER_PROFILE_ENABLED=true - - CORE_PEER_COMMITTER_LEDGER_ORDERER=orderer:7050 - CORE_PEER_LOCALMSPID=Org2MSP - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/configtx/crypto-config/peerOrganizations/peerOrg2/peers/peerOrg2Peer2/ working_dir: /opt/gopath/src/github.com/hyperledger/fabric diff --git a/test/fixtures/channel/mychannel.tx b/test/fixtures/channel/mychannel.tx index 2cfa781504..388807ece2 100644 Binary files a/test/fixtures/channel/mychannel.tx and b/test/fixtures/channel/mychannel.tx differ diff --git a/test/fixtures/channel/twoorgs.orderer.block b/test/fixtures/channel/twoorgs.orderer.block index a26b119164..d1e95068f4 100644 Binary files a/test/fixtures/channel/twoorgs.orderer.block and b/test/fixtures/channel/twoorgs.orderer.block differ diff --git a/test/integration/get-config.js b/test/integration/get-config.js index e33bc4a81d..8470fb7194 100644 --- a/test/integration/get-config.js +++ b/test/integration/get-config.js @@ -46,8 +46,8 @@ var _ccProposalProto = grpc.load(__dirname + '/../../fabric-client/lib/protos/pe var _ccEventProto = grpc.load(__dirname + '/../../fabric-client/lib/protos/peer/chaincodeevent.proto').protos; var client = new hfc(); -// IMPORTANT ------>>>>> MUST RUN new-chain.js FIRST -var chain_id = 'foo'; +// IMPORTANT ------>>>>> MUST RUN e2e/create-channel.js FIRST +var chain_id = 'mychannel'; var chain = client.newChain(chain_id); var webUser = null; @@ -94,8 +94,13 @@ test(' ---->>>>> get config <<<<<-----', function(t) { t.pass('Chain was successfully initialized'); var orgs = chain.getOrganizationUnits(); logger.debug(' Got the following orgs back %j', orgs); - t.equals(orgs.length, 1, 'Checking the that we got back the right number of orgs'); - t.equals(orgs[0].id, 'DEFAULT', 'Checking the org name'); + t.equals(orgs.length, 2, 'Checking the that we got back the right number of orgs'); + if(orgs[0].id.indexOf('Org') == 0) { + t.pass('Found the org name '+ orgs[0].id); + } + else { + t.fail('Did not find the org name of \'org\' :: found ' + orgs[0].id); + } t.end(); }, function(err) {