harmony icon indicating copy to clipboard operation
harmony copied to clipboard

fatal error: 'bls/bls.h' file not found

Open ygcool opened this issue 3 years ago • 8 comments

image

mac M1.

go get github.com/harmony-one/go-sdk
go mod tidy

I use go-sdk to generate private keys and addresses, and offline sign transactions, and rpc calls

package main

import (
	"fmt"

	"github.com/harmony-one/go-sdk/pkg/rpc"
)

func main() {
	node := "https://rpc.s0.b.hmny.io"
	address := "one1zvtdhx0yx2uyx8ps363tx4xmn59n2twjp7dkj3"
	balanceRPCReply, err := rpc.Request(rpc.Method.GetBalance, node, []interface{}{address, "latest"})
	if err != nil {
		panic(err)
	}
	fmt.Println(balanceRPCReply["result"].(string))
}

ygcool avatar Jan 06 '22 08:01 ygcool

I have this problem too, I was wondering how did you solve it?

tobelangbowan avatar Apr 24 '22 09:04 tobelangbowan

I have this problem too, I was wondering how did you solve it?

I don't use this anymore, I use go-ethereum to create transaction signatures and queries

ygcool avatar Apr 25 '22 01:04 ygcool

I have this problem too, I was wondering how did you solve it?

I don't use this anymore, I use go-ethereum to create transaction signatures and queries thank you

tobelangbowan avatar Apr 25 '22 02:04 tobelangbowan

When I use eth's api (eth_sendRawTransaction) to perform a broadcast transaction, although the broadcast transaction is successful, the receiving address becomes 0X0, and it is not broadcast to the receiving address I specified. (eg my sending address on the test browser: one1gsaw6t7w64mh3xlntunz2h3qn5tc5sfs6tesjh ), how did you solve it?

tobelangbowan avatar Apr 25 '22 07:04 tobelangbowan

You need to convert the address starting with one to 0x address first:

import (
	"github.com/ethereum/go-ethereum/common"
	"github.com/harmony-one/go-sdk/pkg/address"
)

to, err := address.Bech32ToAddress("one1zmph0a0gky9q6shms3emafct260e8706ykj5ut")
toAddrHex = to.Hex()
toAddress := common.HexToAddress(toAddrHex)

go-ethereum code...

ygcool avatar Apr 26 '22 01:04 ygcool

I also tried this address conversion yesterday, but the problem is still the same. The problems I can think of now are 1. Are you using a self-built node or a public node (https://rpc.s0.b.hmny.io )? 2. What go mod version of go-eth are you using?

tobelangbowan avatar Apr 26 '22 01:04 tobelangbowan

  1. https://rpc.s0.b.hmny.io
  2. github.com/ethereum/go-ethereum v1.10.16

ygcool avatar Apr 26 '22 01:04 ygcool

Thanks. my mistake, I missed a step in address translation when building the transaction

tobelangbowan avatar Apr 26 '22 03:04 tobelangbowan

Closed by harmony-one/go-sdk#299

MaxMustermann2 avatar Jun 22 '23 16:06 MaxMustermann2