go-conflux-sdk
go-conflux-sdk copied to clipboard
Conflux Golang API
This change is [](https://reviewable.io/reviews/conflux-chain/go-conflux-sdk/190)
BTW, is `WaitForTransationReceipt()` a typo?
split client interface to seperated smaller interface use rpc namespace name be sub level same with full-node remove internal contract related codes, it will readd after abi-gen completed --- This...
just like GetEpochReceiptsByPivotBlockHash
No we have to do the reconnection on pubsub subscription connection cutoff in application side.
cfx := sdk.NewClient(...) clientSub, err := cfx.SubscribeNewHeads(...) for { select clientSub->Error(): // channel not notified even the internet is cut off for a while .... }
As @boqiu metioned in https://github.com/Conflux-Dev/conflux-infura/pull/69#discussion_r655829246, sdk should provide some common way for client application to check if the return error is some specific error. ``` epochReceipts, err := cfx.GetEpochReceiptsByPivotBlockHash(pivotHash) if...
Currently, it is very hard for client to handle the errors returned by SDK. So, SDK could provide API to map error message to error code or return error code...
Now, a **god** interface `ClientOperator` is defined for all RPCs/APIs. Suggest to separate interfaces for different kinds of purpose: 1. public rpc: `Cfx` 2. local rpc: `LocalCfx`, or use namespace...