Documentation ¶
Index ¶
- func NewBlock(smesher *Smesher, layer *Layer) (*Block, *Activation)
- type Account
- type Activation
- type ActivationID
- type Amount
- type Block
- type Config
- type Epoch
- type GasOffered
- type Geo
- type Layer
- type Listener
- type Network
- type Rate
- type Reward
- type Signature
- type Smesher
- type SmesherID
- type Transaction
- type TransactionFee
- type TransactionReceipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Activation ¶
type Activation struct { Id ActivationID Layer sm.LayerID // the layer that this activation is part of SmesherId SmesherID // id of smesher who created the ATX Coinbase sm.Address // coinbase account id PrevAtx ActivationID // previous ATX pointed to CommitmentSize uint64 // commitment size in bytes }
func (*Activation) Export ¶
func (atx *Activation) Export() *pb.Activation
type ActivationID ¶
func (*ActivationID) Bytes ¶
func (id *ActivationID) Bytes() []byte
type Block ¶
type Block struct { Id sm.BlockID Transactions []*Transaction }
type GasOffered ¶
func (*GasOffered) Export ¶
func (gasOffered *GasOffered) Export() *pb.GasOffered
type Layer ¶
type Layer struct { Number sm.LayerID Status pb.Layer_LayerStatus Hash []byte // computer layer hash - do we need this? Blocks []*Block // layer's blocks Activations []*Activation // list of layer's activations RootStateHash []byte // when available - the root state hash of global state in this layer Transactions map[sm.TransactionID]*Transaction Rewards []*Reward }
type Listener ¶
type Listener interface { SetNetworkInfo(netId uint64, genesisTime uint64, epochNumLayers uint64, maxTransactionsPerSecond uint64, layerDuration uint64) OnLayerChanged(layer *pb.Layer) OnAccountChanged(account *pb.Account) OnReward(reward *pb.Reward) OnTransactionReceipt(receipt *pb.TransactionReceipt) }
type Network ¶
type Network struct { NetId uint64 GenesisTime uint64 EpochNumLayers uint64 MaxTransactionsPerSecond uint64 LayerDuration uint64 Smeshers []*Smesher SmeshersById map[SmesherID]*Smesher Accounts []*Account AccountsByAddress map[sm.Address]*Account AccountsWithBalance map[sm.Address]*Account Epochs []*Epoch Layers []*Layer Listener Listener // contains filtered or unexported fields }
func NewNetwork ¶
func (*Network) GetCurrentEpochNumber ¶
func (*Network) GetCurrentLayerNumber ¶
type Reward ¶
type Reward struct { Layer sm.LayerID Total Amount LayerReward Amount LayerComputed sm.LayerID // layer number of the layer when reward was computed // tx_fee = total - layer_reward Coinbase sm.Address // account awarded this reward Smesher SmesherID // it will be nice to always have this in reward events }
type Signature ¶
type Signature struct { Scheme pb.Signature_Scheme // the signature's scheme Signature []byte // the signature itself PublicKey []byte // included in schemes which require signer to provide a public key }
type Smesher ¶
type Smesher struct { Id SmesherID Geo Geo Activations []*Activation CommitmentSize uint64 // commitment size in bytes Accounts []Account Active bool }
func NewSmesher ¶
func NewSmesher() *Smesher
func (*Smesher) GetAccount ¶
type Transaction ¶
type Transaction struct { Id sm.TransactionID Sender sm.Address // tx originator, should match signer inside Signature GasOffered GasOffered // gas price and max gas offered Amount Amount // amount of coin transfered in this tx by sender Counter uint64 // tx counter aka nonce Signature Signature // sender signature on transaction State pb.TransactionState_TransactionState Receipt *TransactionReceipt IsSimple bool // CoinTransferTransaction Receiver sm.Address // SmartContractTransaction Type pb.SmartContractTransaction_TransactionType Data []byte // packed binary arguments, including ABI selector Address sm.Address // address of smart contract or template }
func NewCoinTransferTransaction ¶
func NewCoinTransferTransaction(from *Account, to *Account) *Transaction
func (*Transaction) Export ¶
func (tx *Transaction) Export() *pb.Transaction
type TransactionFee ¶
type TransactionReceipt ¶
type TransactionReceipt struct { Id sm.TransactionID // the source transaction // The results of STF transaction processing Result pb.TransactionReceipt_TransactionResult GasUsed uint64 // gas units used by the transaction (gas price in tx) Fee Amount // transaction fee charged for the transaction LayerNumber sm.LayerID // The layer in which the STF processed this transaction Index uint32 // the index of the tx in the ordered list of txs to be executed by stf in the layer AppAddress sm.Address // deployed app address or code template address }
Click to show internal directories.
Click to hide internal directories.