Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the error = [libproviders.so: cannot open shared object file: No such file or directory] #224

Open
hljie opened this issue Mar 18, 2024 · 0 comments

Comments

@hljie
Copy link

hljie commented Mar 18, 2024

根据文档安装了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
`

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
}

`

也就是说测试的结果是正确的,但是会提示最上面的错误,是什么导致的,我应该怎么做?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant