Documentation
¶
Overview ¶
Example ¶
Example illustrates nodes comparing.
logger := logrus.New() logger.Level = logrus.FatalLevel nodes := node.NewNodeList(3, logger) stop := nodes.StartRandTxStream() nodes.WaitForBlock(5) stop() for _, n := range nodes { n.Stop() } // give some time for nodes to stop actually time.Sleep(time.Duration(5) * time.Second) diffResult := Compare(nodes.Values()...) if !diffResult.IsEmpty() { // TODO: uncomment after refactoring //logger.Fatal("\n" + diffResult.ToString()) } fmt.Println("all good")
Output: all good
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diff ¶
type Diff struct { Err error `json:"-"` IDs [2]uint64 BlocksGap int64 `json:",omitempty"` FirstBlockIndex int64 `json:",omitempty"` RoundGap int64 `json:",omitempty"` FirstRoundIndex int64 `json:",omitempty"` Description string `json:"-"` // contains filtered or unexported fields }
Diff contains and prints differences details
func (*Diff) AddDescription ¶
AddDescription appends description to the diff
Click to show internal directories.
Click to hide internal directories.