From 6eccc1b1801c9326182374003499894b8e93c269 Mon Sep 17 00:00:00 2001 From: osamamagdy Date: Fri, 27 Sep 2024 19:03:39 +0300 Subject: [PATCH] rename FPC_MODE env --- ccapi/fpc-docker-compose.yaml | 2 +- ccapi/main.go | 2 +- ccapi/routes/chaincode.go | 2 +- ccapi/server/server.go | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ccapi/fpc-docker-compose.yaml b/ccapi/fpc-docker-compose.yaml index a9ee7c2..4aea2bb 100644 --- a/ccapi/fpc-docker-compose.yaml +++ b/ccapi/fpc-docker-compose.yaml @@ -23,7 +23,7 @@ services: - FABRIC_GATEWAY_ENDPOINT=peer0.org1.example.com:7051 - FABRIC_GATEWAY_NAME=peer0.org1.example.com - GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn - - FPC_MODE=true + - FPC_ENABLED=true - SGX_MODE=SIM - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 - CORE_PEER_ID=peer0.org1.example.com diff --git a/ccapi/main.go b/ccapi/main.go index bde047c..ac39d69 100644 --- a/ccapi/main.go +++ b/ccapi/main.go @@ -29,7 +29,7 @@ func main() { })) go server.Serve(r, ctx) // Events are not integrated with FPC - if os.Getenv("FPC_MODE") != "true" { + if os.Getenv("FPC_ENABLED") != "true" { // Register to chaincode events go chaincode.WaitForEvent(os.Getenv("CHANNEL"), os.Getenv("CCNAME"), "eventName", func(ccEvent *fab.CCEvent) { diff --git a/ccapi/routes/chaincode.go b/ccapi/routes/chaincode.go index a74dd85..543e9c9 100644 --- a/ccapi/routes/chaincode.go +++ b/ccapi/routes/chaincode.go @@ -9,7 +9,7 @@ import ( ) func addCCRoutes(rg *gin.RouterGroup) { - if os.Getenv("FPC_MODE") == "true" { + if os.Getenv("FPC_ENABLED") == "true" { //Use FPC Handlers rg.POST("/:channelName/:chaincodeName/invoke/:txname", handlers.InvokeFpc) rg.PUT("/:channelName/:chaincodeName/invoke/:txname", handlers.InvokeFpc) diff --git a/ccapi/server/server.go b/ccapi/server/server.go index 00a7844..4dbc5c0 100644 --- a/ccapi/server/server.go +++ b/ccapi/server/server.go @@ -26,8 +26,7 @@ func Serve(r *gin.Engine, ctx context.Context) { // Defer close sdk to clear cache and free memory defer common.CloseSDK() - if os.Getenv("FPC_MODE") == "true" { - // Initialize the default configuration + if os.Getenv("FPC_ENABLED") == "true" { common.InitFpcConfig() }