Documentation ¶
Overview ¶
Package nodeid - combines common operation on FileCoin NodeID.
NodeID is a unique identifier for a node, participating in FileCoin network operations. Example of the node might be a Retrieval Gateway or a Retrieval Provider.
Index ¶
- Constants
- func MapNodeIDToString(cids []NodeID) []string
- type NodeID
- func MapStringToNodeID(cids []string) []NodeID
- func NewNodeID(id *big.Int) (*NodeID, error)
- func NewNodeIDFromBytes(id []byte) (*NodeID, error)
- func NewNodeIDFromHexString(id string) (*NodeID, error)
- func NewNodeIDFromPublicKey(pubKey *fcrcrypto.KeyPair) (*NodeID, error)
- func NewRandomNodeID() *NodeID
- func SortClockwise(nodeID *NodeID, nodeIDs []*NodeID) []*NodeID
Constants ¶
const WordSize = 32 // the NodeID length is 32 bytes.
Variables ¶
This section is empty.
Functions ¶
func MapNodeIDToString ¶
Map - used to returns a new slice containing CIDs as string values
Types ¶
type NodeID ¶
type NodeID struct {
// contains filtered or unexported fields
}
NodeID represents a NodeID.
func MapStringToNodeID ¶
Map - used to returns a new slice containing CIDs as string values
func NewNodeIDFromBytes ¶
NewNodeIDFromBytes creates a NodeID object.
func NewNodeIDFromHexString ¶
NewNodeIDFromHexString creates a NodeID from a string.
func NewNodeIDFromPublicKey ¶
NewNodeIDFromPublicKey create a NodeID based on a public key.
func NewRandomNodeID ¶
func NewRandomNodeID() *NodeID
NewRandomNodeID creates a random NodeID object.
func SortClockwise ¶
SortClockwise sort nodeIDs in clockwise mode starting on nodeID
func (NodeID) MarshalJSON ¶
MarshalJSON is used to marshal NodeID into bytes.
func (*NodeID) UnmarshalJSON ¶
UnmarshalJSON is used to unmarshal bytes into NodeID.