@@ -96,7 +96,7 @@ var users = hfc.getConfigSetting('users');
96
96
97
97
var transType = uiContent . transType ;
98
98
var nRequest = parseInt ( uiContent . nRequest ) ;
99
- var nThread = parseInt ( uiContent . nThread ) ;
99
+ var nProc = parseInt ( uiContent . nProc ) ;
100
100
var tCurr ;
101
101
102
102
@@ -109,7 +109,7 @@ var tx_id = null;
109
109
var nonce = null ;
110
110
111
111
var the_user = null ;
112
- var g_len = nThread ;
112
+ var g_len = nProc ;
113
113
114
114
var cfgtxFile ;
115
115
var allEventhubs = [ ] ;
@@ -731,15 +731,17 @@ function pushMSP(client, msps) {
731
731
console . log ( '[pushMSP] key: %s, ORGS[key].mspid: %s' , key , ORGS [ key ] . mspid ) ;
732
732
if ( key . indexOf ( 'orderer' ) === 0 ) {
733
733
var msp = { } ;
734
+ var comName = ORGS [ key ] . comName ;
734
735
msp . id = ORGS [ key ] . mspid ;
735
- msp . rootCerts = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/ordererOrganizations/example.com /msp/' , 'cacerts' ) ) ;
736
- msp . admin = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/ordererOrganizations/example.com /msp/' , 'admincerts' ) ) ;
736
+ msp . rootCerts = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/ordererOrganizations/' + comName + ' /msp/', 'cacerts' ) ) ;
737
+ msp . admin = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/ordererOrganizations/' + comName + ' /msp/', 'admincerts' ) ) ;
737
738
msps . push ( client . newMSP ( msp ) ) ;
738
739
} else if ( key . indexOf ( 'org' ) === 0 ) {
739
740
var msp = { } ;
741
+ var comName = ORGS [ key ] . comName ;
740
742
msp . id = ORGS [ key ] . mspid ;
741
- msp . rootCerts = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/peerOrganizations/' + key + '.example.com /msp/' , 'cacerts' ) ) ;
742
- msp . admin = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/peerOrganizations/' + key + '.example.com /msp/' , 'admincerts' ) ) ;
743
+ msp . rootCerts = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/peerOrganizations/' + key + '.' + comName + ' /msp/', 'cacerts' ) ) ;
744
+ msp . admin = readAllFiles ( path . join ( ORGS [ key ] . mspPath + '/peerOrganizations/' + key + '.' + comName + ' /msp/', 'admincerts' ) ) ;
743
745
msps . push ( client . newMSP ( msp ) ) ;
744
746
}
745
747
}
@@ -755,42 +757,8 @@ function createOneChannel(client, org) {
755
757
756
758
clientNewOrderer ( client , org ) ;
757
759
758
- var ACCEPT_ALL = {
759
- identities : [ ] ,
760
- policy : {
761
- '0-of' : [ ]
762
- }
763
- } ;
764
-
765
-
766
- var test_input3 = {
767
- channel : {
768
- name : channelName ,
769
- consortium : 'SampleConsortium' ,
770
- peers : {
771
- organizations : [ {
772
- id : ORGS [ 'org1' ] . name ,
773
- //msp : { mspid : 'Org1MSP'},
774
- policies : {
775
-
776
- }
777
- } , {
778
- id : ORGS [ 'org2' ] . name ,
779
- //msp : { mspid : 'Org2MSP'},
780
- policies : {
781
-
782
- }
783
- } ] ,
784
- policies : {
785
- Admins : { threshold : 'MAJORITY' } ,
786
- Writers : { threshold : 'ANY' } ,
787
- Readers : { threshold : 'ANY' } ,
788
- } ,
789
- }
790
- }
791
- } ;
792
-
793
760
var config = null ;
761
+ var envelope_bytes = null ;
794
762
var signatures = [ ] ;
795
763
var msps = [ ] ;
796
764
var key ;
@@ -804,18 +772,6 @@ function createOneChannel(client, org) {
804
772
} )
805
773
. then ( ( store ) => {
806
774
client . setStateStore ( store ) ;
807
- return testUtil . getOrderAdminSubmitter ( client , org , svcFile ) ;
808
- } )
809
- . then ( ( admin ) => {
810
- console . log ( '[createOneChannel] Successfully enrolled user \'admin\' for orderer' ) ;
811
- //console.log('test_input3: ', test_input3);
812
- //console.log('orderer: ', orderer);
813
- //console.log('msps: ', msps);
814
- return client . buildChannelConfig ( test_input3 , orderer , msps ) ;
815
- } ) . then ( ( config_bytes ) => {
816
- console . log ( '\n***\n built config \n***\n' ) ;
817
- console . log ( 'Successfully built config update' ) ;
818
- config = config_bytes ;
819
775
820
776
key = 'org1' ;
821
777
username = ORGS [ key ] . username ;
@@ -824,8 +780,13 @@ function createOneChannel(client, org) {
824
780
return testUtil . getSubmitter ( username , secret , client , true , key , svcFile ) ;
825
781
} ) . then ( ( admin ) => {
826
782
//the_user = admin;
827
- console . log ( '[createOneChannel] admin : ' , admin ) ;
828
783
console . log ( '[createOneChannel] Successfully enrolled user \'admin\' for' , key ) ;
784
+ var channelTX = channelOpt . channelTX ;
785
+ console . log ( '[createOneChannel] channelTX: ' , channelTX ) ;
786
+ envelope_bytes = fs . readFileSync ( channelTX ) ;
787
+ config = client . extractChannelConfig ( envelope_bytes ) ;
788
+ console . log ( '[createOneChannel] Successfull extracted the config update from the configtx envelope: ' , channelTX ) ;
789
+
829
790
var signature = client . signChannelConfig ( config ) ;
830
791
console . log ( '[createOneChannel] Successfully signed config update: ' , key ) ;
831
792
// collect signature from org1 admin
@@ -1190,7 +1151,7 @@ function performance_main() {
1190
1151
}
1191
1152
} else if ( transType . toUpperCase ( ) == 'INVOKE' ) {
1192
1153
// spawn off processes for transactions
1193
- for ( var j = 0 ; j < nThread ; j ++ ) {
1154
+ for ( var j = 0 ; j < nProc ; j ++ ) {
1194
1155
var workerProcess = child_process . spawn ( 'node' , [ './pte-execRequest.js' , j , Nid , uiFile , tStart , org ] ) ;
1195
1156
1196
1157
workerProcess . stdout . on ( 'data' , function ( data ) {
0 commit comments