Documentation ¶
Index ¶
- Constants
- Variables
- func Keccak256(data ...[]byte) []byte
- type BlsConsensusAccountProvider
- func (b *BlsConsensusAccountProvider) Generate() (account consensus_interface.ConsensusAccount, err error)
- func (b *BlsConsensusAccountProvider) Load() (account consensus_interface.ConsensusAccount, err error)
- func (b *BlsConsensusAccountProvider) ProvideAccount() (consensus_interface.ConsensusAccount, error)
- func (b *BlsConsensusAccountProvider) Save() (err error)
- type CachedPrivateGenerator
- type CommunityManager
- type DefaultCommunityManager
- func (d *DefaultCommunityManager) AddSubscriberNewOutgoingMessageEvent(sub transport_interface.NewOutgoingMessageEventSubscriber)
- func (d *DefaultCommunityManager) AddSubscriberPeerJoinedEvent(sub og_interface.PeerJoinedEventSubscriber)
- func (d *DefaultCommunityManager) AddSubscriberPeerLeftEvent(sub og_interface.PeerLeftEventSubscriber)
- func (d *DefaultCommunityManager) GetPeerConnectedEventChannel() chan *transport_interface.PeerEvent
- func (d *DefaultCommunityManager) GetPeerDisconnectedEventChannel() chan *transport_interface.PeerEvent
- func (d *DefaultCommunityManager) InitDefault()
- func (d *DefaultCommunityManager) Name() string
- func (d *DefaultCommunityManager) NewIncomingMessageEventChannel() chan *transport_interface.IncomingLetter
- func (d *DefaultCommunityManager) SendPing(peer string)
- func (d *DefaultCommunityManager) Start()
- func (d *DefaultCommunityManager) StaticSetup()
- func (d *DefaultCommunityManager) Stop()
- type LedgerAccountLocalStorage
- type LocalLedgerAccountProvider
- func (l *LocalLedgerAccountProvider) Generate() (account *og_interface.OgLedgerAccount, err error)
- func (l *LocalLedgerAccountProvider) Load() (account *og_interface.OgLedgerAccount, err error)
- func (l *LocalLedgerAccountProvider) ProvideAccount() (*og_interface.OgLedgerAccount, error)
- func (l *LocalLedgerAccountProvider) Save() (err error)
- func (l *LocalLedgerAccountProvider) SetAccount(account *og_interface.OgLedgerAccount)
- type LocalTransportAccountProvider
- func (l *LocalTransportAccountProvider) Account() *transport_interface.TransportAccount
- func (l *LocalTransportAccountProvider) Generate() (account *transport_interface.TransportAccount, err error)
- func (l *LocalTransportAccountProvider) Load() (account *transport_interface.TransportAccount, err error)
- func (l *LocalTransportAccountProvider) ProvideAccount() (*transport_interface.TransportAccount, error)
- func (l *LocalTransportAccountProvider) Save() (err error)
- func (l *LocalTransportAccountProvider) SetAccount(account *transport_interface.TransportAccount)
- type NetworkIdConverter
- type OGResourceFetcher
- type OgAddressConverter
- type OgEngine
- func (o *OgEngine) AddSubscriberNewHeightDetectedEvent(sub og_interface.NewHeightDetectedEventSubscriber)
- func (o *OgEngine) AddSubscriberNewOutgoingMessageEvent(sub transport_interface.NewOutgoingMessageEventSubscriber)
- func (o *OgEngine) CurrentHeight() int64
- func (o *OgEngine) EventChannelPeerJoined() chan *og_interface.PeerJoinedEvent
- func (o *OgEngine) GetBenchmarks() map[string]interface{}
- func (o *OgEngine) GetNetworkId() string
- func (o *OgEngine) InitDefault()
- func (o *OgEngine) Name() string
- func (o *OgEngine) NewIncomingMessageEventChannel() chan *transport_interface.IncomingLetter
- func (o *OgEngine) Start()
- func (o *OgEngine) StaticSetup()
- func (o *OgEngine) Stop()
- type OgNetworkIdConverter
- type TransportAccountLocalStorage
- type TransportAccountProvider
Constants ¶
View Source
const EngineCheckIntervalSeconds = 1
Variables ¶
View Source
var PingCheckIntervalSeconds = 1
View Source
var Protocol = "og/1.0.0"
Functions ¶
Types ¶
type BlsConsensusAccountProvider ¶
type BlsConsensusAccountProvider struct { BackFilePath string // contains filtered or unexported fields }
func (*BlsConsensusAccountProvider) Generate ¶
func (b *BlsConsensusAccountProvider) Generate() (account consensus_interface.ConsensusAccount, err error)
func (*BlsConsensusAccountProvider) Load ¶
func (b *BlsConsensusAccountProvider) Load() (account consensus_interface.ConsensusAccount, err error)
func (*BlsConsensusAccountProvider) ProvideAccount ¶
func (b *BlsConsensusAccountProvider) ProvideAccount() (consensus_interface.ConsensusAccount, error)
func (*BlsConsensusAccountProvider) Save ¶
func (b *BlsConsensusAccountProvider) Save() (err error)
type CachedPrivateGenerator ¶
type CachedPrivateGenerator struct { Refresh bool Reader io.Reader // contains filtered or unexported fields }
func (*CachedPrivateGenerator) GeneratePair ¶
type CommunityManager ¶
type CommunityManager interface { }
type DefaultCommunityManager ¶
type DefaultCommunityManager struct { NodeInfoProvider og_interface.NodeInfoProvider PhysicalCommunicator *transport.PhysicalCommunicator KnownPeerListFilePath string // contains filtered or unexported fields }
DefaultCommunityManager manages relationship with other peers. It keeps the community with a stable scale。 It also tries to balance the whole network to prevent some node being too heavy loaded
func (*DefaultCommunityManager) AddSubscriberNewOutgoingMessageEvent ¶
func (d *DefaultCommunityManager) AddSubscriberNewOutgoingMessageEvent(sub transport_interface.NewOutgoingMessageEventSubscriber)
subscribe mine
func (*DefaultCommunityManager) AddSubscriberPeerJoinedEvent ¶
func (d *DefaultCommunityManager) AddSubscriberPeerJoinedEvent(sub og_interface.PeerJoinedEventSubscriber)
func (*DefaultCommunityManager) AddSubscriberPeerLeftEvent ¶
func (d *DefaultCommunityManager) AddSubscriberPeerLeftEvent(sub og_interface.PeerLeftEventSubscriber)
func (*DefaultCommunityManager) GetPeerConnectedEventChannel ¶
func (d *DefaultCommunityManager) GetPeerConnectedEventChannel() chan *transport_interface.PeerEvent
func (*DefaultCommunityManager) GetPeerDisconnectedEventChannel ¶
func (d *DefaultCommunityManager) GetPeerDisconnectedEventChannel() chan *transport_interface.PeerEvent
func (*DefaultCommunityManager) InitDefault ¶
func (d *DefaultCommunityManager) InitDefault()
func (*DefaultCommunityManager) Name ¶
func (d *DefaultCommunityManager) Name() string
func (*DefaultCommunityManager) NewIncomingMessageEventChannel ¶
func (d *DefaultCommunityManager) NewIncomingMessageEventChannel() chan *transport_interface.IncomingLetter
my subscriptions
func (*DefaultCommunityManager) SendPing ¶
func (d *DefaultCommunityManager) SendPing(peer string)
func (*DefaultCommunityManager) Start ¶
func (d *DefaultCommunityManager) Start()
func (*DefaultCommunityManager) StaticSetup ¶
func (d *DefaultCommunityManager) StaticSetup()
func (*DefaultCommunityManager) Stop ¶
func (d *DefaultCommunityManager) Stop()
type LocalLedgerAccountProvider ¶
type LocalLedgerAccountProvider struct { PrivateGenerator og_interface.PrivateGenerator AddressConverter og_interface.AddressConverter BackFilePath string CryptoType og_interface.CryptoType // contains filtered or unexported fields }
func (*LocalLedgerAccountProvider) Generate ¶
func (l *LocalLedgerAccountProvider) Generate() (account *og_interface.OgLedgerAccount, err error)
func (*LocalLedgerAccountProvider) Load ¶
func (l *LocalLedgerAccountProvider) Load() (account *og_interface.OgLedgerAccount, err error)
func (*LocalLedgerAccountProvider) ProvideAccount ¶
func (l *LocalLedgerAccountProvider) ProvideAccount() (*og_interface.OgLedgerAccount, error)
func (*LocalLedgerAccountProvider) Save ¶
func (l *LocalLedgerAccountProvider) Save() (err error)
func (*LocalLedgerAccountProvider) SetAccount ¶
func (l *LocalLedgerAccountProvider) SetAccount(account *og_interface.OgLedgerAccount)
type LocalTransportAccountProvider ¶
type LocalTransportAccountProvider struct { PrivateGenerator og_interface.PrivateGenerator NetworkIdConverter NetworkIdConverter BackFilePath string CryptoType transport_interface.CryptoType // contains filtered or unexported fields }
func (*LocalTransportAccountProvider) Account ¶
func (l *LocalTransportAccountProvider) Account() *transport_interface.TransportAccount
func (*LocalTransportAccountProvider) Generate ¶
func (l *LocalTransportAccountProvider) Generate() (account *transport_interface.TransportAccount, err error)
func (*LocalTransportAccountProvider) Load ¶
func (l *LocalTransportAccountProvider) Load() (account *transport_interface.TransportAccount, err error)
only private key is mandatory.
func (*LocalTransportAccountProvider) ProvideAccount ¶
func (l *LocalTransportAccountProvider) ProvideAccount() (*transport_interface.TransportAccount, error)
func (*LocalTransportAccountProvider) Save ¶
func (l *LocalTransportAccountProvider) Save() (err error)
func (*LocalTransportAccountProvider) SetAccount ¶
func (l *LocalTransportAccountProvider) SetAccount(account *transport_interface.TransportAccount)
type NetworkIdConverter ¶
type NetworkIdConverter interface {
NetworkIdFromAccount(account *transport_interface.TransportAccount) (networkId string, err error)
}
type OGResourceFetcher ¶
type OGResourceFetcher struct { }
func (OGResourceFetcher) Fetch ¶
func (O OGResourceFetcher) Fetch(request ogsyncer_interface.ResourceRequest) ogsyncer_interface.Resource
type OgAddressConverter ¶
type OgAddressConverter struct { }
func (*OgAddressConverter) AddressFromAccount ¶
func (o *OgAddressConverter) AddressFromAccount(account *og_interface.OgLedgerAccount) (addr og_interface.Address, err error)
type OgEngine ¶
type OgEngine struct { Ledger og_interface.Ledger CommunityManager CommunityManager NetworkId string // contains filtered or unexported fields }
func (*OgEngine) AddSubscriberNewHeightDetectedEvent ¶
func (o *OgEngine) AddSubscriberNewHeightDetectedEvent(sub og_interface.NewHeightDetectedEventSubscriber)
func (*OgEngine) AddSubscriberNewOutgoingMessageEvent ¶
func (o *OgEngine) AddSubscriberNewOutgoingMessageEvent(sub transport_interface.NewOutgoingMessageEventSubscriber)
func (*OgEngine) CurrentHeight ¶
func (*OgEngine) EventChannelPeerJoined ¶
func (o *OgEngine) EventChannelPeerJoined() chan *og_interface.PeerJoinedEvent
func (*OgEngine) GetBenchmarks ¶
func (*OgEngine) GetNetworkId ¶
func (*OgEngine) InitDefault ¶
func (o *OgEngine) InitDefault()
func (*OgEngine) NewIncomingMessageEventChannel ¶
func (o *OgEngine) NewIncomingMessageEventChannel() chan *transport_interface.IncomingLetter
func (*OgEngine) StaticSetup ¶
func (o *OgEngine) StaticSetup()
type OgNetworkIdConverter ¶
type OgNetworkIdConverter struct { }
OgNetworkIdConverter converts private/public key to network id that libp2p use.
func (*OgNetworkIdConverter) NetworkIdFromAccount ¶
func (o *OgNetworkIdConverter) NetworkIdFromAccount(account *transport_interface.TransportAccount) (networkId string, err error)
type TransportAccountProvider ¶
type TransportAccountProvider interface { ProvideAccount() (*transport_interface.TransportAccount, error) Generate() (account *transport_interface.TransportAccount, err error) Load() (account *transport_interface.TransportAccount, err error) Save() (err error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.