From cd71ca90beb8d19e5f3ad46d3de341a923e39011 Mon Sep 17 00:00:00 2001 From: grapebaba <281165273@qq.com> Date: Thu, 4 Aug 2016 13:40:52 +0800 Subject: [PATCH] Remove dead code in genesis pkg No invocation path found for config.go in genesis package, After remove config.go, the genesisBlock item in config file is also no needed. Change-Id: I093ef40027a67e1070bdc0fde6e8edcf6f34dd2e Signed-off-by: grapebaba <281165273@qq.com> --- core/chaincode/chaincodetest.yaml | 14 ------- core/ledger/genesis/config.go | 42 ------------------- core/ledger/genesis/genesis.go | 3 +- core/ledger/genesis/genesis_test.yaml | 15 ------- core/rest/rest_test.yaml | 3 -- .../go/asset_management02/asset.yaml | 15 ------- .../go/asset_management_with_roles/asset.yaml | 15 ------- membersrvc/ca/ca_test.yaml | 17 -------- peer/core.yaml | 3 -- 9 files changed, 1 insertion(+), 126 deletions(-) delete mode 100644 core/ledger/genesis/config.go diff --git a/core/chaincode/chaincodetest.yaml b/core/chaincode/chaincodetest.yaml index 48197d052ca..63b7983de97 100644 --- a/core/chaincode/chaincodetest.yaml +++ b/core/chaincode/chaincodetest.yaml @@ -408,20 +408,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - - # Deploy chaincodes into the genesis block - chaincodes: - - #sample_syscc: - # path: github.com/hyperledger/fabric/core/system_chaincode/sample_syscc - # type: GOLANG - # constructor: - # args: - # - greetings - # - hello world - # Setting the deploy-system-chaincode property to false will prevent the # deploying of system chaincode at genesis time. deploy-system-chaincode: false diff --git a/core/ledger/genesis/config.go b/core/ledger/genesis/config.go deleted file mode 100644 index f425c4dd221..00000000000 --- a/core/ledger/genesis/config.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright IBM Corp. 2016 All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package genesis - -import ( - "sync" - - "github.com/spf13/viper" -) - -var loadConfigOnce sync.Once - -var genesis map[string]interface{} - -func initConfigs() { - loadConfigOnce.Do(func() { loadConfigs() }) -} - -func loadConfigs() { - genesisLogger.Info("Loading configurations...") - genesis = viper.GetStringMap("ledger.blockchain.genesisBlock") - genesisLogger.Info("Configurations loaded: genesis=%s", genesis) -} - -func getGenesis() map[string]interface{} { - initConfigs() - return genesis -} diff --git a/core/ledger/genesis/genesis.go b/core/ledger/genesis/genesis.go index a376bb33c27..340125a8115 100644 --- a/core/ledger/genesis/genesis.go +++ b/core/ledger/genesis/genesis.go @@ -28,8 +28,7 @@ var genesisLogger = logging.MustGetLogger("genesis") var makeGenesisError error var once sync.Once -// MakeGenesis creates the genesis block based on configuration in core.yaml -// and adds it to the blockchain. +// MakeGenesis creates the genesis block and adds it to the blockchain. func MakeGenesis() error { once.Do(func() { ledger, err := ledger.GetLedger() diff --git a/core/ledger/genesis/genesis_test.yaml b/core/ledger/genesis/genesis_test.yaml index 496f52b5d3a..7a1010a7680 100644 --- a/core/ledger/genesis/genesis_test.yaml +++ b/core/ledger/genesis/genesis_test.yaml @@ -211,21 +211,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - - # Deploy chaincodes into the genesis block - chaincode: - path: github.com/hyperledger/fabric/core/example/chaincode/chaincode_example01 - type: GOLANG - constructor: - func: init - args: - - alice - - "4" - - bob - - "10" - state: # Control the number state deltas that are maintained. This takes additional diff --git a/core/rest/rest_test.yaml b/core/rest/rest_test.yaml index 06d937d07af..8393e7332ff 100644 --- a/core/rest/rest_test.yaml +++ b/core/rest/rest_test.yaml @@ -344,9 +344,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - state: # Control the number state deltas that are maintained. This takes additional diff --git a/examples/chaincode/go/asset_management02/asset.yaml b/examples/chaincode/go/asset_management02/asset.yaml index e74bb53ff1b..1b6257ea53b 100755 --- a/examples/chaincode/go/asset_management02/asset.yaml +++ b/examples/chaincode/go/asset_management02/asset.yaml @@ -422,21 +422,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - - # Deploy chaincodes into the genesis block - # chaincode: - # path: github.com/hyperledger/fabric/core/example/chaincode/chaincode_example01 - # type: GOLANG - # constructor: - # func: init - # args: - # - alice - # - "4" - # - bob - # - "10" - # Setting the deploy-system-chaincode property to false will prevent the # deploying of system chaincode at genesis time. deploy-system-chaincode: false diff --git a/examples/chaincode/go/asset_management_with_roles/asset.yaml b/examples/chaincode/go/asset_management_with_roles/asset.yaml index 145c5a36ecd..6abc7eeb91c 100644 --- a/examples/chaincode/go/asset_management_with_roles/asset.yaml +++ b/examples/chaincode/go/asset_management_with_roles/asset.yaml @@ -397,21 +397,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - - # Deploy chaincodes into the genesis block - # chaincode: - # path: github.com/hyperledger/fabric/core/example/chaincode/chaincode_example01 - # type: GOLANG - # constructor: - # func: init - # args: - # - alice - # - "4" - # - bob - # - "10" - # Setting the deploy-system-chaincode property to false will prevent the # deploying of system chaincode at genesis time. deploy-system-chaincode: false diff --git a/membersrvc/ca/ca_test.yaml b/membersrvc/ca/ca_test.yaml index 4c93f95e6ec..2dcc8bb2637 100644 --- a/membersrvc/ca/ca_test.yaml +++ b/membersrvc/ca/ca_test.yaml @@ -265,23 +265,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - - # Deploy chaincodes into the genesis block - # chaincode: - # - id: - # url: github.com/hyperledger/fabric/core/example/chaincode/chaincode_example01 - # version: 0.1.0 - # type: GOLANG - # constructor: - # func: init - # args: - # - alice - # - "4" - # - bob - # - "10" - state: # Control the number state deltas that are maintained. This takes additional diff --git a/peer/core.yaml b/peer/core.yaml index 9eb132ba02c..9dcac2814e1 100644 --- a/peer/core.yaml +++ b/peer/core.yaml @@ -335,9 +335,6 @@ ledger: blockchain: - # Define the genesis block - genesisBlock: - state: # Control the number state deltas that are maintained. This takes additional