mirror of
https://github.com/luxfi/p2p.git
synced 2026-10-30 15:22:55 +00:00
Replace codec/jsonrpc.Uint32 with an in-package Uint32 JSON wrapper (peer/jsonnum.go). The Info struct needs a string-encoded uint32 at the JSON-RPC boundary; no broader codec dependency is needed for that. Files touched: - peer/jsonnum.go (new): Uint32 with MarshalJSON/UnmarshalJSON - peer/info.go: drop codec/jsonrpc import, use local Uint32 - peer/peer.go: drop codec/jsonrpc import, use local Uint32 go.mod direct dep on luxfi/codec removed.
29 lines
876 B
Go
29 lines
876 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package peer
|
|
|
|
import (
|
|
"net/netip"
|
|
"time"
|
|
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/math/set"
|
|
)
|
|
|
|
type Info struct {
|
|
IP netip.AddrPort `json:"ip"`
|
|
PublicIP netip.AddrPort `json:"publicIP,omitempty"`
|
|
ID ids.NodeID `json:"nodeID"`
|
|
Version string `json:"version"`
|
|
LastSent time.Time `json:"lastSent"`
|
|
LastReceived time.Time `json:"lastReceived"`
|
|
ObservedUptime Uint32 `json:"observedUptime"`
|
|
TrackedChains set.Set[ids.ID] `json:"trackedChains"`
|
|
SupportedLPs set.Set[uint32] `json:"supportedLPs"`
|
|
ObjectedLPs set.Set[uint32] `json:"objectedLPs"`
|
|
}
|