harmony
harmony copied to clipboard
fatal error: 'bls/bls.h' file not found
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))
}
I have this problem too, I was wondering how did you solve it?
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
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
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?
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...
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?
- https://rpc.s0.b.hmny.io
- github.com/ethereum/go-ethereum v1.10.16
Thanks. my mistake, I missed a step in address translation when building the transaction
Closed by harmony-one/go-sdk#299