Documentation ¶
Index ¶
- Constants
- type Address
- type AggregatedReward
- type Balance
- type Block
- type BlockAddresses
- type BlockValidator
- type BlockValidators
- type BuyCoinTxData
- type Coin
- type CreateCoinTxData
- type CreateMultisigTxData
- type DeclareCandidacyTxData
- type DelegateTxData
- type EditCandidateTxData
- type ExtenderEnvironment
- type InvalidTransaction
- type MultiSendTxData
- type RedeemCheckTxData
- type Reward
- type SellAllCoinTxData
- type SellCoinTxData
- type SendTxData
- type SetCandidateTxData
- type Slash
- type Stake
- type Transaction
- type TransactionOutput
- type TransactionValidator
- type UnbondTxData
- type Validator
Constants ¶
View Source
const RewardEvent = "noah/RewardEvent"
View Source
const SlashEvent = "noah/SlashEvent"
View Source
const TxTypeBuyCoin = 4
View Source
const TxTypeCreateCoin = 5
View Source
const TxTypeDeclareCandidacy = 6
View Source
const TxTypeDelegate = 7
View Source
const TxTypeEditCandidate = 14
View Source
const TxTypeMultiSend = 13
View Source
const TxTypeMultiSig = 12
View Source
const TxTypeRedeemCheck = 9
View Source
const TxTypeSellAllCoin = 3
View Source
const TxTypeSellCoin = 2
View Source
const TxTypeSend = 1
View Source
const TxTypeSetCandidateOffline = 11
View Source
const TxTypeSetCandidateOnline = 10
View Source
const TxTypeUnbound = 8
View Source
const ValidatorStatusNotReady = 1
View Source
const ValidatorStatusReady = 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID uint64 `json:"id" sql:",pk"` Address string `json:"address" sql:",unique; type:varchar(64)"` UpdatedAtBlockId uint64 `json:"updated_at_block_id"` UpdatedAt time.Time `json:"updated_at"` Balances []*Balance `json:"balances"` //relation has many to Balances Rewards []*Reward `json:"rewards"` //relation has many to Rewards Slashes []*Slash `json:"slashes"` //relation has many to Slashes Transactions []*Transaction `json:"transactions" pg:"fk:from_address_id"` //relation has many to Transactions InvalidTransactions []*InvalidTransaction `json:"invalid_transactions" pg:"fk:from_address_id"` //relation has many to InvalidTransactions CreatedAt time.Time `json:"created_at"` }
type AggregatedReward ¶
type AggregatedReward struct { FromBlockID uint64 `json:"from_block_id" sql:",pk"` ToBlockID uint64 `json:"to_block_id"` AddressID uint64 `json:"address_id" sql:",pk"` ValidatorID uint64 `json:"validator_id" sql:",pk"` Role string `json:"role" sql:",pk"` Amount string `json:"amount" sql:"type:numeric(70)"` TimeID time.Time `json:"time_id"` FromBlock *Block //Relation has one to Blocks ToBlock *Block //Relation has one to Blocks Address *Address //Relation has one to Addresses Validator *Validator //Relation has one to Validators }
type Block ¶
type Block struct { ID uint64 `json:"id" sql:",pk"` TotalTxs uint64 `json:"total_txs" sql:"default:0"` Size uint64 `json:"size"` ProposerValidatorID uint64 `json:"proposer_validator_id"` NumTxs uint32 `json:"num_txs" sql:"default:0"` BlockTime uint64 `json:"block_time"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` BlockReward string `json:"block_reward" sql:"type:numeric(70)"` Hash string `json:"hash"` Proposer *Validator `json:"proposer" pg:"fk:proposer_validator_id"` //relation has one to Validators Validators []*Validator `json:"validators" pg:"many2many:block_validator"` //relation has many to Validators Transactions []*Transaction `json:"transactions"` //relation has many to Transactions InvalidTransactions []*InvalidTransaction `json:"invalid_transactions"` //relation has many to InvalidTransactions Rewards []*Reward `json:"rewards"` //relation has many to Rewards Slashes []*Slash `json:"slashes"` //relation has many to Slashes BlockValidators []BlockValidator `json:"block_validators"` }
type BlockAddresses ¶
type BlockValidator ¶
type BlockValidators ¶
type BuyCoinTxData ¶
type Coin ¶
type Coin struct { ID uint64 `json:"id" sql:",pk"` CreationAddressID *uint64 `json:"creation_address_id"` CreationTransactionID *uint64 `json:"creation_transaction_id"` Crr uint64 `json:"crr"` Volume string `json:"volume" sql:"type:numeric(70)"` ReserveBalance string `json:"reserve_balance" sql:"type:numeric(70)"` Price string `json:"price" sql:"type:numeric(100)"` Capitalization string `json:"capitalization" sql:"type:numeric(100)"` Delegated uint64 `json:"delegated"` StartVolume string `json:"start_volume" sql:"type:numeric(70)"` StartReserveBalance string `json:"start_reserve_balance" sql:"type:numeric(70)"` StartPrice string `json:"start_price" sql:"type:numeric(100)"` Name string `json:"name" sql:"type:varchar(255)"` Symbol string `json:"symbol" sql:"type:varchar(20)"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at" pg:",soft_delete"` Description string `json:"description" sql:"type:varchar(1024)"` IconURL string `json:"icon_url" sql:"type:varchar(255)"` Address string `json:"address" sql:"-"` }
func (Coin) GetAddress ¶ added in v0.1.2
type CreateCoinTxData ¶
type CreateMultisigTxData ¶
type DeclareCandidacyTxData ¶
type DelegateTxData ¶
type EditCandidateTxData ¶
type ExtenderEnvironment ¶
type ExtenderEnvironment struct { // todo wsLink AppName string BaseCoin string CoinsUpdateTime int Debug bool DbName string DbUser string DbPassword string DbHost string DbPort int DbMinIdleConns int DbPoolSize int WsHost string WsPort int WsKey string NodeApi string ApiHost string ApiPort int TxChunkSize int AddrChunkSize int EventsChunkSize int StakeChunkSize int WrkSaveRewardsCount int WrkSaveSlashesCount int WrkSaveTxsCount int WrkSaveTxsOutputCount int WrkSaveInvTxsCount int WrkSaveAddressesCount int WrkSaveValidatorTxsCount int WrkUpdateBalanceCount int WrkGetBalancesFromNodeCount int WrkUpdateTxsIndexNumBlocks int WrkUpdateTxsIndexTime int RewardAggregateEveryBlocksCount int RewardAggregateTimeInterval string NatsClusterID string NatsAddr string }
type InvalidTransaction ¶
type InvalidTransaction struct { ID uint64 `json:"id" sql:",pk"` FromAddressID uint64 `json:"from_address_id"` BlockID uint64 `json:"block_id"` CreatedAt time.Time `json:"created_at"` Type uint8 `json:"type"` Hash string `json:"hash"` TxData string `json:"tx_data" sql:",jsonb"` Block *Block //Relation has one to Blocks FromAddress *Address `pg:"fk:from_address_id"` //Relation has one to Addresses }
func (InvalidTransaction) GetHash ¶
func (t InvalidTransaction) GetHash() string
Return transactions hash with prefix
type MultiSendTxData ¶
type MultiSendTxData struct {
List []SendTxData `json:"list"`
}
type RedeemCheckTxData ¶
type Reward ¶
type Reward struct { BlockID uint64 `json:"block" sql:",pk"` AddressID uint64 `json:"address_id" sql:",pk"` ValidatorID uint64 `json:"validator_id" sql:",pk"` Role string `json:"role" sql:",pk"` Amount string `json:"amount" sql:"type:numeric(70)"` CreatedAt time.Time `json:"created_at"` Block *Block //Relation has one to Blocks Address *Address //Relation has one to Addresses Validator *Validator //Relation has one to Validators }
type SellAllCoinTxData ¶
type SellCoinTxData ¶
type SendTxData ¶
type SetCandidateTxData ¶
type SetCandidateTxData struct {
PubKey string `json:"pub_key"`
}
type Slash ¶
type Slash struct { ID uint64 `json:"id" sql:",pk"` CoinID uint64 `json:"coin_id"` BlockID uint64 `json:"block_id"` AddressID uint64 `json:"address_id"` ValidatorID uint64 `json:"validator_id"` Amount string `json:"amount" sql:"type:numeric(70)"` CreatedAt time.Time `json:"created_at"` Coin *Coin //Relation has one to Coins Block *Block //Relation has one to Blocks Address *Address //Relation has one to Addresses Validator *Validator //Relation has one to Validators }
type Stake ¶
type Stake struct { ID uint64 `json:"id" sql:",pk"` OwnerAddressID uint64 `json:"owner_address_id"` ValidatorID uint64 `json:"validator_id"` CoinID uint64 `json:"coin_id"` Value string `json:"value" sql:"type:numeric(70)"` NoahValue string `json:"noah_value" sql:"type:numeric(70)"` CreatedAt time.Time `json:"created_at"` Coin *Coin `json:"coins"` //Relation has one to Coins OwnerAddress *Address `json:"owner_address" pg:"fk:owner_address_id"` //Relation has one to Addresses Validator *Validator `json:"validator"` //Relation has one to Validators }
type Transaction ¶
type Transaction struct { ID uint64 `json:"id" sql:",pk"` FromAddressID uint64 `json:"from_address_id"` Nonce uint64 `json:"nonce"` GasPrice uint64 `json:"gas_price"` Gas uint64 `json:"gas"` BlockID uint64 `json:"block_id"` GasCoinID uint64 `json:"gas_coin_id"` CreatedAt time.Time `json:"created_at"` Type uint8 `json:"type"` Hash string `json:"hash"` ServiceData string `json:"service_data"` Data json.RawMessage `json:"data"` IData interface{} `json:"-" sql:"-"` Tags map[string]string `json:"tags"` Payload []byte `json:"payload"` RawTx []byte `json:"raw_tx"` Block *Block `json:"block"` //Relation has one to Blocks FromAddress *Address `json:"from_address" pg:"fk:from_address_id"` //Relation has one to Address GasCoin *Coin `json:"gas_coin" pg:"fk:gas_coin_id"` //Relation has one to Coin Validators []*Validator `json:"validators" pg:"many2many:transaction_validator"` //Relation has many to Validators TxOutputs []*TransactionOutput `json:"tx_outputs"` TxOutput *TransactionOutput `json:"tx_output"` }
func (*Transaction) GetHash ¶
func (t *Transaction) GetHash() string
Return transactions hash with prefix
type TransactionOutput ¶
type TransactionOutput struct { ID uint64 `json:"id"` TransactionID uint64 `json:"transaction_id"` ToAddressID uint64 `json:"to_address_id"` CoinID uint64 `json:"coin_id"` Value string `json:"value" sql:"type:numeric(70)"` CreatedAt time.Time `json:"created_at"` Coin *Coin `json:"coin"` //Relation has one to Coins ToAddress *Address `json:"to_address" pg:"fk:to_address_id"` //Relation has one to Addresses Transaction *Transaction `json:"transaction"` //Relation has one to Transactions }
type TransactionValidator ¶
type UnbondTxData ¶
type Validator ¶
type Validator struct { ID uint64 `json:"id" sql:",pk"` RewardAddressID *uint64 `json:"reward_address_id"` OwnerAddressID *uint64 `json:"owner_address_id"` CreatedAtBlockID *uint64 `json:"created_at_block_id"` Status *uint8 `json:"status"` Commission *uint64 `json:"commission"` TotalStake *string `json:"total_stake" sql:"type:numeric(70)"` PublicKey string `json:"public_key" sql:"type:varchar(70)"` Name *string `json:"name"` SiteUrl *string `json:"site_url"` IconUrl *string `json:"icon_url"` Description *string `json:"description"` MetaUpdatedAtBlockID *uint64 `json:"meta_updated_at_block_id"` UpdatedAt *time.Time `json:"updated_at"` RewardAddress *Address `json:"reward_address" pg:"fk:reward_address_id"` OwnerAddress *Address `json:"owner_address" pg:"fk:owner_address_id"` Stakes []*Stake `json:"stakes"` Uptime *float64 `json:"uptime"` CreatedAt time.Time `json:"created_at"` CountDelegators *uint64 `json:"count_delegators"` }
func (Validator) GetPublicKey ¶
Return validatyors PK with prefix
Click to show internal directories.
Click to hide internal directories.