Documentation
¶
Overview ¶
Copyright 2017 Mosaic Networks Ltd
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Mosaic Networks Ltd ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Mosaic Networks Ltd ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 Mosaic Networks Ltd ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Config
- type Core
- func (c *Core) Diff(known map[int]int) (head string, events []hg.Event, err error)
- func (c *Core) FromWire(wireEvents []hg.WireEvent) ([]hg.Event, error)
- func (c *Core) GetConsensusEvents() []string
- func (c *Core) GetConsensusEventsCount() int
- func (c *Core) GetConsensusTransactions() ([][]byte, error)
- func (c *Core) GetConsensusTransactionsCount() int
- func (c *Core) GetEvent(hash string) (hg.Event, error)
- func (c *Core) GetEventTransactions(hash string) ([][]byte, error)
- func (c *Core) GetHead() (hg.Event, error)
- func (c *Core) GetLastCommitedRoundEventsCount() int
- func (c *Core) GetLastConsensusRoundIndex() *int
- func (c *Core) GetUndeterminedEvents() []string
- func (c *Core) ID() int
- func (c *Core) Init() error
- func (c *Core) InsertEvent(event hg.Event) error
- func (c *Core) Known() map[int]int
- func (c *Core) PubKey() []byte
- func (c *Core) RunConsensus() error
- func (c *Core) SignAndInsertSelfEvent(event hg.Event) error
- func (c *Core) Sync(otherHead string, unknown []hg.WireEvent, payload [][]byte) error
- func (c *Core) ToWire(events []hg.Event) ([]hg.WireEvent, error)
- type Node
- type PeerSelector
- type RandomPeerSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HeartbeatTimeout time.Duration
TCPTimeout time.Duration
CacheSize int
Logger *logrus.Logger
}
func DefaultConfig ¶
func DefaultConfig() *Config
func TestConfig ¶
type Core ¶
func (*Core) GetConsensusEvents ¶
func (*Core) GetConsensusEventsCount ¶
func (*Core) GetConsensusTransactions ¶
func (*Core) GetConsensusTransactionsCount ¶
func (*Core) GetEventTransactions ¶
func (*Core) GetLastCommitedRoundEventsCount ¶
func (*Core) GetLastConsensusRoundIndex ¶
func (*Core) GetUndeterminedEvents ¶
func (*Core) RunConsensus ¶
type PeerSelector ¶
type RandomPeerSelector ¶
type RandomPeerSelector struct {
// contains filtered or unexported fields
}
func NewRandomPeerSelector ¶
func NewRandomPeerSelector(participants []net.Peer, localAddr string) *RandomPeerSelector
func (*RandomPeerSelector) Next ¶
func (ps *RandomPeerSelector) Next() net.Peer
func (*RandomPeerSelector) Peers ¶
func (ps *RandomPeerSelector) Peers() []net.Peer
func (*RandomPeerSelector) UpdateLast ¶
func (ps *RandomPeerSelector) UpdateLast(peer string)