Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireQueue() *queue.Queue
- func ApplyBatchTransaction(snapshot *avl.Tree, round *Round, tx *Transaction) (*avl.Tree, error)
- func ApplyContractTransaction(snapshot *avl.Tree, round *Round, tx *Transaction, ...) (*avl.Tree, error)
- func ApplyStakeTransaction(snapshot *avl.Tree, round *Round, tx *Transaction) (*avl.Tree, error)
- func ApplyTransferTransaction(snapshot *avl.Tree, round *Round, tx *Transaction, ...) (*avl.Tree, error)
- func CollectVotes(accounts *Accounts, snowball *Snowball, voteChan <-chan vote, ...)
- func ExportGraphDOT(round *Round, graph *Graph)
- func LoadContractMemorySnapshot(snapshot *avl.Tree, id AccountID) []byte
- func ReadAccountBalance(tree *avl.Tree, id AccountID) (uint64, bool)
- func ReadAccountContractCode(tree *avl.Tree, id TransactionID) ([]byte, bool)
- func ReadAccountContractNumPages(tree *avl.Tree, id TransactionID) (uint64, bool)
- func ReadAccountContractPage(tree *avl.Tree, id TransactionID, idx uint64) ([]byte, bool)
- func ReadAccountNonce(tree *avl.Tree, id AccountID) (uint64, bool)
- func ReadAccountReward(tree *avl.Tree, id AccountID) (uint64, bool)
- func ReadAccountStake(tree *avl.Tree, id AccountID) (uint64, bool)
- func ReadAccountsLen(tree *avl.Tree) uint64
- func RegisterWaveletServer(s *grpc.Server, srv WaveletServer)
- func ReleaseQueue(q *queue.Queue)
- func SaveContractMemorySnapshot(snapshot *avl.Tree, id AccountID, mem []byte)
- func SelectPeers(peers []*grpc.ClientConn, amount int) ([]*grpc.ClientConn, error)
- func StoreRewardWithdrawalRequest(tree *avl.Tree, rw RewardWithdrawalRequest)
- func StoreRound(kv store.KV, round Round, currentIx, oldestIx uint32, storedCount uint8) error
- func WriteAccountBalance(tree *avl.Tree, id AccountID, balance uint64)
- func WriteAccountContractCode(tree *avl.Tree, id TransactionID, code []byte)
- func WriteAccountContractNumPages(tree *avl.Tree, id TransactionID, numPages uint64)
- func WriteAccountContractPage(tree *avl.Tree, id TransactionID, idx uint64, page []byte)
- func WriteAccountNonce(tree *avl.Tree, id AccountID, nonce uint64)
- func WriteAccountReward(tree *avl.Tree, id AccountID, reward uint64)
- func WriteAccountStake(tree *avl.Tree, id AccountID, stake uint64)
- func WriteAccountsLen(tree *avl.Tree, size uint64)
- type AccountID
- type Accounts
- type Batch
- type CollapseResults
- type Contract
- type ContractExecutor
- func (e *ContractExecutor) Execute(snapshot *avl.Tree, id AccountID, round *Round, tx *Transaction, ...) error
- func (e *ContractExecutor) GetCost(key string) int64
- func (e *ContractExecutor) ResolveFunc(module, field string) exec.FunctionImport
- func (e *ContractExecutor) ResolveGlobal(module, field string) int64
- type ContractExecutorState
- type DownloadTxRequest
- func (*DownloadTxRequest) Descriptor() ([]byte, []int)
- func (m *DownloadTxRequest) GetIds() [][]byte
- func (m *DownloadTxRequest) Marshal() (dAtA []byte, err error)
- func (m *DownloadTxRequest) MarshalTo(dAtA []byte) (int, error)
- func (*DownloadTxRequest) ProtoMessage()
- func (m *DownloadTxRequest) Reset()
- func (m *DownloadTxRequest) Size() (n int)
- func (m *DownloadTxRequest) String() string
- func (m *DownloadTxRequest) Unmarshal(dAtA []byte) error
- func (m *DownloadTxRequest) XXX_DiscardUnknown()
- func (m *DownloadTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DownloadTxRequest) XXX_Merge(src proto.Message)
- func (m *DownloadTxRequest) XXX_Size() int
- func (m *DownloadTxRequest) XXX_Unmarshal(b []byte) error
- type DownloadTxResponse
- func (*DownloadTxResponse) Descriptor() ([]byte, []int)
- func (m *DownloadTxResponse) GetTransactions() [][]byte
- func (m *DownloadTxResponse) Marshal() (dAtA []byte, err error)
- func (m *DownloadTxResponse) MarshalTo(dAtA []byte) (int, error)
- func (*DownloadTxResponse) ProtoMessage()
- func (m *DownloadTxResponse) Reset()
- func (m *DownloadTxResponse) Size() (n int)
- func (m *DownloadTxResponse) String() string
- func (m *DownloadTxResponse) Unmarshal(dAtA []byte) error
- func (m *DownloadTxResponse) XXX_DiscardUnknown()
- func (m *DownloadTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DownloadTxResponse) XXX_Merge(src proto.Message)
- func (m *DownloadTxResponse) XXX_Size() int
- func (m *DownloadTxResponse) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) Marshal() (dAtA []byte, err error)
- func (m *Empty) MarshalTo(dAtA []byte) (int, error)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) Size() (n int)
- func (m *Empty) String() string
- func (m *Empty) Unmarshal(dAtA []byte) error
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type Gossiper
- type Graph
- func (g *Graph) AddTransaction(tx Transaction) error
- func (g *Graph) DepthLen(start *uint64, end *uint64) int
- func (g *Graph) FindEligibleCritical(difficulty byte) *Transaction
- func (g *Graph) FindEligibleParents() []*Transaction
- func (g *Graph) FindTransaction(id TransactionID) *Transaction
- func (g *Graph) GetTransactionsByDepth(start *uint64, end *uint64) []*Transaction
- func (g *Graph) Height() uint64
- func (g *Graph) Len() int
- func (g *Graph) ListTransactions(offset, limit uint64, sender, creator AccountID) (transactions []*Transaction)
- func (g *Graph) MarkTransactionAsMissing(id TransactionID, depth uint64)
- func (g *Graph) Missing() []TransactionID
- func (g *Graph) MissingLen() int
- func (g *Graph) PruneBelowDepth(targetDepth uint64) int
- func (g *Graph) RootDepth() uint64
- func (g *Graph) UpdateRoot(root Transaction)
- func (g *Graph) UpdateRootDepth(rootDepth uint64)
- type GraphOption
- type LRU
- type Ledger
- func (l *Ledger) AddTransaction(tx Transaction) error
- func (l *Ledger) ApplyTransactionToSnapshot(snapshot *avl.Tree, tx *Transaction) error
- func (l *Ledger) BroadcastNop() *Transaction
- func (l *Ledger) CollapseTransactions(round uint64, root Transaction, end Transaction, logging bool) (*CollapseResults, error)
- func (l *Ledger) FeedSendTokenIntoBucket()
- func (l *Ledger) FinalizeRounds()
- func (l *Ledger) Finalizer() *Snowball
- func (l *Ledger) Graph() *Graph
- func (l *Ledger) LogChanges(snapshot *avl.Tree, lastRound uint64)
- func (l *Ledger) PerformConsensus()
- func (l *Ledger) Protocol() *Protocol
- func (l *Ledger) PullMissingTransactions()
- func (l *Ledger) RewardValidators(snapshot *avl.Tree, root Transaction, tx *Transaction, logging bool) error
- func (l *Ledger) Rounds() *Rounds
- func (l *Ledger) Snapshot() *avl.Tree
- func (l *Ledger) SyncToLatestRound()
- func (l *Ledger) TakeSendToken() bool
- type MerkleNodeID
- type Metrics
- type OutOfSyncRequest
- func (*OutOfSyncRequest) Descriptor() ([]byte, []int)
- func (m *OutOfSyncRequest) Marshal() (dAtA []byte, err error)
- func (m *OutOfSyncRequest) MarshalTo(dAtA []byte) (int, error)
- func (*OutOfSyncRequest) ProtoMessage()
- func (m *OutOfSyncRequest) Reset()
- func (m *OutOfSyncRequest) Size() (n int)
- func (m *OutOfSyncRequest) String() string
- func (m *OutOfSyncRequest) Unmarshal(dAtA []byte) error
- func (m *OutOfSyncRequest) XXX_DiscardUnknown()
- func (m *OutOfSyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OutOfSyncRequest) XXX_Merge(src proto.Message)
- func (m *OutOfSyncRequest) XXX_Size() int
- func (m *OutOfSyncRequest) XXX_Unmarshal(b []byte) error
- type OutOfSyncResponse
- func (*OutOfSyncResponse) Descriptor() ([]byte, []int)
- func (m *OutOfSyncResponse) GetRound() []byte
- func (m *OutOfSyncResponse) Marshal() (dAtA []byte, err error)
- func (m *OutOfSyncResponse) MarshalTo(dAtA []byte) (int, error)
- func (*OutOfSyncResponse) ProtoMessage()
- func (m *OutOfSyncResponse) Reset()
- func (m *OutOfSyncResponse) Size() (n int)
- func (m *OutOfSyncResponse) String() string
- func (m *OutOfSyncResponse) Unmarshal(dAtA []byte) error
- func (m *OutOfSyncResponse) XXX_DiscardUnknown()
- func (m *OutOfSyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OutOfSyncResponse) XXX_Merge(src proto.Message)
- func (m *OutOfSyncResponse) XXX_Size() int
- func (m *OutOfSyncResponse) XXX_Unmarshal(b []byte) error
- type Protocol
- func (p *Protocol) CheckOutOfSync(context.Context, *OutOfSyncRequest) (*OutOfSyncResponse, error)
- func (p *Protocol) DownloadTx(ctx context.Context, req *DownloadTxRequest) (*DownloadTxResponse, error)
- func (p *Protocol) Gossip(stream Wavelet_GossipServer) error
- func (p *Protocol) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error)
- func (p *Protocol) Sync(stream Wavelet_SyncServer) error
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)
- func (m *QueryRequest) GetRoundIndex() uint64
- func (m *QueryRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error)
- func (*QueryRequest) ProtoMessage()
- func (m *QueryRequest) Reset()
- func (m *QueryRequest) Size() (n int)
- func (m *QueryRequest) String() string
- func (m *QueryRequest) Unmarshal(dAtA []byte) error
- func (m *QueryRequest) XXX_DiscardUnknown()
- func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryRequest) XXX_Merge(src proto.Message)
- func (m *QueryRequest) XXX_Size() int
- func (m *QueryRequest) XXX_Unmarshal(b []byte) error
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)
- func (m *QueryResponse) GetRound() []byte
- func (m *QueryResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error)
- func (*QueryResponse) ProtoMessage()
- func (m *QueryResponse) Reset()
- func (m *QueryResponse) Size() (n int)
- func (m *QueryResponse) String() string
- func (m *QueryResponse) Unmarshal(dAtA []byte) error
- func (m *QueryResponse) XXX_DiscardUnknown()
- func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryResponse) XXX_Merge(src proto.Message)
- func (m *QueryResponse) XXX_Size() int
- func (m *QueryResponse) XXX_Unmarshal(b []byte) error
- type RewardWithdrawalRequest
- type Round
- type RoundID
- type Rounds
- type Signature
- type Snowball
- type SnowballOption
- type Stake
- type SyncInfo
- func (*SyncInfo) Descriptor() ([]byte, []int)
- func (m *SyncInfo) GetChecksums() [][]byte
- func (m *SyncInfo) GetLatestRound() []byte
- func (m *SyncInfo) Marshal() (dAtA []byte, err error)
- func (m *SyncInfo) MarshalTo(dAtA []byte) (int, error)
- func (*SyncInfo) ProtoMessage()
- func (m *SyncInfo) Reset()
- func (m *SyncInfo) Size() (n int)
- func (m *SyncInfo) String() string
- func (m *SyncInfo) Unmarshal(dAtA []byte) error
- func (m *SyncInfo) XXX_DiscardUnknown()
- func (m *SyncInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SyncInfo) XXX_Merge(src proto.Message)
- func (m *SyncInfo) XXX_Size() int
- func (m *SyncInfo) XXX_Unmarshal(b []byte) error
- type SyncRequest
- func (*SyncRequest) Descriptor() ([]byte, []int)
- func (m *SyncRequest) GetChecksum() []byte
- func (m *SyncRequest) GetData() isSyncRequest_Data
- func (m *SyncRequest) GetRoundId() uint64
- func (m *SyncRequest) Marshal() (dAtA []byte, err error)
- func (m *SyncRequest) MarshalTo(dAtA []byte) (int, error)
- func (*SyncRequest) ProtoMessage()
- func (m *SyncRequest) Reset()
- func (m *SyncRequest) Size() (n int)
- func (m *SyncRequest) String() string
- func (m *SyncRequest) Unmarshal(dAtA []byte) error
- func (m *SyncRequest) XXX_DiscardUnknown()
- func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SyncRequest) XXX_Merge(src proto.Message)
- func (*SyncRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *SyncRequest) XXX_Size() int
- func (m *SyncRequest) XXX_Unmarshal(b []byte) error
- type SyncRequest_Checksum
- type SyncRequest_RoundId
- type SyncResponse
- func (*SyncResponse) Descriptor() ([]byte, []int)
- func (m *SyncResponse) GetChunk() []byte
- func (m *SyncResponse) GetData() isSyncResponse_Data
- func (m *SyncResponse) GetHeader() *SyncInfo
- func (m *SyncResponse) Marshal() (dAtA []byte, err error)
- func (m *SyncResponse) MarshalTo(dAtA []byte) (int, error)
- func (*SyncResponse) ProtoMessage()
- func (m *SyncResponse) Reset()
- func (m *SyncResponse) Size() (n int)
- func (m *SyncResponse) String() string
- func (m *SyncResponse) Unmarshal(dAtA []byte) error
- func (m *SyncResponse) XXX_DiscardUnknown()
- func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SyncResponse) XXX_Merge(src proto.Message)
- func (*SyncResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *SyncResponse) XXX_Size() int
- func (m *SyncResponse) XXX_Unmarshal(b []byte) error
- type SyncResponse_Chunk
- type SyncResponse_Header
- type Transaction
- func AttachSenderToTransaction(sender *skademlia.Keypair, tx Transaction, parents ...*Transaction) Transaction
- func NewBatchTransaction(creator *skademlia.Keypair, tags []byte, payloads [][]byte) Transaction
- func NewTransaction(creator *skademlia.Keypair, tag byte, payload []byte) Transaction
- func UnmarshalTransaction(r io.Reader) (t Transaction, err error)
- type TransactionID
- type Transactions
- func (*Transactions) Descriptor() ([]byte, []int)
- func (m *Transactions) GetTransactions() [][]byte
- func (m *Transactions) Marshal() (dAtA []byte, err error)
- func (m *Transactions) MarshalTo(dAtA []byte) (int, error)
- func (*Transactions) ProtoMessage()
- func (m *Transactions) Reset()
- func (m *Transactions) Size() (n int)
- func (m *Transactions) String() string
- func (m *Transactions) Unmarshal(dAtA []byte) error
- func (m *Transactions) XXX_DiscardUnknown()
- func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Transactions) XXX_Merge(src proto.Message)
- func (m *Transactions) XXX_Size() int
- func (m *Transactions) XXX_Unmarshal(b []byte) error
- type Transfer
- type WaveletClient
- type WaveletServer
- type Wavelet_GossipClient
- type Wavelet_GossipServer
- type Wavelet_SyncClient
- type Wavelet_SyncServer
Constants ¶
const ( SizeTransactionID = blake2b.Size256 SizeRoundID = blake2b.Size256 SizeMerkleNodeID = md5.Size SizeAccountID = 32 SizeSignature = 64 )
const (
PageSize = 65536
)
const (
SnowballDefaultBeta = 150
)
Variables ¶
var ( ZeroTransactionID TransactionID ZeroRoundID RoundID ZeroMerkleNodeID MerkleNodeID ZeroAccountID AccountID ZeroSignature Signature ZeroRoundPtr = &Round{} )
var ( ErrNotSmartContract = errors.New("contract: specified account ID is not a smart contract") ErrContractFunctionNotFound = errors.New("contract: smart contract func not found") )
var ( ErrMissingParents = errors.New("parents for transaction are not in graph") ErrAlreadyExists = errors.New("transaction already exists in the graph") ErrDepthLimitExceeded = errors.New("transactions parents exceed depth limit") )
var ( ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") )
Functions ¶
func AcquireQueue ¶
func ApplyBatchTransaction ¶
func ApplyContractTransaction ¶
func ApplyContractTransaction(snapshot *avl.Tree, round *Round, tx *Transaction, state *ContractExecutorState) (*avl.Tree, error)
func ApplyStakeTransaction ¶
func ApplyTransferTransaction ¶
func ApplyTransferTransaction(snapshot *avl.Tree, round *Round, tx *Transaction, state *ContractExecutorState) (*avl.Tree, error)
func CollectVotes ¶
func ExportGraphDOT ¶
func ReadAccountContractCode ¶
func ReadAccountContractCode(tree *avl.Tree, id TransactionID) ([]byte, bool)
func ReadAccountContractNumPages ¶
func ReadAccountContractNumPages(tree *avl.Tree, id TransactionID) (uint64, bool)
func ReadAccountContractPage ¶
func ReadAccountsLen ¶
func RegisterWaveletServer ¶
func RegisterWaveletServer(s *grpc.Server, srv WaveletServer)
func ReleaseQueue ¶
func SelectPeers ¶
func SelectPeers(peers []*grpc.ClientConn, amount int) ([]*grpc.ClientConn, error)
func StoreRewardWithdrawalRequest ¶
func StoreRewardWithdrawalRequest(tree *avl.Tree, rw RewardWithdrawalRequest)
func StoreRound ¶
func WriteAccountContractCode ¶
func WriteAccountContractCode(tree *avl.Tree, id TransactionID, code []byte)
func WriteAccountContractNumPages ¶
func WriteAccountContractNumPages(tree *avl.Tree, id TransactionID, numPages uint64)
func WriteAccountContractPage ¶
func WriteAccountContractPage(tree *avl.Tree, id TransactionID, idx uint64, page []byte)
func WriteAccountsLen ¶
Types ¶
type AccountID ¶
type AccountID = [SizeAccountID]byte
type Accounts ¶
func NewAccounts ¶
type Batch ¶
func ParseBatchTransaction ¶
ParseBatchTransaction parses and performs sanity checks on the payload of a batch transaction.
type CollapseResults ¶
type CollapseResults struct {
// contains filtered or unexported fields
}
CollapseResults is what is returned by calling CollapseTransactions. Refer to CollapseTransactions to understand what counts of accepted, rejected, or otherwise ignored transactions truly represent after calling CollapseTransactions.
type Contract ¶
func ParseContractTransaction ¶
ParseContractTransaction parses and performs sanity checks on the payload of a contract transaction.
type ContractExecutor ¶
type ContractExecutor struct {
ID AccountID
Snapshot *avl.Tree
Gas uint64
GasLimitExceeded bool
Payload []byte
Error []byte
Queue []*Transaction
}
func (*ContractExecutor) Execute ¶
func (e *ContractExecutor) Execute(snapshot *avl.Tree, id AccountID, round *Round, tx *Transaction, amount, gasLimit uint64, name string, params, code []byte) error
func (*ContractExecutor) GetCost ¶
func (e *ContractExecutor) GetCost(key string) int64
func (*ContractExecutor) ResolveFunc ¶
func (e *ContractExecutor) ResolveFunc(module, field string) exec.FunctionImport
func (*ContractExecutor) ResolveGlobal ¶
func (e *ContractExecutor) ResolveGlobal(module, field string) int64
type ContractExecutorState ¶
type DownloadTxRequest ¶
type DownloadTxRequest struct {
Ids [][]byte `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"`
}
func (*DownloadTxRequest) Descriptor ¶
func (*DownloadTxRequest) Descriptor() ([]byte, []int)
func (*DownloadTxRequest) GetIds ¶
func (m *DownloadTxRequest) GetIds() [][]byte
func (*DownloadTxRequest) Marshal ¶
func (m *DownloadTxRequest) Marshal() (dAtA []byte, err error)
func (*DownloadTxRequest) MarshalTo ¶
func (m *DownloadTxRequest) MarshalTo(dAtA []byte) (int, error)
func (*DownloadTxRequest) ProtoMessage ¶
func (*DownloadTxRequest) ProtoMessage()
func (*DownloadTxRequest) Reset ¶
func (m *DownloadTxRequest) Reset()
func (*DownloadTxRequest) Size ¶
func (m *DownloadTxRequest) Size() (n int)
func (*DownloadTxRequest) String ¶
func (m *DownloadTxRequest) String() string
func (*DownloadTxRequest) Unmarshal ¶
func (m *DownloadTxRequest) Unmarshal(dAtA []byte) error
func (*DownloadTxRequest) XXX_DiscardUnknown ¶
func (m *DownloadTxRequest) XXX_DiscardUnknown()
func (*DownloadTxRequest) XXX_Marshal ¶
func (m *DownloadTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DownloadTxRequest) XXX_Merge ¶
func (m *DownloadTxRequest) XXX_Merge(src proto.Message)
func (*DownloadTxRequest) XXX_Size ¶
func (m *DownloadTxRequest) XXX_Size() int
func (*DownloadTxRequest) XXX_Unmarshal ¶
func (m *DownloadTxRequest) XXX_Unmarshal(b []byte) error
type DownloadTxResponse ¶
type DownloadTxResponse struct {
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"`
}
func (*DownloadTxResponse) Descriptor ¶
func (*DownloadTxResponse) Descriptor() ([]byte, []int)
func (*DownloadTxResponse) GetTransactions ¶
func (m *DownloadTxResponse) GetTransactions() [][]byte
func (*DownloadTxResponse) Marshal ¶
func (m *DownloadTxResponse) Marshal() (dAtA []byte, err error)
func (*DownloadTxResponse) MarshalTo ¶
func (m *DownloadTxResponse) MarshalTo(dAtA []byte) (int, error)
func (*DownloadTxResponse) ProtoMessage ¶
func (*DownloadTxResponse) ProtoMessage()
func (*DownloadTxResponse) Reset ¶
func (m *DownloadTxResponse) Reset()
func (*DownloadTxResponse) Size ¶
func (m *DownloadTxResponse) Size() (n int)
func (*DownloadTxResponse) String ¶
func (m *DownloadTxResponse) String() string
func (*DownloadTxResponse) Unmarshal ¶
func (m *DownloadTxResponse) Unmarshal(dAtA []byte) error
func (*DownloadTxResponse) XXX_DiscardUnknown ¶
func (m *DownloadTxResponse) XXX_DiscardUnknown()
func (*DownloadTxResponse) XXX_Marshal ¶
func (m *DownloadTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DownloadTxResponse) XXX_Merge ¶
func (m *DownloadTxResponse) XXX_Merge(src proto.Message)
func (*DownloadTxResponse) XXX_Size ¶
func (m *DownloadTxResponse) XXX_Size() int
func (*DownloadTxResponse) XXX_Unmarshal ¶
func (m *DownloadTxResponse) XXX_Unmarshal(b []byte) error
type Empty ¶
type Empty struct {
}
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type Gossiper ¶
type Gossiper struct {
// contains filtered or unexported fields
}
func NewGossiper ¶
func (*Gossiper) Push ¶
func (g *Gossiper) Push(tx Transaction)
type Graph ¶
func NewGraph ¶
func NewGraph(opts ...GraphOption) *Graph
func (*Graph) AddTransaction ¶
func (g *Graph) AddTransaction(tx Transaction) error
AddTransaction adds sufficiently valid transactions with a strongly connected ancestry to the graph, and otherwise buffers incomplete transactions, or otherwise rejects invalid transactions.
func (*Graph) DepthLen ¶
GetTransactionsByDepth returns the number of transactions in graph whose depth is between [start, end].
func (*Graph) FindEligibleCritical ¶
func (g *Graph) FindEligibleCritical(difficulty byte) *Transaction
FindEligibleCritical looks through all transactions in the current round, and returns any one whose number of zero bits prefixed of its seed is >= difficulty.
func (*Graph) FindEligibleParents ¶
func (g *Graph) FindEligibleParents() []*Transaction
FindEligibleParents provides a set of transactions suited to be eligible parents. We consider eligible parents to be transactions closest to the graphs frontier by DEPTH_DIFF that have no children, such that they are leaf nodes of the graph.
func (*Graph) FindTransaction ¶
func (g *Graph) FindTransaction(id TransactionID) *Transaction
FindTransaction returns transaction with id from graph, and nil otherwise.
func (*Graph) GetTransactionsByDepth ¶
func (g *Graph) GetTransactionsByDepth(start *uint64, end *uint64) []*Transaction
GetTransactionsByDepth returns all transactions in graph whose depth is between [start, end].
func (*Graph) ListTransactions ¶
func (g *Graph) ListTransactions(offset, limit uint64, sender, creator AccountID) (transactions []*Transaction)
func (*Graph) MarkTransactionAsMissing ¶
func (g *Graph) MarkTransactionAsMissing(id TransactionID, depth uint64)
MarkTransactionAsMissing marks a transaction at some given depth to be missing.
func (*Graph) Missing ¶
func (g *Graph) Missing() []TransactionID
func (*Graph) MissingLen ¶
MissingLen returns the number of known missing transactions of the graph.
func (*Graph) PruneBelowDepth ¶
PruneBelowDepth prunes all transactions and their indices that has a depth equal to or less than targetDepth.
func (*Graph) UpdateRoot ¶
func (g *Graph) UpdateRoot(root Transaction)
UpdateRoot forcefully adds a root transaction to the graph, and updates all relevant graph indices as a result of setting a new root with its new depth.
func (*Graph) UpdateRootDepth ¶
UpdateRootDepth updates the root depth of the graph to disallow new transactions from being added to the graph whose depth is less than root depth by at most DEPTH_DIFF. It additionally clears away any missing transactions that are at a depth below the root depth by more than DEPTH_DIFF.
type GraphOption ¶
type GraphOption func(*Graph)
func VerifySignatures ¶
func VerifySignatures() GraphOption
func WithMetrics ¶
func WithMetrics(metrics *Metrics) GraphOption
func WithRoot ¶
func WithRoot(root Transaction) GraphOption
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func (*Ledger) AddTransaction ¶
func (l *Ledger) AddTransaction(tx Transaction) error
AddTransaction adds a transaction to the ledger. If the transaction has never been added in the ledgers graph before, it is pushed to the gossip mechanism to then be gossiped to this nodes peers. If the transaction is invalid or fails any validation checks, an error is returned. No error is returned if the transaction has already existed int he ledgers graph beforehand.
func (*Ledger) ApplyTransactionToSnapshot ¶
func (l *Ledger) ApplyTransactionToSnapshot(snapshot *avl.Tree, tx *Transaction) error
ApplyTransactionToSnapshot applies a transactions intended changes to a snapshot of the ledgers current state.
func (*Ledger) BroadcastNop ¶
func (l *Ledger) BroadcastNop() *Transaction
BroadcastNop has the node send a nop transaction should they have sufficient balance available. They are broadcasted if no other transaction that is not a nop transaction is not broadcasted by the node after 500 milliseconds. These conditions only apply so long as at least one transaction gets broadcasted by the node within the current round. Once a round is tentatively being finalized, a node will stop broadcasting nops.
func (*Ledger) CollapseTransactions ¶
func (l *Ledger) CollapseTransactions(round uint64, root Transaction, end Transaction, logging bool) (*CollapseResults, error)
CollapseTransactions takes all transactions recorded within a graph depth interval, and applies all valid and available ones to a snapshot of all accounts stored in the ledger. It returns an updated snapshot with all finalized transactions applied, alongside count summaries of the number of applied, rejected, or otherwise ignored transactions.
Transactions that intersect within all paths from the start to end of a depth interval that are also applicable to the ledger state are considered as accepted. Transactions that do not intersect with any of the paths from the start to end of a depth interval t all are considered as ignored transactions. Transactions that fall entirely out of either applied or ignored are considered to be rejected.
It is important to note that transactions that are inspected over are specifically transactions that are within the depth interval (start, end] where start is the interval starting point depth, and end is the interval ending point depth.
func (*Ledger) FeedSendTokenIntoBucket ¶
func (l *Ledger) FeedSendTokenIntoBucket()
func (*Ledger) FinalizeRounds ¶
func (l *Ledger) FinalizeRounds()
FinalizeRounds periodically attempts to find an eligible critical transaction suited for the current round. If it finds one, it will then proceed to perform snowball sampling over its peers to decide on a single critical transaction that serves as an ending point for the current consensus round. The round is finalized, transactions of the finalized round are applied to the current ledger state, and the graph is updated to cleanup artifacts from the old round.
func (*Ledger) Finalizer ¶
Finalizer returns the Snowball finalizer which finalizes the contents of individual consensus rounds.
func (*Ledger) Graph ¶
Graph returns the directed-acyclic-graph of transactions accompanying the ledger.
func (*Ledger) LogChanges ¶
LogChanges logs all changes made to an AVL tree state snapshot for the purposes of logging out changes to account state to Wavelet's HTTP API.
func (*Ledger) PerformConsensus ¶
func (l *Ledger) PerformConsensus()
PerformConsensus spawns workers related to performing consensus, such as pulling missing transactions and incrementally finalizing intervals of transactions in the ledgers graph.
func (*Ledger) Protocol ¶
Protocol returns an implementation of WaveletServer to handle incoming RPC and streams for the ledger. The protocol is agnostic to whatever choice of network stack is used with Wavelet, though by default it is intended to be used with gRPC and Noise.
func (*Ledger) PullMissingTransactions ¶
func (l *Ledger) PullMissingTransactions()
PullMissingTransactions is an infinite loop continually sending RPC requests to pull any transactions identified to be missing by the ledger. It periodically samples a random peer from the network, and requests the peer for the contents of all missing transactions by their respective IDs. When the ledger is in amidst synchronizing/teleporting ahead to a new round, the infinite loop will be cleaned up. It is intended to call PullMissingTransactions() in a new goroutine.
func (*Ledger) RewardValidators ¶
func (l *Ledger) RewardValidators(snapshot *avl.Tree, root Transaction, tx *Transaction, logging bool) error
func (*Ledger) SyncToLatestRound ¶
func (l *Ledger) SyncToLatestRound()
func (*Ledger) TakeSendToken ¶
type MerkleNodeID ¶
type MerkleNodeID = [SizeMerkleNodeID]byte
type OutOfSyncRequest ¶
type OutOfSyncRequest struct {
}
func (*OutOfSyncRequest) Descriptor ¶
func (*OutOfSyncRequest) Descriptor() ([]byte, []int)
func (*OutOfSyncRequest) Marshal ¶
func (m *OutOfSyncRequest) Marshal() (dAtA []byte, err error)
func (*OutOfSyncRequest) ProtoMessage ¶
func (*OutOfSyncRequest) ProtoMessage()
func (*OutOfSyncRequest) Reset ¶
func (m *OutOfSyncRequest) Reset()
func (*OutOfSyncRequest) Size ¶
func (m *OutOfSyncRequest) Size() (n int)
func (*OutOfSyncRequest) String ¶
func (m *OutOfSyncRequest) String() string
func (*OutOfSyncRequest) Unmarshal ¶
func (m *OutOfSyncRequest) Unmarshal(dAtA []byte) error
func (*OutOfSyncRequest) XXX_DiscardUnknown ¶
func (m *OutOfSyncRequest) XXX_DiscardUnknown()
func (*OutOfSyncRequest) XXX_Marshal ¶
func (m *OutOfSyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OutOfSyncRequest) XXX_Merge ¶
func (m *OutOfSyncRequest) XXX_Merge(src proto.Message)
func (*OutOfSyncRequest) XXX_Size ¶
func (m *OutOfSyncRequest) XXX_Size() int
func (*OutOfSyncRequest) XXX_Unmarshal ¶
func (m *OutOfSyncRequest) XXX_Unmarshal(b []byte) error
type OutOfSyncResponse ¶
type OutOfSyncResponse struct {
Round []byte `protobuf:"bytes,1,opt,name=round,proto3" json:"round,omitempty"`
}
func (*OutOfSyncResponse) Descriptor ¶
func (*OutOfSyncResponse) Descriptor() ([]byte, []int)
func (*OutOfSyncResponse) GetRound ¶
func (m *OutOfSyncResponse) GetRound() []byte
func (*OutOfSyncResponse) Marshal ¶
func (m *OutOfSyncResponse) Marshal() (dAtA []byte, err error)
func (*OutOfSyncResponse) MarshalTo ¶
func (m *OutOfSyncResponse) MarshalTo(dAtA []byte) (int, error)
func (*OutOfSyncResponse) ProtoMessage ¶
func (*OutOfSyncResponse) ProtoMessage()
func (*OutOfSyncResponse) Reset ¶
func (m *OutOfSyncResponse) Reset()
func (*OutOfSyncResponse) Size ¶
func (m *OutOfSyncResponse) Size() (n int)
func (*OutOfSyncResponse) String ¶
func (m *OutOfSyncResponse) String() string
func (*OutOfSyncResponse) Unmarshal ¶
func (m *OutOfSyncResponse) Unmarshal(dAtA []byte) error
func (*OutOfSyncResponse) XXX_DiscardUnknown ¶
func (m *OutOfSyncResponse) XXX_DiscardUnknown()
func (*OutOfSyncResponse) XXX_Marshal ¶
func (m *OutOfSyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OutOfSyncResponse) XXX_Merge ¶
func (m *OutOfSyncResponse) XXX_Merge(src proto.Message)
func (*OutOfSyncResponse) XXX_Size ¶
func (m *OutOfSyncResponse) XXX_Size() int
func (*OutOfSyncResponse) XXX_Unmarshal ¶
func (m *OutOfSyncResponse) XXX_Unmarshal(b []byte) error
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
func (*Protocol) CheckOutOfSync ¶
func (p *Protocol) CheckOutOfSync(context.Context, *OutOfSyncRequest) (*OutOfSyncResponse, error)
func (*Protocol) DownloadTx ¶
func (p *Protocol) DownloadTx(ctx context.Context, req *DownloadTxRequest) (*DownloadTxResponse, error)
func (*Protocol) Gossip ¶
func (p *Protocol) Gossip(stream Wavelet_GossipServer) error
func (*Protocol) Query ¶
func (p *Protocol) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error)
func (*Protocol) Sync ¶
func (p *Protocol) Sync(stream Wavelet_SyncServer) error
type QueryRequest ¶
type QueryRequest struct {
RoundIndex uint64 `protobuf:"varint,1,opt,name=round_index,json=roundIndex,proto3" json:"round_index,omitempty"`
}
func (*QueryRequest) Descriptor ¶
func (*QueryRequest) Descriptor() ([]byte, []int)
func (*QueryRequest) GetRoundIndex ¶
func (m *QueryRequest) GetRoundIndex() uint64
func (*QueryRequest) Marshal ¶
func (m *QueryRequest) Marshal() (dAtA []byte, err error)
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) Reset ¶
func (m *QueryRequest) Reset()
func (*QueryRequest) Size ¶
func (m *QueryRequest) Size() (n int)
func (*QueryRequest) String ¶
func (m *QueryRequest) String() string
func (*QueryRequest) Unmarshal ¶
func (m *QueryRequest) Unmarshal(dAtA []byte) error
func (*QueryRequest) XXX_DiscardUnknown ¶
func (m *QueryRequest) XXX_DiscardUnknown()
func (*QueryRequest) XXX_Marshal ¶
func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryRequest) XXX_Merge ¶
func (m *QueryRequest) XXX_Merge(src proto.Message)
func (*QueryRequest) XXX_Size ¶
func (m *QueryRequest) XXX_Size() int
func (*QueryRequest) XXX_Unmarshal ¶
func (m *QueryRequest) XXX_Unmarshal(b []byte) error
type QueryResponse ¶
type QueryResponse struct {
Round []byte `protobuf:"bytes,1,opt,name=round,proto3" json:"round,omitempty"`
}
func (*QueryResponse) Descriptor ¶
func (*QueryResponse) Descriptor() ([]byte, []int)
func (*QueryResponse) GetRound ¶
func (m *QueryResponse) GetRound() []byte
func (*QueryResponse) Marshal ¶
func (m *QueryResponse) Marshal() (dAtA []byte, err error)
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) Reset ¶
func (m *QueryResponse) Reset()
func (*QueryResponse) Size ¶
func (m *QueryResponse) Size() (n int)
func (*QueryResponse) String ¶
func (m *QueryResponse) String() string
func (*QueryResponse) Unmarshal ¶
func (m *QueryResponse) Unmarshal(dAtA []byte) error
func (*QueryResponse) XXX_DiscardUnknown ¶
func (m *QueryResponse) XXX_DiscardUnknown()
func (*QueryResponse) XXX_Marshal ¶
func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryResponse) XXX_Merge ¶
func (m *QueryResponse) XXX_Merge(src proto.Message)
func (*QueryResponse) XXX_Size ¶
func (m *QueryResponse) XXX_Size() int
func (*QueryResponse) XXX_Unmarshal ¶
func (m *QueryResponse) XXX_Unmarshal(b []byte) error
type RewardWithdrawalRequest ¶
type RewardWithdrawalRequest struct {
// contains filtered or unexported fields
}
func GetRewardWithdrawalRequests ¶
func GetRewardWithdrawalRequests(tree *avl.Tree, roundLimit uint64) []RewardWithdrawalRequest
func UnmarshalRewardWithdrawalRequest ¶
func UnmarshalRewardWithdrawalRequest(r io.Reader) (RewardWithdrawalRequest, error)
func (RewardWithdrawalRequest) Key ¶
func (rw RewardWithdrawalRequest) Key() []byte
func (RewardWithdrawalRequest) Marshal ¶
func (rw RewardWithdrawalRequest) Marshal() []byte
type Round ¶
type Round struct {
ID RoundID
Index uint64
Merkle MerkleNodeID
Applied uint64
Start Transaction
End Transaction
}
Round represents a network-wide finalized non-overlapping graph depth interval that is denoted by both a critical starting point transaction, and a critical ending point transaction. They contain the expected Merkle root of the ledgers state. They are denoted by either their index or ID, which is the checksum of applying BLAKE2b over its contents.
func NewRound ¶
func NewRound(index uint64, merkle MerkleNodeID, applied uint64, start, end Transaction) Round
type RoundID ¶
type RoundID = [SizeRoundID]byte
type Signature ¶
type Signature = [SizeSignature]byte
type Snowball ¶
func NewSnowball ¶
func NewSnowball(opts ...SnowballOption) *Snowball
type SnowballOption ¶
type SnowballOption func(*Snowball)
func WithBeta ¶
func WithBeta(beta int) SnowballOption
type Stake ¶
func ParseStakeTransaction ¶
ParseStakeTransaction parses and performs sanity checks on the payload of a stake transaction.
type SyncInfo ¶
type SyncInfo struct {
LatestRound []byte `protobuf:"bytes,1,opt,name=latest_round,json=latestRound,proto3" json:"latest_round,omitempty"`
Checksums [][]byte `protobuf:"bytes,2,rep,name=checksums,proto3" json:"checksums,omitempty"`
}
func (*SyncInfo) Descriptor ¶
func (*SyncInfo) GetChecksums ¶
func (*SyncInfo) GetLatestRound ¶
func (*SyncInfo) ProtoMessage ¶
func (*SyncInfo) ProtoMessage()
func (*SyncInfo) XXX_DiscardUnknown ¶
func (m *SyncInfo) XXX_DiscardUnknown()
func (*SyncInfo) XXX_Marshal ¶
func (*SyncInfo) XXX_Unmarshal ¶
type SyncRequest ¶
type SyncRequest struct {
// Types that are valid to be assigned to Data:
// *SyncRequest_RoundId
// *SyncRequest_Checksum
Data isSyncRequest_Data `protobuf_oneof:"Data"`
}
func (*SyncRequest) Descriptor ¶
func (*SyncRequest) Descriptor() ([]byte, []int)
func (*SyncRequest) GetChecksum ¶
func (m *SyncRequest) GetChecksum() []byte
func (*SyncRequest) GetData ¶
func (m *SyncRequest) GetData() isSyncRequest_Data
func (*SyncRequest) GetRoundId ¶
func (m *SyncRequest) GetRoundId() uint64
func (*SyncRequest) Marshal ¶
func (m *SyncRequest) Marshal() (dAtA []byte, err error)
func (*SyncRequest) ProtoMessage ¶
func (*SyncRequest) ProtoMessage()
func (*SyncRequest) Reset ¶
func (m *SyncRequest) Reset()
func (*SyncRequest) Size ¶
func (m *SyncRequest) Size() (n int)
func (*SyncRequest) String ¶
func (m *SyncRequest) String() string
func (*SyncRequest) Unmarshal ¶
func (m *SyncRequest) Unmarshal(dAtA []byte) error
func (*SyncRequest) XXX_DiscardUnknown ¶
func (m *SyncRequest) XXX_DiscardUnknown()
func (*SyncRequest) XXX_Marshal ¶
func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SyncRequest) XXX_Merge ¶
func (m *SyncRequest) XXX_Merge(src proto.Message)
func (*SyncRequest) XXX_OneofFuncs ¶
func (*SyncRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*SyncRequest) XXX_Size ¶
func (m *SyncRequest) XXX_Size() int
func (*SyncRequest) XXX_Unmarshal ¶
func (m *SyncRequest) XXX_Unmarshal(b []byte) error
type SyncRequest_Checksum ¶
type SyncRequest_Checksum struct {
Checksum []byte `protobuf:"bytes,2,opt,name=checksum,proto3,oneof"`
}
func (*SyncRequest_Checksum) MarshalTo ¶
func (m *SyncRequest_Checksum) MarshalTo(dAtA []byte) (int, error)
func (*SyncRequest_Checksum) Size ¶
func (m *SyncRequest_Checksum) Size() (n int)
type SyncRequest_RoundId ¶
type SyncRequest_RoundId struct {
RoundId uint64 `protobuf:"varint,1,opt,name=round_id,json=roundId,proto3,oneof"`
}
func (*SyncRequest_RoundId) MarshalTo ¶
func (m *SyncRequest_RoundId) MarshalTo(dAtA []byte) (int, error)
func (*SyncRequest_RoundId) Size ¶
func (m *SyncRequest_RoundId) Size() (n int)
type SyncResponse ¶
type SyncResponse struct {
// Types that are valid to be assigned to Data:
// *SyncResponse_Header
// *SyncResponse_Chunk
Data isSyncResponse_Data `protobuf_oneof:"Data"`
}
func (*SyncResponse) Descriptor ¶
func (*SyncResponse) Descriptor() ([]byte, []int)
func (*SyncResponse) GetChunk ¶
func (m *SyncResponse) GetChunk() []byte
func (*SyncResponse) GetData ¶
func (m *SyncResponse) GetData() isSyncResponse_Data
func (*SyncResponse) GetHeader ¶
func (m *SyncResponse) GetHeader() *SyncInfo
func (*SyncResponse) Marshal ¶
func (m *SyncResponse) Marshal() (dAtA []byte, err error)
func (*SyncResponse) ProtoMessage ¶
func (*SyncResponse) ProtoMessage()
func (*SyncResponse) Reset ¶
func (m *SyncResponse) Reset()
func (*SyncResponse) Size ¶
func (m *SyncResponse) Size() (n int)
func (*SyncResponse) String ¶
func (m *SyncResponse) String() string
func (*SyncResponse) Unmarshal ¶
func (m *SyncResponse) Unmarshal(dAtA []byte) error
func (*SyncResponse) XXX_DiscardUnknown ¶
func (m *SyncResponse) XXX_DiscardUnknown()
func (*SyncResponse) XXX_Marshal ¶
func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SyncResponse) XXX_Merge ¶
func (m *SyncResponse) XXX_Merge(src proto.Message)
func (*SyncResponse) XXX_OneofFuncs ¶
func (*SyncResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*SyncResponse) XXX_Size ¶
func (m *SyncResponse) XXX_Size() int
func (*SyncResponse) XXX_Unmarshal ¶
func (m *SyncResponse) XXX_Unmarshal(b []byte) error
type SyncResponse_Chunk ¶
type SyncResponse_Chunk struct {
Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"`
}
func (*SyncResponse_Chunk) MarshalTo ¶
func (m *SyncResponse_Chunk) MarshalTo(dAtA []byte) (int, error)
func (*SyncResponse_Chunk) Size ¶
func (m *SyncResponse_Chunk) Size() (n int)
type SyncResponse_Header ¶
type SyncResponse_Header struct {
Header *SyncInfo `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
func (*SyncResponse_Header) MarshalTo ¶
func (m *SyncResponse_Header) MarshalTo(dAtA []byte) (int, error)
func (*SyncResponse_Header) Size ¶
func (m *SyncResponse_Header) Size() (n int)
type Transaction ¶
type Transaction struct {
Sender AccountID // Transaction sender.
Creator AccountID // Transaction creator.
Nonce uint64
ParentIDs []TransactionID // Transactions parents.
Depth uint64 // Graph depth.
Tag byte
Payload []byte
SenderSignature Signature
CreatorSignature Signature
ID TransactionID // BLAKE2b(*).
Seed [blake2b.Size256]byte // BLAKE2b(Sender || ParentIDs)
SeedLen byte // Number of prefixed zeroes of BLAKE2b(Sender || ParentIDs).
}
func AttachSenderToTransaction ¶
func AttachSenderToTransaction(sender *skademlia.Keypair, tx Transaction, parents ...*Transaction) Transaction
func NewBatchTransaction ¶
func NewBatchTransaction(creator *skademlia.Keypair, tags []byte, payloads [][]byte) Transaction
func NewTransaction ¶
func NewTransaction(creator *skademlia.Keypair, tag byte, payload []byte) Transaction
func UnmarshalTransaction ¶
func UnmarshalTransaction(r io.Reader) (t Transaction, err error)
func (Transaction) IsCritical ¶
func (tx Transaction) IsCritical(difficulty byte) bool
func (Transaction) LogicalUnits ¶
func (tx Transaction) LogicalUnits() int
LogicalUnits counts the total number of atomic logical units of changes the specified tx comprises of.
func (Transaction) Marshal ¶
func (t Transaction) Marshal() []byte
func (Transaction) String ¶
func (tx Transaction) String() string
type TransactionID ¶
type TransactionID = [SizeTransactionID]byte
type Transactions ¶
type Transactions struct {
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"`
}
func (*Transactions) Descriptor ¶
func (*Transactions) Descriptor() ([]byte, []int)
func (*Transactions) GetTransactions ¶
func (m *Transactions) GetTransactions() [][]byte
func (*Transactions) Marshal ¶
func (m *Transactions) Marshal() (dAtA []byte, err error)
func (*Transactions) ProtoMessage ¶
func (*Transactions) ProtoMessage()
func (*Transactions) Reset ¶
func (m *Transactions) Reset()
func (*Transactions) Size ¶
func (m *Transactions) Size() (n int)
func (*Transactions) String ¶
func (m *Transactions) String() string
func (*Transactions) Unmarshal ¶
func (m *Transactions) Unmarshal(dAtA []byte) error
func (*Transactions) XXX_DiscardUnknown ¶
func (m *Transactions) XXX_DiscardUnknown()
func (*Transactions) XXX_Marshal ¶
func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transactions) XXX_Merge ¶
func (m *Transactions) XXX_Merge(src proto.Message)
func (*Transactions) XXX_Size ¶
func (m *Transactions) XXX_Size() int
func (*Transactions) XXX_Unmarshal ¶
func (m *Transactions) XXX_Unmarshal(b []byte) error
type Transfer ¶
type Transfer struct {
Recipient AccountID
Amount uint64
GasLimit uint64
FuncName []byte
FuncParams []byte
}
func ParseTransferTransaction ¶
ParseTransferTransaction parses and performs sanity checks on the payload of a transfer transaction.
type WaveletClient ¶
type WaveletClient interface {
Gossip(ctx context.Context, opts ...grpc.CallOption) (Wavelet_GossipClient, error)
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
CheckOutOfSync(ctx context.Context, in *OutOfSyncRequest, opts ...grpc.CallOption) (*OutOfSyncResponse, error)
Sync(ctx context.Context, opts ...grpc.CallOption) (Wavelet_SyncClient, error)
DownloadTx(ctx context.Context, in *DownloadTxRequest, opts ...grpc.CallOption) (*DownloadTxResponse, error)
}
WaveletClient is the client API for Wavelet service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewWaveletClient ¶
func NewWaveletClient(cc *grpc.ClientConn) WaveletClient
type WaveletServer ¶
type WaveletServer interface {
Gossip(Wavelet_GossipServer) error
Query(context.Context, *QueryRequest) (*QueryResponse, error)
CheckOutOfSync(context.Context, *OutOfSyncRequest) (*OutOfSyncResponse, error)
Sync(Wavelet_SyncServer) error
DownloadTx(context.Context, *DownloadTxRequest) (*DownloadTxResponse, error)
}
WaveletServer is the server API for Wavelet service.
type Wavelet_GossipClient ¶
type Wavelet_GossipClient interface {
Send(*Transactions) error
CloseAndRecv() (*Empty, error)
grpc.ClientStream
}
type Wavelet_GossipServer ¶
type Wavelet_GossipServer interface {
SendAndClose(*Empty) error
Recv() (*Transactions, error)
grpc.ServerStream
}
type Wavelet_SyncClient ¶
type Wavelet_SyncClient interface {
Send(*SyncRequest) error
Recv() (*SyncResponse, error)
grpc.ClientStream
}
type Wavelet_SyncServer ¶
type Wavelet_SyncServer interface {
Send(*SyncResponse) error
Recv() (*SyncRequest, error)
grpc.ServerStream
}