Skip to content

Commit 3cc85d3

Browse files
committed
feat: remove hardcoded org name
1 parent e58549b commit 3cc85d3

File tree

7 files changed

+10
-4
lines changed

7 files changed

+10
-4
lines changed

samples/application/ccapi/common/fpc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func InitFpcConfig() {
4242
defaultFpcConfig = &pkgFpc.Config{
4343
CorePeerAddress: getStrEnv("CORE_PEER_ADDRESS"),
4444
CorePeerId: getStrEnv("CORE_PEER_ID"),
45+
CorePeerOrgName: getStrEnv("CORE_PEER_ORG_NAME"),
4546
CorePeerLocalMSPID: getStrEnv("CORE_PEER_LOCALMSPID"),
4647
CorePeerMSPConfigPath: getStrEnv("CORE_PEER_MSPCONFIGPATH"),
4748
CorePeerTLSCertFile: getStrEnv("CORE_PEER_TLS_CERT_FILE"),

samples/application/ccapi/fpc-docker-compose.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ services:
2727
- SGX_MODE=SIM
2828
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2929
- CORE_PEER_ID=peer0.org1.example.com
30+
- CORE_PEER_ORG_NAME=org1
3031
- CORE_PEER_LOCALMSPID=Org1MSP
3132
- CORE_PEER_MSPCONFIGPATH=/fabric/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
3233
- CORE_PEER_TLS_CERT_FILE=/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
@@ -59,13 +60,14 @@ services:
5960
- DOMAIN=example.com
6061
- CHANNEL=mychannel
6162
- CCNAME=cc-tools-demo
62-
- FABRIC_GATEWAY_ENDPOINT=peer0.org2.example.com:7051
63+
- FABRIC_GATEWAY_ENDPOINT=peer0.org2.example.com:9051
6364
- FABRIC_GATEWAY_NAME=peer0.org2.example.com
6465
- GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn
6566
- FPC_MODE=true
6667
- SGX_MODE=SIM
67-
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
68+
- CORE_PEER_ADDRESS=peer0.org2.example.com:9051
6869
- CORE_PEER_ID=peer0.org2.example.com
70+
- CORE_PEER_ORG_NAME=org2
6971
- CORE_PEER_LOCALMSPID=Org2MSP
7072
- CORE_PEER_MSPCONFIGPATH=/fabric/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
7173
- CORE_PEER_TLS_CERT_FILE=/fabric/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.crt

samples/application/ccapi/fpcUtils/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package fpcUtils
99
type Config struct {
1010
CorePeerAddress string
1111
CorePeerId string
12+
CorePeerOrgName string
1213
CorePeerLocalMSPID string
1314
CorePeerMSPConfigPath string
1415
CorePeerTLSCertFile string

samples/application/ccapi/fpcUtils/fpcadmin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewAdmin(config *Config) *Admin {
4242
//defer sdk.Close()
4343

4444
orgAdmin := "Admin"
45-
orgName := "org1"
45+
orgName := config.CorePeerOrgName
4646
adminContext := sdk.Context(fabsdk.WithUser(orgAdmin), fabsdk.WithOrg(orgName))
4747

4848
client, err := fpcmgmt.New(adminContext)

samples/application/simple-cli-go/cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func initConfig() {
5656
config = &pkg.Config{
5757
CorePeerAddress: getStrEnv("CORE_PEER_ADDRESS"),
5858
CorePeerId: getStrEnv("CORE_PEER_ID"),
59+
CorePeerOrgName: getStrEnv("CORE_PEER_ORG_NAME"),
5960
CorePeerLocalMSPID: getStrEnv("CORE_PEER_LOCALMSPID"),
6061
CorePeerMSPConfigPath: getStrEnv("CORE_PEER_MSPCONFIGPATH"),
6162
CorePeerTLSCertFile: getStrEnv("CORE_PEER_TLS_CERT_FILE"),

samples/application/simple-cli-go/pkg/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package pkg
99
type Config struct {
1010
CorePeerAddress string
1111
CorePeerId string
12+
CorePeerOrgName string
1213
CorePeerLocalMSPID string
1314
CorePeerMSPConfigPath string
1415
CorePeerTLSCertFile string

samples/application/simple-cli-go/pkg/fpcadmin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewAdmin(config *Config) *Admin {
4242
//defer sdk.Close()
4343

4444
orgAdmin := "Admin"
45-
orgName := "org1"
45+
orgName := config.CorePeerOrgName
4646
adminContext := sdk.Context(fabsdk.WithUser(orgAdmin), fabsdk.WithOrg(orgName))
4747

4848
client, err := fpcmgmt.New(adminContext)

0 commit comments

Comments
 (0)