本文整理汇总了Golang中github.com/dedis/cothority/sda.TreeNodeInstance.Roster方法的典型用法代码示例。如果您正苦于以下问题:Golang TreeNodeInstance.Roster方法的具体用法?Golang TreeNodeInstance.Roster怎么用?Golang TreeNodeInstance.Roster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/dedis/cothority/sda.TreeNodeInstance
的用法示例。
在下文中一共展示了TreeNodeInstance.Roster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewBFTCoSiProtocol
// NewBFTCoSiProtocol returns a new bftcosi struct
func NewBFTCoSiProtocol(n *sda.TreeNodeInstance, verify VerificationFunction) (*ProtocolBFTCoSi, error) {
// initialize the bftcosi node/protocol-instance
bft := &ProtocolBFTCoSi{
TreeNodeInstance: n,
suite: n.Suite(),
prepare: cosi.NewCosi(n.Suite(), n.Private()),
commit: cosi.NewCosi(n.Suite(), n.Private()),
verifyChan: make(chan bool),
doneProcessing: make(chan bool, 2),
doneSigning: make(chan bool, 1),
verificationFun: verify,
AggregatedPublic: n.Roster().Aggregate,
threshold: int(2.0 * math.Ceil(float64(len(n.Tree().List()))/3.0)),
}
// register channels
if err := n.RegisterChannel(&bft.announceChan); err != nil {
return nil, err
}
if err := n.RegisterChannel(&bft.commitChan); err != nil {
return nil, err
}
if err := n.RegisterChannel(&bft.challengePrepareChan); err != nil {
return nil, err
}
if err := n.RegisterChannel(&bft.challengeCommitChan); err != nil {
return nil, err
}
if err := n.RegisterChannel(&bft.responseChan); err != nil {
return nil, err
}
n.OnDoneCallback(bft.nodeDone)
return bft, nil
}