-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change secret-keeper-go makefile
Signed-off-by: chenchanglew <[email protected]>
- Loading branch information
1 parent
e432083
commit c7028ec
Showing
4 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
Copyright 2020 Intel Corporation | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/hyperledger/fabric-chaincode-go/shim" | ||
"github.com/hyperledger/fabric-contract-api-go/contractapi" | ||
fpc "github.com/hyperledger/fabric-private-chaincode/ecc_go/chaincode" | ||
"github.com/hyperledger/fabric-private-chaincode/samples/chaincode/secret-keeper-go/chaincode" | ||
) | ||
|
||
func main() { | ||
|
||
ccid := os.Getenv("CHAINCODE_PKG_ID") | ||
addr := os.Getenv("CHAINCODE_SERVER_ADDRESS") | ||
|
||
// create chaincode | ||
secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) | ||
chaincode := fpc.NewPrivateChaincode(secretChaincode) | ||
|
||
// start chaincode as a service | ||
server := &shim.ChaincodeServer{ | ||
CCID: ccid, | ||
Address: addr, | ||
CC: chaincode, | ||
TLSProps: shim.TLSProperties{ | ||
Disabled: true, // just for testing good enough | ||
}, | ||
} | ||
|
||
if err := server.Start(); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
Copyright 2020 Intel Corporation | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/hyperledger/fabric-chaincode-go/shim" | ||
"github.com/hyperledger/fabric-contract-api-go/contractapi" | ||
fpc "github.com/hyperledger/fabric-private-chaincode/ecc_go/chaincode" | ||
"github.com/hyperledger/fabric-private-chaincode/samples/chaincode/secret-keeper-go/chaincode" | ||
) | ||
|
||
func main() { | ||
|
||
ccid := os.Getenv("CHAINCODE_PKG_ID") | ||
addr := os.Getenv("CHAINCODE_SERVER_ADDRESS") | ||
|
||
// create chaincode | ||
secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) | ||
// chaincode := fpc.NewPrivateChaincode(secretChaincode) | ||
skvsChaincode := fpc.NewSkvsChaincode(secretChaincode) | ||
|
||
// start chaincode as a service | ||
server := &shim.ChaincodeServer{ | ||
CCID: ccid, | ||
Address: addr, | ||
CC: skvsChaincode, | ||
TLSProps: shim.TLSProperties{ | ||
Disabled: true, // just for testing good enough | ||
}, | ||
} | ||
|
||
if err := server.Start(); err != nil { | ||
panic(err) | ||
} | ||
} |