func init() { for _, s := range []interface{}{ // Structures &Device{}, &Identity{}, &Config{}, &Storage{}, &Service{}, // API messages &CreateIdentity{}, &CreateIdentityReply{}, &ConfigUpdate{}, &ConfigUpdateReply{}, &ProposeSend{}, &ProposeUpdate{}, &ProposeUpdateReply{}, &ProposeVote{}, &Data{}, &ProposeVoteReply{}, // Internal messages &PropagateIdentity{}, &UpdateSkipBlock{}, } { network.RegisterPacketType(s) } }
func main() { network.RegisterPacketType(&Database{}) app := cli.NewApp() app.Name = "Guard" app.Usage = "Get and print status of all servers of a file." app.Flags = []cli.Flag{ cli.StringFlag{ Name: "group, gd", Value: "group.toml", Usage: "Cothority group definition in `FILE.toml`", }, cli.IntFlag{ Name: "debug, d", Value: 0, Usage: "debug-level: `integer`: 1 for terse, 5 for maximal", }, } app.Commands = []cli.Command{ { Name: "setpass", Aliases: []string{"s"}, Usage: "Setup the configuration for the server (interactive)", Action: setpass, }, { Name: "setup", Aliases: []string{"su"}, Usage: "Saves the cothority group-toml to the configuration", ArgsUsage: "Give group definition", Action: setup, }, { Name: "recover", Aliases: []string{"r"}, Usage: "Gets the password back from the guards", Action: get, }, } app.Before = func(c *cli.Context) error { b, err := ioutil.ReadFile("config.bin") if os.IsNotExist(err) { return nil } log.ErrFatal(err, "The config.bin file threw an error") _, msg, err := network.UnmarshalRegistered(b) log.ErrFatal(err, "UnmarshalRegistered messeed up") var ok bool db, ok = msg.(*Database) if !ok { log.Fatal("The message was improperly converted") } return nil } app.Run(os.Args) }
func init() { for _, r := range []interface{}{ Announcement{}, Commitment{}, Challenge{}, Response{}, } { network.RegisterPacketType(r) } }
func init() { for _, i := range []interface{}{ SecInitMsg{}, SecConfMsg{}, SigReqMsg{}, SigRespMsg{}, } { network.RegisterPacketType(i) } }
func init() { for _, i := range []interface{}{ PrePrepare{}, Prepare{}, Commit{}, Finish{}, } { network.RegisterPacketType(i) } }
func init() { for _, i := range []interface{}{ BlockAnnounce{}, NaiveBlockSignature{}, Exception{}, RoundSignatureRequest{}, RoundSignatureResponse{}, NtreeSignature{}, } { network.RegisterPacketType(i) } }
func init() { for _, i := range []interface{}{ BlockSignature{}, Announce{}, Commitment{}, ChallengePrepare{}, ChallengeCommit{}, Response{}, } { network.RegisterPacketType(i) } }
func init() { onet.RegisterMessageProxy(func() onet.MessageProxy { return new(MessageProxy) }) for _, r := range []interface{}{ Announcement{}, Commitment{}, Challenge{}, Response{}, } { network.RegisterPacketType(r) } }
func init() { var msgs = []interface{}{ // Propose &ProposeSkipBlock{}, &ProposedSkipBlockReply{}, &SetChildrenSkipBlock{}, &SetChildrenSkipBlockReply{}, // Propagation &PropagateSkipBlock{}, // Requests for data &GetUpdateChain{}, &GetUpdateChainReply{}, // Data-structures &ForwardSignature{}, &SkipBlockFix{}, &SkipBlock{}, // Own service &Service{}, } for _, m := range msgs { network.RegisterPacketType(m) } }
func init() { // register network messages and protocol network.RegisterPacketType(Message{}) network.RegisterPacketType(SignatureReply{}) onet.GlobalProtocolRegister("NaiveTree", NewProtocol) }
func init() { onet.RegisterNewService(ServiceName, newCoSiService) network.RegisterPacketType(&SignatureRequest{}) network.RegisterPacketType(&SignatureResponse{}) }
func init() { network.RegisterPacketType(PropagateMsg{}) }
func init() { network.RegisterPacketType(ciscConfig{}) }
func init() { onet.RegisterNewService(ServiceName, newSkipchainService) skipchainSID = onet.ServiceFactory.ServiceID(ServiceName) network.RegisterPacketType(&SkipBlockMap{}) }
func init() { network.RegisterPacketType(Announce{}) network.RegisterPacketType(Reply{}) onet.GlobalProtocolRegister("ExampleChannels", NewExampleChannels) }
func init() { network.RegisterPacketType(PrepareCount{}) network.RegisterPacketType(Count{}) network.RegisterPacketType(NodeIsUp{}) onet.GlobalProtocolRegister("Count", NewCount) }
func init() { network.RegisterPacketType(PrepareClose{}) network.RegisterPacketType(Close{}) onet.GlobalProtocolRegister("CloseAll", NewCloseAll) }
func init() { network.RegisterPacketType(&testData{}) }
func init() { onet.RegisterNewService(ServiceName, newIdentityService) identityService = onet.ServiceFactory.ServiceID(ServiceName) network.RegisterPacketType(&StorageMap{}) network.RegisterPacketType(&Storage{}) }
func init() { onet.RegisterNewService(ServiceName, newStatService) network.RegisterPacketType(&Request{}) network.RegisterPacketType(&Response{}) }
} } const ( // AnnouncementPhase is the ID of the Announcement message AnnouncementPhase uint32 = 1 // CommitmentPhase is the ID of the Commitment message CommitmentPhase = 2 // ChallengePhase is the ID of the Challenge message ChallengePhase = 3 // ResponsePhase is the ID of the Response message ResponsePhase = 4 ) // ProtocolPacketID is the network.PacketTypeID of the CoSi ProtocolPacket var ProtocolPacketID = network.RegisterPacketType(ProtocolPacket{}) // ProtocolPacket is the main message for the CoSi protocol which includes // every information that the CoSi protocol might need. type ProtocolPacket struct { Phase uint32 OverlayMessage *onet.OverlayMessage Ann *Announcement Comm *Commitment Chal *Challenge Resp *Response } // MessageProxy implements the onet.MessageProxy interface for the CoSi protocol.
func init() { network.RegisterPacketType(PropagateSendData{}) network.RegisterPacketType(PropagateReply{}) }
func init() { network.RegisterPacketType(ContactNodes{}) network.RegisterPacketType(Done{}) onet.GlobalProtocolRegister("Broadcast", NewBroadcastProtocol) }