package
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Jul 24, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package node is a fundamental part of networking system. Each node has:
- one real insolar address (IP or any other transport protocol address)
- multiple abstract insolar IDs (either node's own or ones belonging to relayed nodes)
Contains structures to describe insolar entities in code.
Usage:
originAddress, err := node.NewAddress(address)
if err != nil {
...
}
origin, err := node.NewOrigin(nil, originAddress)
if err != nil {
...
}
Address is node's real insolar address.
NewAddress is constructor.
Equal checks if address is equal to another.
ID is node id.
NewID returns random node id.
NewIDs returns given number of random node ids.
Equal checks if id is equal to another.
String is a base58-encoded string representation of node id.
Node is the over-the-wire representation of a node.
NewNode creates a new Node for bootstrapping.
Equal checks if node equals to other node (e.g. nodes' IDs and insolar addresses match).
String representation of Node.
type Origin struct {
IDs []ID
Address *Address
}
Origin is “self” variant of Node.
Unlike ordinary node it can have multiple IDs.
NewOrigin creates origin node from list of ids and insolar address.
Contains checks if origin node “contains” insolar node.
It checks if node's and origin's addresses match and node's id is in origin's ids list.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.