AlayaNetwork / Developer-Events

Community Verification Event for the Ethereum-compatible Version of PlatON | Alaya
MIT License
10 stars 17 forks source link

HackathonPLUS - Go-SDK for Platon #7

Open van-bright opened 3 years ago

van-bright commented 3 years ago
van-bright commented 3 years ago

【Issue 1】 if I want to dependency github.com/PlatONnetwork/PlatON-Go in my go project, it can not be compiled because of bls.git.

I can only compile PlatON-Go locally and then replace it in go.mod.

But for project go-ethereum, works fine to dependency.

van-bright commented 3 years ago

【Issue 2】 According to this tutorial https://geth.ethereum.org/docs/dapp/native-bindings, use the tool abigen to generate native binding for .sol file. The output .go file can not be compiled, because abi.ConvertType it is not defined.

van-bright commented 3 years ago

【Issue 3】 types.BlockNonce is defined as [81]byte, but in go-ethereum it is defined as [8]byte.

The difference makes some APIs can not be unmarshaled.

biganxin commented 3 years ago

@benbaley

benbaley commented 3 years ago

@clearly PTAL

cheng762 commented 3 years ago

【Issue 1】 if I want to dependency github.com/PlatONnetwork/PlatON-Go in my go project, it can not be compiled because of bls.git.

I can only compile PlatON-Go locally and then replace it in go.mod.

But for project go-ethereum, works fine to dependency.

你是指通过go get PlatON的方式来作为项目的dependency 无法编译吗?由于PlatON中依赖bls库,需要根据操作系统预先生成bls静态库后方可运行。

cheng762 commented 3 years ago

【Issue 2】 According to this tutorial https://geth.ethereum.org/docs/dapp/native-bindings, use the tool abigen to generate native binding for .sol file. The output .go file can not be compiled, because abi.ConvertType it is not defined.

PlatON下的abigen还没有同步更新到以太坊的最新版本,后续我们会加入支持。

cheng762 commented 3 years ago

【Issue 3】 types.BlockNonce is defined as [81]byte, but in go-ethereum it is defined as [8]byte.

The difference makes some APIs can not be unmarshaled. PlatON和以太坊的types.BlockNonce的用法不同,以太坊的BlockNonce是一个无意义的随机数,用于工作量证明,与挖矿的难度有关,PlatON的BlockNonce用作存储VRF的证明,因此两边的类型不一致,暂无兼容计划。对于该字段,除了go版本之外的sdk基本都能兼容。

biganxin commented 2 years ago

Issue feedback(600U) rewards have been issued (2021.12.29 Base Price 0.12)