server

package
v0.0.0-...-efbb1c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2016 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HASH_BYTES = 32
	HASH_BITS  = HASH_BYTES * 8
	DB_PREFIX  = 'T'
)
View Source
const (
	PHASE_HASH_OPS = 1 + iota
	PHASE_HASH_HASHES
	PHASE_OPS
	PHASE_HASH_STATE
)
View Source
const DOWNLOAD_INTERVAL = 300 * time.Millisecond

Variables

View Source
var WO_sync = &opt.WriteOptions{Sync: true}

Functions

func MustUnmarshal

func MustUnmarshal(encoded []byte, pb proto.Message)

func NewFrontend

func NewFrontend() *frontend

func OpenServer

func OpenServer(dbpath string, sk *[ed25519.PrivateKeySize]byte,
	communicator *communicator, frontend *frontend, threshold int) (*server, error)

func StartFromConfig

func StartFromConfig(cfg *ServerConfig) *server

func StartFromConfigFile

func StartFromConfigFile(path string) *server

Types

type MerkleMap

type MerkleMap struct {
	// contains filtered or unexported fields
}

func OpenMerkleMap

func OpenMerkleMap(db mmDB) *MerkleMap

func (*MerkleMap) Flush

func (m *MerkleMap) Flush(wb *leveldb.Batch)

func (*MerkleMap) GetRootHash

func (m *MerkleMap) GetRootHash() []byte

func (*MerkleMap) Lookup

func (m *MerkleMap) Lookup(key []byte) (value []byte, proof []*ClientReply_MerklemapNode)

func (*MerkleMap) Set

func (m *MerkleMap) Set(key []byte, val []byte)

type Message

type Message struct {
	SignedServerMessage_ServerMessage
	SignedServerMessage *SignedServerMessage
}

func (*Message) Phase

func (msg *Message) Phase() int

type MessageBroker

type MessageBroker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*MessageBroker) Collect

func (mb *MessageBroker) Collect(round uint64, phase int, reminder *SignedServerMessage) chan *Message

func (*MessageBroker) Notify

func (mb *MessageBroker) Notify(round uint64, phase int) chan struct{}

func (*MessageBroker) OnReceive

func (mb *MessageBroker) OnReceive(msg *Message)

func (*MessageBroker) StartWaitingFor

func (mb *MessageBroker) StartWaitingFor(callback func(*Message) (bool, bool))

type ServerConfig

type ServerConfig struct {
	Backend struct {
		DataDirectory      string
		SigningKeyPath     string
		Listen             string // address:port
		ConsensusThreshold int
	}
	Frontend struct {
		Listen           string // address:port
		TransportKeyPath string
		InviteKeyPath    string
	}
	Server map[string]*struct {
		PublicKey string // base64 encoded
		IsCore    bool
	}
}

type ServerInfo

type ServerInfo struct {
	ID   uint64
	Addr string
	Profile_PublicKey
	IsCore bool
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL