Conversation
cairo/api.go
Outdated
| Err *jsonrpc.Error `json:"err"` | ||
| } | ||
|
|
||
| // 不是很确定这里是不是其实不需要request的内容,直接response |
Contributor
There was a problem hiding this comment.
Pls use English to write comments and you use fixme: as the beginning of the comment if you are not sure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目前还没写:
GetStateUpdate,Syncing,TraceTransaction,traceBlockTransactions假如改动
type StarknetRPC struct:然后相应的在
NewStarknetRPC方法中初始化:就会让
之类的方法写起来很简单,但我不太知道**哪些时候能直接调用juno的函数**。我有点迷糊yu和juno的关系,itachi是以yu为链然后来跟cairoVM交互的吗,所以查询链上数据的时候用yu的函数?比如yu的
GetEndBlock那么这样的话是否是这样的一个流程:
在methods.go文件下写rpc的实现
然后在api.go下
然后再在cairo.go里面注册一个reading方法.
traceBlockTransactions: juno用来追踪transaction的方法,其中要求starknet version小于0.12.3,我看starknet已经更新到0.13.1.1了,这个version是定义在core.Block的Header里面的,我没在yu的header里找到这个字段,这个限制是必要的吗然后这个
forceFeederTracesForBlocks我看到mainnet有预定义一长串的blocknumber,其他网络都没有,不太清楚为什么这些预定义的区块要强制tracefeeder.Client还没细看,如果要用到的话是否要用network里的feeder url自己实现一个feeder client?我看juno代码理解的是找feeder client获取trace。
fetchTraces-->feederClient.BlockTrace-->buildQueryString对我来说难点主要在于找到yu框架中对应的方法来复刻juno这个流程。
然后juno维护了一个traceCache,这个要做吗?(倒是做起来很简单,StarknetRPC结构体里面加一个*lru.Cache[traceCacheKey, []TracedBlockTransaction]就行)
juno的Block里的ParentHash是否就是yu的PrevHash?
state是一个stateReader,这个其实也是能直接用bcreader就很方便。
Syncing()其实也是一样的问题,不知道能不能用juno的syncreader,能用最简单。GetStateUpdate()也是用bcreader最方便。