Versions in this module Expand all Collapse all v0 v0.1.0 Feb 24, 2018 Changes in this version + const WAITING_TRANSACTION + func Init() + type BatchService interface + Add func(interface{}) + Size func() int + Start func() + Stop func() + func NewBatchService(period time.Duration, handle Handle, deleting bool) BatchService + type BlockService interface + AddBlock func(blk *domain.Block) (bool, error) + Close func() + CreateBlock func(txList []*domain.Transaction, createPeerId string) (*domain.Block, error) + GetLastBlock func() (*domain.Block, error) + LookUpBlock func(arg interface{}) (*domain.Block, error) + VerifyBlock func(blk *domain.Block) (bool, error) + func NewLedger(path string) BlockService + type ConsensusService interface + GetCurrentConsensusState func() map[string]*domain.ConsensusState + ReceiveConsensusMessage func(message msg.OutterMessage) + StartConsensus func(view *domain.View, block *domain.Block) + StopConsensus func() + func NewPBFTConsensusService(comm comm.ConnectionManager, webHookService webhook.WebhookService, ...) ConsensusService + type EventBatcherServiceImpl struct + Period time.Duration + func (gb *EventBatcherServiceImpl) Add(message interface{}) + func (gb *EventBatcherServiceImpl) Size() int + func (gb *EventBatcherServiceImpl) Start() + func (gb *EventBatcherServiceImpl) Stop() + type Handle func(interface{}) + type LeaderElectionService interface + AddPeerId func() + GetLastBlockHash func() string + ReceiveMessage func(message msg.OutterMessage) + Run func() + Stop func() + func NewRAFTelectionService(comm comm.ConnectionManager, peerID string) LeaderElectionService + type Ledger struct + DB blockchaindb.BlockChainDB + func (l *Ledger) AddBlock(blk *domain.Block) (bool, error) + func (l *Ledger) Close() + func (l *Ledger) CreateBlock(txList []*domain.Transaction, createPeerId string) (*domain.Block, error) + func (l *Ledger) CreateGenesisBlock() (*domain.Block, error) + func (l *Ledger) GetLastBlock() (*domain.Block, error) + func (l *Ledger) LookUpBlock(arg interface{}) (*domain.Block, error) + func (l *Ledger) VerifyBlock(blk *domain.Block) (bool, error) + type PBFTConsensusService struct + func (cs *PBFTConsensusService) EndConsensusState(consensusState *domain.ConsensusState) + func (cs *PBFTConsensusService) GetCurrentConsensusState() map[string]*domain.ConsensusState + func (cs *PBFTConsensusService) ReceiveConsensusMessage(msg msg.OutterMessage) + func (cs *PBFTConsensusService) StartConsensus(view *domain.View, block *domain.Block) + func (cs *PBFTConsensusService) StopConsensus() + type PeerService interface + AddPeer func(Peer *domain.Peer) + BroadCastPeerTable func(interface{}) + GetLeader func() *domain.Peer + GetPeerByPeerID func(peerID string) *domain.Peer + GetPeerTable func() *domain.PeerTable + PushPeerTable func(peerIDs []string) + RequestPeer func(ip string) (*domain.Peer, error) + SetLeader func(peer *domain.Peer) + UpdatePeerTable func(peerTable domain.PeerTable) + func NewPeerServiceImpl(peerTable *domain.PeerTable, comm comm.ConnectionManager) PeerService + type PeerServiceImpl struct + func (ps *PeerServiceImpl) AddPeer(Peer *domain.Peer) + func (ps *PeerServiceImpl) BroadCastPeerTable(interface{}) + func (ps *PeerServiceImpl) GetLeader() *domain.Peer + func (ps *PeerServiceImpl) GetPeerByPeerID(peerID string) *domain.Peer + func (ps *PeerServiceImpl) GetPeerTable() *domain.PeerTable + func (ps *PeerServiceImpl) HandleOnConnect(conn conn.Connection, pp pb.Peer) + func (ps *PeerServiceImpl) PushPeerTable(peerIDs []string) + func (ps *PeerServiceImpl) RequestPeer(ip string) (*domain.Peer, error) + func (ps *PeerServiceImpl) SetLeader(peer *domain.Peer) + func (ps *PeerServiceImpl) UpdatePeerTable(peerTable domain.PeerTable) + type RAFTelectionService struct + func (r *RAFTelectionService) AddPeerId() + func (r *RAFTelectionService) GetLastBlockHash() string + func (r *RAFTelectionService) ReceiveMessage(message msg.OutterMessage) + func (r *RAFTelectionService) Run() + func (r *RAFTelectionService) Stop() + type SmartContract struct + Name string + OriginReposPath string + SmartContractPath string + type SmartContractService interface + Deploy func(ReposPath string) (string, error) + Invoke func(transaction *domain.Transaction) (*domain.SmartContractResponse, error) + PullAllSmartContracts func(authenticatedGit string, errorHandler func(error), completionHandler func()) + Query func() + ValidateTransaction func(transaction *domain.Transaction) + ValidateTransactionsOfBlock func(block *domain.Block) error + type SmartContractServiceImpl struct + GithubID string + SmartContractHomePath string + SmartContractMap map[string]SmartContract + WorldStateDBName string + WorldStateDBPath string + func NewSmartContractService(githubID string, smartContractDirPath string) *SmartContractServiceImpl + func (scs *SmartContractServiceImpl) Deploy(ReposPath string) (string, error) + func (scs *SmartContractServiceImpl) Invoke(transaction *domain.Transaction) (*domain.SmartContractResponse, error) + func (scs *SmartContractServiceImpl) PullAllSmartContracts(errorHandler func(error), completionHandler func()) + func (scs *SmartContractServiceImpl) Query() + func (scs *SmartContractServiceImpl) RunTransaction(transaction *domain.Transaction) error + func (scs *SmartContractServiceImpl) RunTransactionOnDocker(transaction *domain.Transaction) (*domain.SmartContractResponse, error) + func (scs *SmartContractServiceImpl) RunTransactionsOfBlock(block domain.Block) error + func (scs *SmartContractServiceImpl) ValidateTransaction(transaction *domain.Transaction) + func (scs *SmartContractServiceImpl) ValidateTransactionsOfBlock(block *domain.Block) error + type TransactionService interface + AddTransaction func(tx *domain.Transaction) error + CreateTransaction func(txData *domain.TxData) (*domain.Transaction, error) + DeleteTransactions func(txs []*domain.Transaction) error + GetTransactions func(limit int) ([]*domain.Transaction, error) + type TransactionServiceImpl struct + Comm comm.ConnectionManager + DB *leveldbhelper.DBProvider + PeerService PeerService + func NewTransactionService(path string, comm comm.ConnectionManager, ps PeerService) *TransactionServiceImpl + func (t *TransactionServiceImpl) AddTransaction(tx *domain.Transaction) error + func (t *TransactionServiceImpl) Close() + func (t *TransactionServiceImpl) CreateTransaction(txData *domain.TxData) (*domain.Transaction, error) + func (t *TransactionServiceImpl) DeleteTransactions(txs []*domain.Transaction) error + func (t *TransactionServiceImpl) GetTransactions(limit int) ([]*domain.Transaction, error) + func (t *TransactionServiceImpl) SendToLeader(interface{})