Open hljie opened 8 months ago
根据文档安装了bcos-c-sdk,运行go run main.go会提示: go run main.go the error = [libproviders.so: cannot open shared object file: No such file or directory] false
go run main.go the error = [libproviders.so: cannot open shared object file: No such file or directory] false
这是我的main.go `
package main import ( "context" "encoding/hex" "fmt" "log" "github.com/FISCO-BCOS/go-sdk/v3/client" "github.com/ethereum/go-ethereum/common" "backend/contract" "math/big" ) func main() { privateKey, _ := hex.DecodeString("f0b814c21021be9553c23dc3960032847511d13c76b7d5abf613829c0880b924") config := &client.Config{IsSMCrypto: false, GroupID: "group0", PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./ca.crt", TLSKeyFile: "./sdk.key", TLSCertFile: "./sdk.crt"} client, err := client.DialContext(context.Background(), config) if err != nil { fmt.Print("client error") log.Fatal(err) } //创建合约对象,合约地址和合约.go文件 //NewCertificates(address common.Address, backend bind.ContractBackend) (*Certificates, error) //address:0x6849f21d1e455e9f0712b1e99fa4fcd23758e8f1 cerAddress := common.HexToAddress("0x6849f21d1e455e9f0712b1e99fa4fcd23758e8f1") certificates, err := contract.NewCertificates(cerAddress, client) if err != nil { fmt.Print("contract error") log.Fatal(err) } ID := big.NewInt(1) isExists, err := certificates.CertificateIDExists(nil, ID) fmt.Print(isExists) // 输出false }
`
也就是说测试的结果是正确的,但是会提示最上面的错误,是什么导致的,我应该怎么做?
根据文档安装了bcos-c-sdk,运行go run main.go会提示:
go run main.go the error = [libproviders.so: cannot open shared object file: No such file or directory] false
这是我的main.go `
`
也就是说测试的结果是正确的,但是会提示最上面的错误,是什么导致的,我应该怎么做?