Documentation
¶
Index ¶
- func GetTransactionStateFromResult(txResult int) int
- func IsApprovedLayer(l *pb.Layer) bool
- func IsConfirmedLayer(l *pb.Layer) bool
- func NewLayer(in *pb.Layer, networkInfo *NetworkInfo) (*Layer, []*Block, []*Activation, map[string]*Transaction)
- type Account
- type AccountService
- type Activation
- type ActivationService
- type App
- type AppService
- type Block
- type BlockService
- type Epoch
- type EpochService
- type Geo
- type Layer
- type LayerService
- type NetworkInfo
- type Reward
- type RewardService
- type Smesher
- type SmesherService
- type Statistics
- type Stats
- type Transaction
- type TransactionReceipt
- type TransactionService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsApprovedLayer ¶
func IsConfirmedLayer ¶
func NewLayer ¶
func NewLayer(in *pb.Layer, networkInfo *NetworkInfo) (*Layer, []*Block, []*Activation, map[string]*Transaction)
Types ¶
type Account ¶
type Account struct {
Address string // account public address
Balance uint64 // known account balance
Sent uint64
Received uint64
Awards uint64
Fees uint64
Timestamp uint32
Counter uint64
}
func NewAccount ¶
type AccountService ¶
type Activation ¶
type Activation struct {
Id string
Layer uint32 // the layer that this activation is part of
SmesherId string // id of smesher who created the ATX
Coinbase string // coinbase account id
PrevAtx string // previous ATX pointed to
CommitmentSize uint64 // commitment size in bytes
Timestamp uint32
}
func NewActivation ¶
func NewActivation(atx *pb.Activation, timestamp uint32) *Activation
func (*Activation) GetSmesher ¶
func (atx *Activation) GetSmesher() *Smesher
type ActivationService ¶
type ActivationService interface {
GetActivation(ctx context.Context, query *bson.D) (*Activation, error)
GetActivations(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*Activation, error)
SaveActivation(ctx context.Context, in *Activation) error
}
type AppService ¶
type BlockService ¶
type EpochService ¶
type LayerService ¶
type NetworkInfo ¶
type NetworkInfo struct {
NetId uint32
GenesisTime uint32
EpochNumLayers uint32
MaxTransactionsPerSecond uint32
LayerDuration uint32
LastLayer uint32
LastLayerTimestamp uint32
LastApprovedLayer uint32
LastConfirmedLayer uint32
ConnectedPeers uint64
IsSynced bool
SyncedLayer uint32
TopLayer uint32
VerifiedLayer uint32
}
type Reward ¶
type Reward struct {
Layer uint32
Total uint64
LayerReward uint64
LayerComputed uint32 // layer number of the layer when reward was computed
// tx_fee = total - layer_reward
Coinbase string // account awarded this reward
Smesher string // it will be nice to always have this in reward events
Space uint64
Timestamp uint32
}
type RewardService ¶
type SmesherService ¶
type Statistics ¶
type Statistics struct {
Capacity int64 // Average tx/s rate over capacity considering all layers in the current epoch.
Decentral int64 // Distribution of storage between all active smeshers.
Smeshers int64 // Number of active smeshers in the current epoch.
Transactions int64 // Total number of transactions processed by the state transition function.
Accounts int64 // Total number of on-mesh accounts with a non-zero coin balance as of the current epoch.
Circulation int64 // Total number of Smesh coins in circulation. This is the total balances of all on-mesh accounts.
Rewards int64 // Total amount of Smesh minted as mining rewards as of the last known reward distribution event.
RewardsNumber int64
Security int64 // Total amount of storage committed to the network based on the ATXs in the previous epoch.
TxsAmount int64 // Total amount of coin transferred between accounts in the epoch. Incl coin transactions and smart wallet transactions.
}
type Stats ¶
type Stats struct {
Current Statistics
Cumulative Statistics
}
type Transaction ¶
type Transaction struct {
Id string
Layer uint32
Block string
BlockIndex uint32
Index uint32 // the index of the tx in the ordered list of txs to be executed by stf in the layer
State int
Timestamp uint32
GasProvided uint64
GasPrice uint64
GasUsed uint64 // gas units used by the transaction (gas price in tx)
Fee uint64 // transaction fee charged for the transaction
Amount uint64 // amount of coin transfered in this tx by sender
Counter uint64 // tx counter aka nonce
Type int
Scheme int // the signature's scheme
Signature string // the signature itself
PublicKey string // included in schemes which require signer to provide a public key
Sender string // tx originator, should match signer inside Signature
Receiver string
SvmData string // svm binary data. Decode with svm-codec
}
func NewTransaction ¶
func NewTransaction(in *pb.Transaction, layer uint32, blockId string, timestamp uint32, blockIndex uint32) *Transaction
type TransactionReceipt ¶
type TransactionReceipt struct {
Id string
Layer uint32
Index uint32 // the index of the tx in the ordered list of txs to be executed by stf in the layer
Result int
GasUsed uint64 // gas units used by the transaction (gas price in tx)
Fee uint64 // transaction fee charged for the transaction
SvmData string // svm binary data. Decode with svm-codec
}
func NewTransactionReceipt ¶
func NewTransactionReceipt(txReceipt *pb.TransactionReceipt) *TransactionReceipt
type TransactionService ¶
type TransactionService interface {
GetTransaction(ctx context.Context, query *bson.D) (*Transaction, error)
GetTransactions(ctx context.Context, query *bson.D, opts ...*options.FindOptions) ([]*Transaction, error)
SaveTransaction(ctx context.Context, in *Transaction) error
}
Click to show internal directories.
Click to hide internal directories.