Skip to content

Commit

Permalink
feat: remove hardcoded org name
Browse files Browse the repository at this point in the history
  • Loading branch information
osamamagdy committed Dec 5, 2024
1 parent e58549b commit 3cc85d3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions samples/application/ccapi/common/fpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func InitFpcConfig() {
defaultFpcConfig = &pkgFpc.Config{
CorePeerAddress: getStrEnv("CORE_PEER_ADDRESS"),
CorePeerId: getStrEnv("CORE_PEER_ID"),
CorePeerOrgName: getStrEnv("CORE_PEER_ORG_NAME"),
CorePeerLocalMSPID: getStrEnv("CORE_PEER_LOCALMSPID"),
CorePeerMSPConfigPath: getStrEnv("CORE_PEER_MSPCONFIGPATH"),
CorePeerTLSCertFile: getStrEnv("CORE_PEER_TLS_CERT_FILE"),
Expand Down
6 changes: 4 additions & 2 deletions samples/application/ccapi/fpc-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- SGX_MODE=SIM
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ORG_NAME=org1
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/fabric/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
- CORE_PEER_TLS_CERT_FILE=/fabric/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
Expand Down Expand Up @@ -59,13 +60,14 @@ services:
- DOMAIN=example.com
- CHANNEL=mychannel
- CCNAME=cc-tools-demo
- FABRIC_GATEWAY_ENDPOINT=peer0.org2.example.com:7051
- FABRIC_GATEWAY_ENDPOINT=peer0.org2.example.com:9051
- FABRIC_GATEWAY_NAME=peer0.org2.example.com
- GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn
- FPC_MODE=true
- SGX_MODE=SIM
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_ADDRESS=peer0.org2.example.com:9051
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_ORG_NAME=org2
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_MSPCONFIGPATH=/fabric/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp
- CORE_PEER_TLS_CERT_FILE=/fabric/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.crt
Expand Down
1 change: 1 addition & 0 deletions samples/application/ccapi/fpcUtils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package fpcUtils
type Config struct {
CorePeerAddress string
CorePeerId string
CorePeerOrgName string
CorePeerLocalMSPID string
CorePeerMSPConfigPath string
CorePeerTLSCertFile string
Expand Down
2 changes: 1 addition & 1 deletion samples/application/ccapi/fpcUtils/fpcadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewAdmin(config *Config) *Admin {
//defer sdk.Close()

orgAdmin := "Admin"
orgName := "org1"
orgName := config.CorePeerOrgName
adminContext := sdk.Context(fabsdk.WithUser(orgAdmin), fabsdk.WithOrg(orgName))

client, err := fpcmgmt.New(adminContext)
Expand Down
1 change: 1 addition & 0 deletions samples/application/simple-cli-go/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func initConfig() {
config = &pkg.Config{
CorePeerAddress: getStrEnv("CORE_PEER_ADDRESS"),
CorePeerId: getStrEnv("CORE_PEER_ID"),
CorePeerOrgName: getStrEnv("CORE_PEER_ORG_NAME"),
CorePeerLocalMSPID: getStrEnv("CORE_PEER_LOCALMSPID"),
CorePeerMSPConfigPath: getStrEnv("CORE_PEER_MSPCONFIGPATH"),
CorePeerTLSCertFile: getStrEnv("CORE_PEER_TLS_CERT_FILE"),
Expand Down
1 change: 1 addition & 0 deletions samples/application/simple-cli-go/pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package pkg
type Config struct {
CorePeerAddress string
CorePeerId string
CorePeerOrgName string
CorePeerLocalMSPID string
CorePeerMSPConfigPath string
CorePeerTLSCertFile string
Expand Down
2 changes: 1 addition & 1 deletion samples/application/simple-cli-go/pkg/fpcadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewAdmin(config *Config) *Admin {
//defer sdk.Close()

orgAdmin := "Admin"
orgName := "org1"
orgName := config.CorePeerOrgName
adminContext := sdk.Context(fabsdk.WithUser(orgAdmin), fabsdk.WithOrg(orgName))

client, err := fpcmgmt.New(adminContext)
Expand Down

0 comments on commit 3cc85d3

Please sign in to comment.