第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

未能調(diào)用鏈代碼名稱:“lscc”,錯誤:事務(wù)返回失?。赫{(diào)用了未定義的合約方法

未能調(diào)用鏈代碼名稱:“lscc”,錯誤:事務(wù)返回失?。赫{(diào)用了未定義的合約方法

qq_遁去的一_1 2023-05-17 15:00:42
我正在嘗試從 fabric-samples 安裝 facar 的 java 鏈代碼,但出現(xiàn)錯誤。https://github.com/hyperledger/fabric-samples/tree/release-1.4/chaincode/fabcar/java在鏈碼上方,我正在嘗試并在鏈碼實例化期間出現(xiàn)錯誤有人可以幫助我嗎,非常感謝并提前致謝。我正在使用基本網(wǎng)絡(luò)文件夾和下面的腳本來創(chuàng)建和安裝網(wǎng)絡(luò),實例化和調(diào)用鏈代碼。#!/bin/bash## Copyright IBM Corp All Rights Reserved## SPDX-License-Identifier: Apache-2.0## Exit on first error, print all commands.set -ev# don't rewrite paths for Windows Git Bash usersexport MSYS_NO_PATHCONV=1docker-compose -f docker-compose.yml downdocker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdbdocker ps -a# wait for Hyperledger Fabric to start# incase of errors when running later commands, issue export FABRIC_START_TIMEOUT=<larger number>export FABRIC_START_TIMEOUT=10#echo ${FABRIC_START_TIMEOUT}sleep ${FABRIC_START_TIMEOUT}# Create the channeldocker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx# Join peer0.org1.example.com to the channel.docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@org1.example.com/msp" peer0.org1.example.com peer channel join -b mychannel.blockdocker-compose -f docker-compose.yml up -d clisleep 5
查看完整描述

3 回答

?
Qyouu

TA貢獻1786條經(jīng)驗 獲得超11個贊

也許你忘記了@Default裝飾器


@Contract(name = "MyContract",

        info = @Info(

                title = "My Contract",

                description = "",

                version = "0.0.1"

        )

)

@Default

public class MyContract implements ContractInterface {


查看完整回答
反對 回復(fù) 2023-05-17
?
慕標(biāo)琳琳

TA貢獻1830條經(jīng)驗 獲得超9個贊

調(diào)用了未定義的合約方法

在代碼的前幾行。這意味著您傳遞給調(diào)用的函數(shù)不存在于鏈碼中,您可以檢查鏈碼并查看 initLedger 是否存在?或者是否存在任何拼寫錯誤。希望這是有用的。


查看完整回答
反對 回復(fù) 2023-05-17
?
森林海

TA貢獻2011條經(jīng)驗 獲得超2個贊

如果您在實例化鏈碼時遇到此問題,則可以使用您的自定義實現(xiàn)覆蓋ContractInterface中給出的以下方法。


/**

 * Invoked for any transaction that does not exist.

 *

 * This will throw an exception. If you wish to alter the exception thrown or 

 * if you wish to consider requests for transactions that don't exist as not an

 * error, subclass this method.

 *

 * @param ctx the context as created by {@link #createContext(ChaincodeStub)}.

 */

default void unknownTransaction(Context ctx) {

    throw new ChaincodeException("Undefined contract method called");

}

否則,如果在調(diào)用現(xiàn)有事務(wù)時出現(xiàn)問題,則確保注釋@Transaction() 存在于事務(wù)方法中。


查看完整回答
反對 回復(fù) 2023-05-17
  • 3 回答
  • 0 關(guān)注
  • 309 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號