LIVYA SUSILO
LIVYA SUSILO

Reputation: 21

Chaincode installation on peer0.org1 has failed

I try to run hyperledger fabric test network with deploying chaincode.

then I run this command on my ubuntu (based on hyperledger documentation)

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

but there something went wrong. Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "assetTransfer.go:10:2: cannot find module providing package github.com/Hyperledger/fabric-contract-api-go/v2/contractapi: import lookup disabled by -mod=readonly assetTransfer.go:11:2: cannot find module providing package github.com/Hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode: import lookup disabled by -mod=readonly " what's going on? and how to solve the error?

this is path to assetTransfer.go file in fabric-sample \\wsl.localhost\Ubuntu\home\livyasusilo\go\src\github.com\LivyaSusilo-71190456\fabric-samples\asset-transfer-basic\chaincode-go\assetTransfer.go

and this is path to contractapi directory, but there's no assetTransfer.go file, is the file is necessary on contractapi directory?

\\wsl.localhost\Ubuntu\home\livyasusilo\go\src\github.com\LivyaSusilo-71190456\fabric-contract-api-go\contractapi

assetTransfer.go

/*
SPDX-License-Identifier: Apache-2.0
*/

package main

import (
    "log"

    "github.com/Hyperledger/fabric-contract-api-go/v2/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 creating asset-transfer-basic chaincode: %v", err)
    }

    if err := assetChaincode.Start(); err != nil {
        log.Panicf("Error starting asset-transfer-basic chaincode: %v", err)
    }
}

how to solve this? import lookup-go/chaincode: import lo disabled by -mod=readonly

Upvotes: 0

Views: 67

Answers (0)

Related Questions