mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Cleans up the code and pushes the smart contract implementation down into a `chaincode` package. This is in prep for implementing unit testing in the chaincode, as you cannot mock code that is part of the main package. Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
23 lines
528 B
Go
23 lines
528 B
Go
/*
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/hyperledger/fabric-contract-api-go/contractapi"
|
|
"github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode"
|
|
)
|
|
|
|
func main() {
|
|
assetChaincode, err := contractapi.NewChaincode(&chaincode.SmartContract{})
|
|
if err != nil {
|
|
log.Panicf("Error create asset-transfer-basic chaincode: %v", err)
|
|
}
|
|
|
|
if err := assetChaincode.Start(); err != nil {
|
|
log.Panicf("Error starting asset-transfer-basic chaincode: %v", err)
|
|
}
|
|
}
|