strc

package
v3.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2019 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutodelegCfg

type AutodelegCfg struct {
	Address   string    `json:"address" db:"address"`
	PubKey    string    `json:"pub_key" db:"pub_key"`
	Coin      string    `json:"coin" db:"coin"`
	WalletPrc int       `json:"wallet_prc" db:"wallet_prc"`
	UpdYCH    time.Time `json:"-" bson:"-" db:"updated_date"` // ClickHouse::UpdateDate
	VerYCH    int       `json:"-" bson:"-" db:"version"`      // ClickHouse::Version

}

Настройки Автоделегирования для кошелька

type BlockEvent

type BlockEvent struct {
	ID              string    `db:"_id"` // TODO: добавлен по необходимости
	Height          int       `db:"height_i32"`
	Type            string    `db:"type"`
	Role            string    `db:"role"` //DAO,Developers,Validator,Delegator
	Address         string    `db:"address"`
	Amount          float32   `db:"amount_f32"`
	Coin            string    `db:"coin"`
	ValidatorPubKey string    `db:"validator_pub_key"`
	UpdYCH          time.Time `db:"updated_date"` // ClickHouse::UpdateDate
}

Структура - одного события в блоке (для SQL)

type BlockResponse2

type BlockResponse2 struct {
	Hash          string                       `json:"hash" bson:"hash" gorm:"hash" db:"hash"`
	Height        int                          `json:"height_i32" bson:"height_i32" gorm:"height_i32" db:"height_i32"`
	Time          time.Time                    `json:"time" bson:"time" gorm:"time" db:"time"`
	NumTxs        int                          `json:"num_txs_i32" bson:"num_txs_i32" gorm:"num_txs_i32" db:"num_txs_i32"`
	TotalTxs      int                          `json:"total_txs_i32" bson:"total_txs_i32" gorm:"total_txs_i32" db:"total_txs_i32"`
	Transactions  []TransResponseMin           `json:"transactions" bson:"transactions" gorm:"-" db:"-"` // НЕ для SQL
	TransHashArr  []string                     `json:"-" bson:"-" gorm:"transactions" db:"transactions"` // для SQL
	BlockReward   float32                      `json:"block_reward_f32" bson:"block_reward_f32" gorm:"block_reward_f32" db:"block_reward_f32"`
	Size          int                          `json:"size_i32" bson:"size_i32" gorm:"size_i32" db:"size_i32"`
	Validators    []ms.BlockValidatorsResponse `json:"validators" bson:"validators" gorm:"-" db:"-"`
	ValidatorAmnt int                          `json:"valid_amnt" db:"valid_amnt"`
	Proposer      string                       `json:"proposer" bson:"proposer" gorm:"proposer" db:"proposer"` // PubKey пропозер блока
	Events        []ms.BlockEventsResponse     `json:"events" bson:"events" gorm:"-" db:"-"`
	UpdYCH        time.Time                    `json:"-" bson:"-" db:"updated_date"` // ClickHouse::UpdateDate
}

type BlocksStory

type BlocksStory struct {
	ID   uint32 `json:"block_id" db:"block_id"`
	Type string `json:"block_type" db:"block_type"` //создание, пропуск, штраф, старт, стоп //TODO: оформить типом!
}

type CoinActionpData

type CoinActionpData struct {
	Hash        string    `json:"hash" db:"hash"`                           // Хэш транзакции
	Time        time.Time `json:"time" db:"time"`                           // дата движения
	Type        int       `json:"type" db:"type"`                           // type: продажа или покупка
	CoinToBuy   string    `json:"coin_to_buy" db:"coin_to_buy"`             // Монета покупки
	CoinToSell  string    `json:"coin_to_sell" db:"coin_to_sell"`           // Монета продажи
	ValueToBuy  float32   `json:"value_to_buy_f32" db:"value_to_buy_f32"`   // Количество покупки
	ValueToSell float32   `json:"value_to_sell_f32" db:"value_to_sell_f32"` // Количество продано
	Price       float32   `json:"price_f32" db:"price_f32"`                 // Цена
	Volume      float32   `json:"volume_f32" db:"volume_f32"`               // Объем
	UpdYCH      time.Time `json:"-" db:"updated_date"`                      // ClickHouse::UpdateDate
}

Движение монеты

type CoinMarketCapData

type CoinMarketCapData struct {
	Name                 string    `json:"name" db:"name"`     // название монеты
	CoinSymbol           string    `json:"symbol" db:"symbol"` // символ монеты
	CoinURL              string    `json:"coin_url" db:"coin_url"`
	CoinLogoImg          string    `json:"coin_logo_img" db:"coin_logo_img"`
	CoinDesc             string    `json:"coin_desciption" db:"coin_desciption"`
	Time                 time.Time `json:"time" db:"time"`               // дата создания
	TimeUpdate           time.Time `json:"time_update" db:"time_update"` // UPDATE дата последнего обновления
	InitialAmount        float32   `json:"initial_amount_f32" db:"initial_amount_f32"`
	InitialReserve       float32   `json:"initial_reserve_f32" db:"initial_reserve_f32"`
	ConstantReserveRatio int       `json:"constant_reserve_ratio" db:"constant_reserve_ratio"`   // uint, should be from 10 to 100 (в %).
	VolumeNow            float32   `json:"volume_now_f32" db:"volume_now_f32"`                   // UPDATE
	ReserveBalanceNow    float32   `json:"reserve_balance_now_f32" db:"reserve_balance_now_f32"` // UPDATE
	Creator              string    `json:"creator" db:"creator"`
	AmntTrans24x7        int       `json:"amnt_trans_24x7" db:"amnt_trans_24x7"` // UPDATE количество транзакций за последние 7дней (TODO: относительно MNT)
	// UPDATE капитализация
	// всего монет выпущено
	// UPDATE ликвидность движения всего купли/продажи монет за сутки
	Transactions []CoinActionpData `json:"transactions" db:"-"` // движения
	UpdYCH       time.Time         `json:"-" db:"updated_date"` // ClickHouse::UpdateDate
}

////////////////////////////////////////////////////////////////////////////// Информация о монете

type NodeExt

type NodeExt struct {
	RatingID         int           `-`
	ValidatorName    string        `json:"validator_name" db:"validator_name"`
	ValidatorURL     string        `json:"validator_url" db:"validator_url"`
	ValidatorLogoImg string        `json:"validator_logo_img" db:"validator_logo_img"`
	ValidatorDesc    string        `json:"validator_desciption" db:"validator_desciption"`
	Uptime           float32       `json:"uptime" db:"uptime"`
	Created          time.Time     `json:"created" db:"created"`                     // дата создания
	Age              string        `-`                                               // дельта текущая и когда создан в виде строки
	RewardAddress    string        `json:"reward_address" db:"reward_address"`       // Адрес кошелька "Mx..." вознаграждения
	OwnerAddress     string        `json:"owner_address" db:"owner_address"`         // Адрес кошелька "Mx..." основной
	TotalStake       float32       `json:"total_stake_f32" db:"total_stake_f32"`     // Полный стэк
	PubKey           string        `json:"pub_key" db:"pub_key"`                     // паблик ноды "Mp..."
	PubKeyMin        string        `json:"pub_key_min" db:"pub_key_min"`             // короткий паблик ноды "Mp..."
	ValidatorAddress string        `json:"validator_address" db:"validator_address"` // Адрес ноды, в основном в транзакциях
	Commission       int           `json:"commission" db:"commission"`               // комиссия
	CreatedAtBlock   int           `json:"created_at_block" db:"created_at_block"`   // блок создания
	StatusInt        int           `json:"status" db:"status"`                       // числовое значение статуса: 1 - Offline, 2 - Online, 77 - Validator
	TimeUpdate       time.Time     `json:"time_update" db:"time_update"`             // UPDATE дата последнего обновления
	Stakes           []StakesInfo  `json:"stakes" db:"-"`                            // Только у: Candidate(по PubKey)
	Blocks           []BlocksStory `json:"blocks_story" db:"-"`                      // важные исторические блоки
	AmntBlocks       uint64        `json:"amnt_blocks" db:"amnt_blocks"`             // количество "всего"(с пропущенными) блоков в которых является подписантом
	AmntSlashed      int           `json:"amnt_slashed" db:"amnt_slashed"`           // количество штрафов, полный список по запросу из транзакций
	AmnNoBlocks      int           `-`                                               // количество пропущенных блоков
	AmntSlots        int           `json:"amnt_slots" db:"amnt_slots"`               // количество занятых слотов это количество уникальных объектов в Stakes
	UpdYCH           time.Time     `json:"-" db:"updated_date"`                      // ClickHouse::UpdateDate
}

Информация о валидаторе (доработанная, расширенная)

type NodeTodo

type NodeTodo struct {
	Priority   int       `json:"priority" db:"priority"`     // от 0 до макс! главные:(0)?, (1)возврат делегатам,(2) на возмещение штрафов,(3) оплата сервера, на развитие, (4) распределние между соучредителями
	Done       bool      `json:"done" db:"done"`             // выполнено
	Created    time.Time `json:"created" db:"created"`       // создана time
	DoneT      time.Time `json:"donet" db:"donet"`           // выполнено time
	Type       string    `json:"type" db:"type"`             // тип задачи: SEND-CASHBACK,...
	Height     uint32    `json:"height_i32" db:"height_i32"` // блок
	PubKey     string    `json:"pub_key" db:"pub_key"`       // мастернода
	PubKeyMin  string    `-`                                 // мастернода (сокращенная)
	Address    string    `json:"address" db:"address"`       // адрес кошелька X
	AddressMin string    `-`                                 // адрес кошелька X (сокращенная)
	Amount     float32   `json:"amount_f32" db:"amount_f32"` // сумма
	Comment    string    `json:"comment" db:"comment"`       // комментарий
	TxHash     string    `json:"tx_hash" db:"tx_hash"`       // транзакция исполнения
	TxHashMin  string    `-`                                 // транзакция исполнения (сокращенная)
	UpdYCH     time.Time `json:"-" db:"updated_date"`        // ClickHouse::UpdateDate
}

Задачи для исполнения ноде

type NodeUserX

type NodeUserX struct {
	PubKey     string    `json:"pub_key" db:"pub_key"`       // мастернода
	Address    string    `json:"address" db:"address"`       // адрес кошелька X
	Start      time.Time `json:"start" db:"start"`           // дата старта
	Finish     time.Time `json:"finish" db:"finish"`         // дата финиша
	Commission int       `json:"commission" db:"commission"` // новая ставка комиссии
	UpdYCH     time.Time `json:"-" db:"updated_date"`        // ClickHouse::UpdateDate
}

Пользователи валидаторов с новой комиссией

type PairCoins

type PairCoins struct {
	CoinToBuy  string  `json:"coin_to_buy" db:"coin_to_buy"`
	CoinToSell string  `json:"coin_to_sell" db:"coin_to_sell"`
	PriceBuy   float32 `json:"price_buy_f32" db:"price_buy_f32"`
	PriceSell  float32 `json:"price_sell_f32" db:"price_sell_f32"`
	Volume24   float32 `json:"volume_24_f32" db:"volume_24_f32"` // Объем за 24ч
	Change24   float32 `json:"change_24_f32" db:"change_24_f32"` // Изменение за 24ч
	//TODO: добавить Динамика курса {За день | За месяц | За 6 месяцев | За год | За всё время}
	TimeUpdate time.Time `json:"time_update" db:"time_update"` // дата последнего обновления
	// то что заносится в базу не будет:
	PriceBuyOld  float32 `-`
	NewPairCoins bool    `-`
}

Информация о паре монет

type StakesInfo

type StakesInfo struct {
	Owner    string  `json:"owner" bson:"owner" gorm:"owner" db:"owner"`
	Coin     string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	Value    float32 `json:"value_f32" bson:"value_f32" gorm:"value_f32" db:"value_f32"`
	BipValue float32 `json:"bip_value_f32" bson:"bip_value_f32" gorm:"bip_value_f32" db:"bip_value_f32"`
}

стэк кандидата/валидатора в каких монетах

type StatusDB

type StatusDB struct {
	LatestBlockSave int `bson:"latest_block_save" db:"latest_block_save"` // Загруженный блок с базы Minter
	LatestBlockCMC  int `bson:"latest_block_cmc" db:"latest_block_cmc"`   // Обработано блоков для CoinMarketCap info
	LatestBlockVld  int `bson:"latest_block_vld" db:"latest_block_vld"`   // Обработано блоков для Validators info
	LatestBlockRwd  int `bson:"latest_block_rwd" db:"latest_block_rwd"`   // Обработано блоков для Reward-Events
}

Статус базы данных

type TransResponseMin

type TransResponseMin struct {
	Hash    string  `json:"hash" bson:"hash" db:"hash"`
	From    string  `json:"from" bson:"from" db:"from_adrs"`
	Type    int     `json:"type" bson:"type" db:"type"` // тип транзакции
	TypeTxt string  `-`                                 // для вывода в вебе webd
	Code    int     `json:"code" bson:"code" db:"code"` // если не 0, то ОШИБКА, читаем лог(Log)
	Amount  float32 `json:"amount_bip_f32" bson:"amount_bip_f32" db:"amount_bip_f32"`
}

для списка содержимого блока сойдет, можно еще меньше!

type Tx10SetCandidateOnData

type Tx10SetCandidateOnData struct {
	PubKey string `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
}

type Tx11SetCandidateOffData

type Tx11SetCandidateOffData struct {
	PubKey string `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
}

type Tx12CreateMultisigData

type Tx12CreateMultisigData struct {
}

type Tx13MultisendData

type Tx13MultisendData struct {
	// FIXME: Нет кода и идей по хранению в базе DB!!! Исправить это!
	List []Tx1SendData `json:"list" bson:"list" gorm:"-" db:"-"`
}

type Tx1SendData

type Tx1SendData struct {
	Coin  string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	To    string  `json:"to" bson:"to" gorm:"to" db:"to"`
	Value float32 `json:"value_f32" bson:"value_f32" gorm:"value_f32" db:"value_f32"`
}

//////////////////////////////////////////////////////////////////////////////

type Tx2SellCoinData

type Tx2SellCoinData struct {
	CoinToSell  string  `json:"coin_to_sell" bson:"coin_to_sell" gorm:"coin_to_sell" db:"coin_to_sell"`
	CoinToBuy   string  `json:"coin_to_buy" bson:"coin_to_buy" gorm:"coin_to_buy" db:"coin_to_buy"`
	ValueToSell float32 `json:"value_to_sell_f32" bson:"value_to_sell_f32" gorm:"value_to_sell_f32" db:"value_to_sell_f32"`
}

type Tx3SellAllCoinData

type Tx3SellAllCoinData struct {
	CoinToSell string `json:"coin_to_sell" bson:"coin_to_sell" gorm:"coin_to_sell" db:"coin_to_sell"`
	CoinToBuy  string `json:"coin_to_buy" bson:"coin_to_buy" gorm:"coin_to_buy" db:"coin_to_buy"`
}

type Tx4BuyCoinData

type Tx4BuyCoinData struct {
	CoinToBuy  string  `json:"coin_to_buy" bson:"coin_to_buy" gorm:"coin_to_buy" db:"coin_to_buy"`
	CoinToSell string  `json:"coin_to_sell" bson:"coin_to_sell" gorm:"coin_to_sell" db:"coin_to_sell"`
	ValueToBuy float32 `json:"value_to_buy_f32" bson:"value_to_buy_f32" gorm:"value_to_buy_f32" db:"value_to_buy_f32"`
}

type Tx5CreateCoinData

type Tx5CreateCoinData struct {
	Name                 string  `json:"name" bson:"name" gorm:"name" db:"name"`
	CoinSymbol           string  `json:"symbol" bson:"symbol" gorm:"symbol" db:"symbol"`
	ConstantReserveRatio int     `json:"constant_reserve_ratio" bson:"constant_reserve_ratio" gorm:"constant_reserve_ratio" db:"constant_reserve_ratio"`
	InitialAmount        float32 `json:"initial_amount_f32" bson:"initial_amount_f32" gorm:"initial_amount_f32" db:"initial_amount_f32"`
	InitialReserve       float32 `json:"initial_reserve_f32" bson:"initial_reserve_f32" gorm:"initial_reserve_f32" db:"initial_reserve_f32"`
}

type Tx6DeclareCandidacyData

type Tx6DeclareCandidacyData struct {
	Address    string  `json:"address" bson:"address" gorm:"address" db:"address"`
	PubKey     string  `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
	Commission int     `json:"commission" bson:"commission" gorm:"commission" db:"commission"`
	Coin       string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	Stake      float32 `json:"stake_f32" bson:"stake_f32" gorm:"stake_f32" db:"stake_f32"`
}

type Tx7DelegateDate

type Tx7DelegateDate struct {
	PubKey string  `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
	Coin   string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	Stake  float32 `json:"stake_f32" bson:"stake_f32" gorm:"stake_f32" db:"stake_f32"`
}

type Tx8UnbondData

type Tx8UnbondData struct {
	PubKey string  `json:"pub_key" bson:"pub_key" gorm:"pub_key" db:"pub_key"`
	Coin   string  `json:"coin" bson:"coin" gorm:"coin" db:"coin"`
	Value  float32 `json:"value_f32" bson:"value_f32" gorm:"value_f32" db:"value_f32"`
}

type Tx9RedeemCheckData

type Tx9RedeemCheckData struct {
	RawCheck string `json:"raw_check" bson:"raw_check" gorm:"raw_check" db:"raw_check"`
	Proof    string `json:"proof" bson:"proof" gorm:"proof" db:"proof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL