Documentation ¶
Index ¶
- Variables
- func AggregateStats(buck, roundsAfter, times []int64) string
- func GetSuite(suite string) abstract.Suite
- func Run(app *config.AppConfig, proto *deploy.Config)
- func RunClient(server string, nmsgs int, name string, rate int)
- func RunServer(hostname, app string, rounds int, rootwait int, debug int, testConnect bool, ...)
- func RunTimestamper(hc *config.HostConfig, nclients int, hostnameSlice ...string) ([]*Server, []*Client, error)
- type BlockReply
- type BlockRequest
- type Client
- func (c *Client) AddServer(name string, conn coconet.Conn)
- func (c *Client) Close()
- func (c *Client) Name() string
- func (c *Client) ProcessStampReply(tsm *TimeStampMessage)
- func (c *Client) PutToServer(name string, data coconet.BinaryMarshaler) error
- func (c *Client) TimeStamp(val []byte, TSServerName string) error
- type EntryReply
- type EntryRequest
- type ErrorReply
- type LogEntry
- type MessageType
- type MustReplyMessage
- type ProofReply
- type ProofRequest
- type SeqNo
- type Server
- func (s *Server) AggregateCommits(view int) []byte
- func (s *Server) Close()
- func (s *Server) ConnectToLogger()
- func (s *Server) Listen() error
- func (s *Server) ListenToClients()
- func (s *Server) LogReRun(nextRole string, curRole string)
- func (s *Server) OnAnnounce() sign.CommitFunc
- func (s *Server) OnDone() sign.DoneFunc
- func (s *Server) PutToClient(name string, data coconet.BinaryMarshaler)
- func (s *Server) Run(role string, nRounds int)
- type SignedEntry
- type StampReply
- type StampRequest
- type TimeStampMessage
Constants ¶
This section is empty.
Variables ¶
var ErrClientToTSTimeout error = errors.New("client timeouted on waiting for response")
var MAX_N_ROUNDS int = MAX_N_SECONDS / int(ROUND_TIME/time.Second)
var MAX_N_SECONDS int = 1 * 60 * 60 // 1 hours' worth of seconds
var ROUND_TIME time.Duration = sign.ROUND_TIME
time we wait between rounds
Functions ¶
func AggregateStats ¶
func RunTimestamper ¶
func RunTimestamper(hc *config.HostConfig, nclients int, hostnameSlice ...string) ([]*Server, []*Client, error)
run each host in hostnameSlice with the number of clients given
Types ¶
type BlockReply ¶
type BlockReply struct {
Dat [][]byte // Content of block(s) requested
}
type BlockRequest ¶
XXX not sure we need block requests?
type Client ¶
type Client struct { Mux sync.Mutex // coarse grained mutex Servers map[string]coconet.Conn // signing nodes I work/ communicate with // roundChan chan int // round numberd are sent in as rounds change Error error // contains filtered or unexported fields }
func (*Client) ProcessStampReply ¶
func (c *Client) ProcessStampReply(tsm *TimeStampMessage)
func (*Client) PutToServer ¶
func (c *Client) PutToServer(name string, data coconet.BinaryMarshaler) error
Send data to server given by name (data should be a timestamp request)
type EntryReply ¶
type EntryReply struct {
Log SignedEntry // Signed log entry
}
type EntryRequest ¶
type EntryRequest struct {
Seq SeqNo // Sequence number of old entry requested
}
Request to obtain an old log-entry and, optionally, a cryptographic proof that it happened before a given newer entry. The TSServer may be unable to process if Seq is beyond the retention window.
type ErrorReply ¶
type ErrorReply struct {
Msg string // Human-readable error message
}
type MessageType ¶
type MessageType int
const ( Error MessageType = iota StampRequestType StampReplyType )
type MustReplyMessage ¶
type MustReplyMessage struct { Tsm TimeStampMessage To string // name of reply destination }
struct to ease keeping track of who requires a reply after tsm is processed/ aggregated by the TSServer
type ProofReply ¶
type ProofRequest ¶
type ProofRequest struct {
Old, New SeqNo // Sequence number of old and new log records
}
Request a cryptographic Merkle proof that log-entry Old happened before New. Produces a path to a Merkle tree node containing a hash of the node itself and the root of the history values committed within the node. The TSServer may be unable to process if Old is beyond the retention window.
type Server ¶
type Server struct { sign.Signer Clients map[string]coconet.Conn Queue [][]MustReplyMessage READING int PROCESSING int // Leaves, Root and Proof for a round Leaves []hashid.HashId // can be removed after we verify protocol Root hashid.HashId Proofs []proof.Proof Logger string Hostname string App string // contains filtered or unexported fields }
func (*Server) AggregateCommits ¶
func (*Server) ConnectToLogger ¶
func (s *Server) ConnectToLogger()
func (*Server) Listen ¶
listen for clients connections this server needs to be running on a different port than the Signer that is beneath it
func (*Server) ListenToClients ¶
func (s *Server) ListenToClients()
Used for goconns should only be used if clients are created in batch
func (*Server) OnAnnounce ¶
func (s *Server) OnAnnounce() sign.CommitFunc
func (*Server) PutToClient ¶
func (s *Server) PutToClient(name string, data coconet.BinaryMarshaler)
Send message to client given by name
type SignedEntry ¶
type StampReply ¶
type StampReply struct { Sig []byte // Signature on the root Prf proof.Proof // Merkle proof of value }
func (StampReply) MarshalBinary ¶
func (Srep StampReply) MarshalBinary() ([]byte, error)
func (*StampReply) UnmarshalBinary ¶
func (Srep *StampReply) UnmarshalBinary(data []byte) error
type StampRequest ¶
type StampRequest struct {
Val []byte // Hash-size value to timestamp
}
func (StampRequest) MarshalBinary ¶
func (Sreq StampRequest) MarshalBinary() ([]byte, error)
func (*StampRequest) UnmarshalBinary ¶
func (Sreq *StampRequest) UnmarshalBinary(data []byte) error
type TimeStampMessage ¶
type TimeStampMessage struct { ReqNo SeqNo // Request sequence number // ErrorReply *ErrorReply // Generic error reply to any request Type MessageType Sreq *StampRequest Srep *StampReply }
func (TimeStampMessage) MarshalBinary ¶
func (tsm TimeStampMessage) MarshalBinary() ([]byte, error)
func (*TimeStampMessage) UnmarshalBinary ¶
func (sm *TimeStampMessage) UnmarshalBinary(data []byte) error