Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireQueue() *queue.Queue
- func ApplyTransaction(round *Round, state *avl.Tree, tx *Transaction) error
- func CollectVotes(accounts *Accounts, snowball *Snowball, voteChan <-chan vote, ...)
- func ExportGraphDOT(round *Round, graph *Graph)
- func LoadContractGlobals(snapshot *avl.Tree, id AccountID) ([]int64, bool)
- func LoadContractMemorySnapshot(snapshot *avl.Tree, id AccountID) []byte
- func ParseJSON(data []byte, tag string) ([]byte, error)
- func ReadAccountBalance(tree *avl.Tree, id AccountID) (uint64, bool)
- func ReadAccountContractCode(tree *avl.Tree, id TransactionID) ([]byte, bool)
- func ReadAccountContractGasBalance(tree *avl.Tree, id TransactionID) (uint64, bool)
- func ReadAccountContractGlobals(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 SaveContractGlobals(snapshot *avl.Tree, id AccountID, globals []int64)
- 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 TestWaitForConsensus(t testing.TB, timeout time.Duration, ledgers []*TestLedger)
- func WriteAccountBalance(tree *avl.Tree, id AccountID, balance uint64)
- func WriteAccountContractCode(tree *avl.Tree, id TransactionID, code []byte)
- func WriteAccountContractGasBalance(tree *avl.Tree, id TransactionID, gasBalance uint64)
- func WriteAccountContractGlobals(tree *avl.Tree, id TransactionID, globals []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 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 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 Indexer
- type LRU
- type Ledger
- func (l *Ledger) AddTransaction(tx Transaction) error
- func (l *Ledger) BroadcastNop() *Transaction
- func (l *Ledger) BroadcastingNop() bool
- func (l *Ledger) FinalizeRounds()
- func (l *Ledger) Finalizer() *Snowball
- func (l *Ledger) Find(query string, max int) (results []string)
- 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) PushSendQuota()
- func (l *Ledger) Rounds() *Rounds
- func (l *Ledger) Snapshot() *avl.Tree
- func (l *Ledger) SyncToLatestRound()
- func (l *Ledger) TakeSendQuota() bool
- type MerkleNodeID
- type Metrics
- type Option
- 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 TestLedger
- func (l *TestLedger) Addr() string
- func (l *TestLedger) Applied(tx Transaction) bool
- func (l *TestLedger) Balance() uint64
- func (l *TestLedger) BalanceOfAccount(node *TestLedger) uint64
- func (l *TestLedger) Cleanup()
- func (l *TestLedger) FindTransaction(t testing.TB, id TransactionID) *Transaction
- func (l *TestLedger) Nop() (Transaction, error)
- func (l *TestLedger) Pay(to *TestLedger, amount uint64) (Transaction, error)
- func (l *TestLedger) PlaceStake(amount uint64) (Transaction, error)
- func (l *TestLedger) PublicKey() AccountID
- func (l *TestLedger) Reward() uint64
- func (l *TestLedger) Stake() uint64
- func (l *TestLedger) StakeOfAccount(node *TestLedger) uint64
- func (l *TestLedger) WaitForConsensus() <-chan bool
- func (l *TestLedger) WithdrawReward(amount uint64) (Transaction, error)
- func (l *TestLedger) WithdrawStake(amount uint64) (Transaction, error)
- type TestLedgerConfig
- type TestNetwork
- type Transaction
- type TransactionID
- type TransactionSeed
- 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 SizeTransactionSeed = blake2b.Size256 SizeRoundID = blake2b.Size256 SizeMerkleNodeID = md5.Size SizeAccountID = 32 SizeSignature = 64 )
const ( // PayloadParamNameRecipient defines a string representation of the recipient payload param. PayloadParamNameRecipient = "recipient" // PayloadParamNameAmount defines a string representation of the amount payload param. PayloadParamNameAmount = "amount" // PayloadParamNameGasLimit defines a string representation of the gas_limit payload param. PayloadParamNameGasLimit = "gas_limit" // PayloadParamNameGasDeposit defines a string representation of the gas_deposit payload param. PayloadParamNameGasDeposit = "gas_deposit" // PayloadParamNameFuncName defines a string representation of the fn_name payload param. PayloadParamNameFuncName = "fn_name" // PayloadParamNameFuncPayload defines a string representation of the fn_payload payload param. PayloadParamNameFuncPayload = "fn_payload" // PayloadParamNameOperation defines a string representation of the operation payload param. PayloadParamNameOperation = "operation" // PayloadParamNameContractCode defines a string representation of the contract_code payload param. PayloadParamNameContractCode = "contract_code" )
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") )
var ( // ErrNoTag defines an error describing an empty Tag. ErrNoTag = errors.New("no tag specified") // ErrInvalidTag defines an error describing an invalid TransactionTag. ErrInvalidTag = errors.New("tag is invalid") // ErrCouldNotParse defines an error describing the inability to parse a given payload. ErrCouldNotParse = errors.New("could not parse the given payload") // ErrNilField defines an error describing a field value equal to nil. ErrNilField = errors.New("field is nil") // ErrInvalidOperation defines an error describing an invalid operation value. ErrInvalidOperation = errors.New("operation is invalid") // ErrInvalidAccountIDSize defines an error describing an invalid account ID size. ErrInvalidAccountIDSize = errors.New("account ID is of an invalid size") )
Functions ¶
func AcquireQueue ¶
func ApplyTransaction ¶ added in v0.1.0
func ApplyTransaction(round *Round, state *avl.Tree, tx *Transaction) error
func CollectVotes ¶
func ExportGraphDOT ¶
func LoadContractGlobals ¶ added in v0.1.1
func ReadAccountContractCode ¶
func ReadAccountContractCode(tree *avl.Tree, id TransactionID) ([]byte, bool)
func ReadAccountContractGasBalance ¶ added in v0.1.0
func ReadAccountContractGasBalance(tree *avl.Tree, id TransactionID) (uint64, bool)
func ReadAccountContractGlobals ¶ added in v0.1.1
func ReadAccountContractGlobals(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 SaveContractGlobals ¶ added in v0.1.1
func SelectPeers ¶
func SelectPeers(peers []*grpc.ClientConn, amount int) ([]*grpc.ClientConn, error)
func StoreRewardWithdrawalRequest ¶
func StoreRewardWithdrawalRequest(tree *avl.Tree, rw RewardWithdrawalRequest)
func StoreRound ¶
func TestWaitForConsensus ¶ added in v0.1.1
func TestWaitForConsensus(t testing.TB, timeout time.Duration, ledgers []*TestLedger)
func WriteAccountContractCode ¶
func WriteAccountContractCode(tree *avl.Tree, id TransactionID, code []byte)
func WriteAccountContractGasBalance ¶ added in v0.1.0
func WriteAccountContractGasBalance(tree *avl.Tree, id TransactionID, gasBalance uint64)
func WriteAccountContractGlobals ¶ added in v0.1.1
func WriteAccountContractGlobals(tree *avl.Tree, id TransactionID, globals []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 ParseBatch ¶ added in v0.1.0
ParseBatch parses and performs sanity checks on the payload of a batch transaction.
func (*Batch) AddContract ¶ added in v0.1.0
AddContract adds a Contract payload into a batch.
func (*Batch) AddTransfer ¶ added in v0.1.0
AddTransfer adds a Transfer payload into a batch.
type Contract ¶
func ParseContract ¶ added in v0.1.0
ParseContract 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 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 WithIndexer ¶ added in v0.1.0
func WithIndexer(indexer *Indexer) GraphOption
func WithMetrics ¶
func WithMetrics(metrics *Metrics) GraphOption
func WithRoot ¶
func WithRoot(root Transaction) GraphOption
type Indexer ¶ added in v0.1.0
Indexer indexes all transaction IDs into a single trie for the purposes of suiting the needs of implementing autocomplete related components.
func NewIndexer ¶ added in v0.1.0
func NewIndexer() *Indexer
NewIndexer instantiates trie indices for indexing complete transactions by their ID.
func (*Indexer) Find ¶ added in v0.1.0
Find searches through complete transaction indices for a specified query string. All indices that queried are in the form of tries.
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) 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) BroadcastingNop ¶ added in v0.1.1
BroadcastingNop returns true if the node is supposed to broadcast nop transaction.
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) Find ¶ added in v0.1.0
Find searches through complete transaction and account indices for a specified query string. All indices that queried are in the form of tries. It is safe to call this method concurrently.
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) PushSendQuota ¶ added in v0.1.0
func (l *Ledger) PushSendQuota()
PushSendQuota permits one token into this nodes send quota bucket every millisecond such that the node may add one single transaction into its graph.
func (*Ledger) SyncToLatestRound ¶
func (l *Ledger) SyncToLatestRound()
func (*Ledger) TakeSendQuota ¶ added in v0.1.0
TakeSendQuota removes one token from this nodes send quota bucket to signal that the node has added one single transaction into its graph.
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
func WithName ¶ added in v0.1.0
func WithName(name string) SnowballOption
type Stake ¶
func ParseStake ¶ added in v0.1.0
ParseStake 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 TestLedger ¶ added in v0.1.1
type TestLedger struct {
// contains filtered or unexported fields
}
func NewTestFaucet ¶ added in v0.1.1
func NewTestFaucet(t testing.TB) *TestLedger
NewTestFaucet returns an account with a lot of PERLs.
func NewTestLedger ¶ added in v0.1.1
func NewTestLedger(t testing.TB, cfg TestLedgerConfig) *TestLedger
func (*TestLedger) Addr ¶ added in v0.1.1
func (l *TestLedger) Addr() string
func (*TestLedger) Applied ¶ added in v0.1.1
func (l *TestLedger) Applied(tx Transaction) bool
func (*TestLedger) Balance ¶ added in v0.1.1
func (l *TestLedger) Balance() uint64
func (*TestLedger) BalanceOfAccount ¶ added in v0.1.1
func (l *TestLedger) BalanceOfAccount(node *TestLedger) uint64
func (*TestLedger) Cleanup ¶ added in v0.1.1
func (l *TestLedger) Cleanup()
func (*TestLedger) FindTransaction ¶ added in v0.1.1
func (l *TestLedger) FindTransaction(t testing.TB, id TransactionID) *Transaction
func (*TestLedger) Nop ¶ added in v0.1.1
func (l *TestLedger) Nop() (Transaction, error)
func (*TestLedger) Pay ¶ added in v0.1.1
func (l *TestLedger) Pay(to *TestLedger, amount uint64) (Transaction, error)
func (*TestLedger) PlaceStake ¶ added in v0.1.1
func (l *TestLedger) PlaceStake(amount uint64) (Transaction, error)
func (*TestLedger) PublicKey ¶ added in v0.1.1
func (l *TestLedger) PublicKey() AccountID
func (*TestLedger) Reward ¶ added in v0.1.1
func (l *TestLedger) Reward() uint64
func (*TestLedger) Stake ¶ added in v0.1.1
func (l *TestLedger) Stake() uint64
func (*TestLedger) StakeOfAccount ¶ added in v0.1.1
func (l *TestLedger) StakeOfAccount(node *TestLedger) uint64
func (*TestLedger) WaitForConsensus ¶ added in v0.1.1
func (l *TestLedger) WaitForConsensus() <-chan bool
func (*TestLedger) WithdrawReward ¶ added in v0.1.1
func (l *TestLedger) WithdrawReward(amount uint64) (Transaction, error)
func (*TestLedger) WithdrawStake ¶ added in v0.1.1
func (l *TestLedger) WithdrawStake(amount uint64) (Transaction, error)
type TestLedgerConfig ¶ added in v0.1.1
type TestNetwork ¶ added in v0.1.1
type TestNetwork struct {
// contains filtered or unexported fields
}
func NewTestNetwork ¶ added in v0.1.1
func NewTestNetwork(t testing.TB) *TestNetwork
func (*TestNetwork) AddNode ¶ added in v0.1.1
func (n *TestNetwork) AddNode(t testing.TB, startingBalance uint64) *TestLedger
func (*TestNetwork) Cleanup ¶ added in v0.1.1
func (n *TestNetwork) Cleanup()
func (*TestNetwork) WaitForConsensus ¶ added in v0.1.1
func (n *TestNetwork) WaitForConsensus(t testing.TB)
type Transaction ¶
type Transaction struct {
Sender AccountID // Transaction sender.
Creator AccountID // Transaction creator.
Nonce uint64
ParentIDs []TransactionID // Transactions parents.
ParentSeeds []TransactionSeed
Depth uint64 // Graph depth.
Tag sys.Tag
Payload []byte
SenderSignature Signature
CreatorSignature Signature
ID TransactionID // BLAKE2b(*).
Seed TransactionSeed // 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
AttachSenderToTransaction immutably attaches sender to a transaction without modifying it in-place.
func NewTransaction ¶
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 (tx Transaction) Marshal() []byte
func (Transaction) String ¶
func (tx Transaction) String() string
type TransactionID ¶
type TransactionID = [SizeTransactionID]byte
type TransactionSeed ¶ added in v0.1.0
type TransactionSeed = [SizeTransactionSeed]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
GasDeposit uint64
FuncName []byte
FuncParams []byte
}
func ParseTransfer ¶ added in v0.1.0
ParseTransfer 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
}