mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 07:53:47 +00:00
feat: define traceContentLookupRes
This commit is contained in:
parent
12cbf8de50
commit
6ef3b11b69
2 changed files with 18 additions and 0 deletions
|
|
@ -46,6 +46,22 @@ type ContentInfo struct {
|
||||||
UtpTransfer bool `json:"utpTransfer"`
|
UtpTransfer bool `json:"utpTransfer"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TraceContentResult struct {
|
||||||
|
Content string `json:"content"`
|
||||||
|
UtpTransfer bool `json:"utpTransfer"`
|
||||||
|
Trace Trace `json:"trace"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Trace struct {
|
||||||
|
Origin string `json:"origin"` // local node id
|
||||||
|
TargetId string `json:"targetId"` // target content id
|
||||||
|
ReceivedFrom string `json:"receivedFrom"` // the node id of which content from
|
||||||
|
Responses map[string]ContentInfo `json:"responses"` // the node id and there response
|
||||||
|
Metadata map[string]any `json:"metadata"` // node id and there metadata object
|
||||||
|
StartedAtMs int `json:"startedAtMs"` // timestamp of the beginning of this request in milliseconds
|
||||||
|
Cancelled []string `json:"cancelled"` // the node ids which are send but cancelled
|
||||||
|
}
|
||||||
|
|
||||||
type Enrs struct {
|
type Enrs struct {
|
||||||
Enrs []string `json:"enrs"`
|
Enrs []string `json:"enrs"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1499,6 +1499,8 @@ func (p *PortalProtocol) contentLookupWorker(n *enode.Node, contentKey []byte, r
|
||||||
return wrapedNode, nil
|
return wrapedNode, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// func (p *PortalProtocol) traceContentLookupWorker()
|
||||||
|
|
||||||
func (p *PortalProtocol) ToContentId(contentKey []byte) []byte {
|
func (p *PortalProtocol) ToContentId(contentKey []byte) []byte {
|
||||||
return p.toContentId(contentKey)
|
return p.toContentId(contentKey)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue