Documentation ¶
Overview ¶
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
Index ¶
- Constants
- Variables
- func CreateBatchesRollbackTx(dbTx *gorm.DB, rts []*RollbackTx) error
- func CreateLogTransactionBatches(dbTx *gorm.DB, lts []*LogTransaction) error
- func CreateSpentInfoBatches(dbTx *gorm.DB, spentInfos []SpentInfo) error
- func CreateTable(dbTx *DbTransaction, tableName, colsSQL string) error
- func CreateTransactionBatches(db *DbTransaction, trs []*Transaction) error
- func CreateView(dbTx *DbTransaction, inViewName, inTables, inWhere, inColSQL string) error
- func DataTypeToColumnType(dataType string) string
- func DecrementTxAttemptCount(dbTx *DbTransaction, transactionHash []byte) error
- func DelExternalList(list []int64) error
- func DeleteLogTransactionsByHash(dbTx *DbTransaction, hash []byte) (int64, error)
- func DeleteQueueTxByHash(dbTx *DbTransaction, hash []byte) (int64, error)
- func DeleteQueueTxs(dbTx *DbTransaction, hs [][]byte) error
- func DeleteTransactionByHash(dbTx *DbTransaction, hash []byte) error
- func DeleteTransactionIfUnused(dbTx *DbTransaction, transactionHash []byte) (int64, error)
- func DeleteTransactions(dbTx *gorm.DB, hs [][]byte) error
- func DeleteTransactionsAttemptsByHash(dbTx *DbTransaction, hash []byte) error
- func DeleteUsedTransactions(dbTx *DbTransaction) (int64, error)
- func DropView(dbTx *DbTransaction, inViewName string) error
- func ExecCLBSchema(id int, wallet int64) error
- func ExecSchema() error
- func ExecSchemaEcosystem(db *DbTransaction, data migration.SqlData) error
- func ExecSubSchema() error
- func GetAllSystemCount() (int64, error)
- func GetAllSystemStatesIDs() ([]int64, []string, error)
- func GetAllUnsentTransactions(limit int) (*[]Transaction, error)
- func GetBlockCountByNode(NodePosition int64, consensusMode int32) (int64, error)
- func GetColumnByID(table, column string, id int64) (result string, err error)
- func GetDB(tr *DbTransaction) *gorm.DB
- func GetExcessCommonTokenMovementPerDay(tx *DbTransaction) (amount decimal.Decimal, err error)
- func GetKeysCount() (int64, error)
- func GetLogTransactionsCount(hash []byte) (int64, error)
- func GetLogTxCount(dbTx *DbTransaction, ecosystemID int64) (int64, error)
- func GetMemberRoles(tx *DbTransaction, ecosys int64, account string) (roles []int64, err error)
- func GetMetricValues(metric, timeInterval, aggregateFunc, timeBlock string) ([]any, error)
- func GetNodeRows(tableName string) (int64, error)
- func GetPledgeAmount() (int64, error)
- func GetQueuedTransactionsCount(hash []byte) (int64, error)
- func GetResult(rows *sql.Rows) ([]map[string]string, error)
- func GetRoleMembers(tx *DbTransaction, ecosys int64, roles []int64) (members []string, err error)
- func GetRowsInfo(rows *sql.Rows, sqlQuest string) ([]map[string]any, error)
- func GetTableListQuery(table string, ecosystemID int64) *gorm.DB
- func GetTableQuery(table string, ecosystemID int64) *gorm.DB
- func GetTransactionCountAll() (int64, error)
- func GetTransactionsCount(hash []byte) (int64, error)
- func GetTxCount() (int64, error)
- func GetTxRateByTxType(txType int8) transactionRate
- func GetTxRecord(tx *DbTransaction, hashStr string) (resultList []any, err error)
- func GormClose() error
- func GormInit(conf conf.DBConfig) error
- func HashExternalTx(id int64, hash []byte) error
- func IncExternalAttempt(id int64) error
- func IncrementTxAttemptCount(dbTx *DbTransaction, transactionHash []byte) (int64, error)
- func InitDB(cfg conf.DBConfig) error
- func InsertTxOutputs(outputTxHash []byte, txOutputsMapCtx map[KeyUTXO][]SpentInfo, ...)
- func KeyTableName(prefix int64) string
- func MarkTransactionSent(transactionHash []byte) (int64, error)
- func MarkTransactionSentBatches(hashArr [][]byte) error
- func MarkTransactionUnusedAndUnverified(dbTx *DbTransaction, transactionHash []byte) (int64, error)
- func MarkTransactionUsed(dbTx *DbTransaction, transactionHash []byte) (int64, error)
- func MarkVerifiedAndNotUsedTransactionsUnverified() (int64, error)
- func MemberHasRole(tx *DbTransaction, role, ecosys int64, account string) (bool, error)
- func MemberHasRolebyName(tx *DbTransaction, ecosys int64, role, account string) (bool, error)
- func PutAllOutputsMap(outputs []SpentInfo, outputsMap map[KeyUTXO][]SpentInfo)
- func PutOutputsMap(keyUTXO KeyUTXO, outputs []SpentInfo, outputsMap map[KeyUTXO][]SpentInfo)
- func RollbackOutputs(blockID int64, db *DbTransaction, logger *log.Entry) error
- func SendTxBatches(rtxs []*RawTx) error
- func SetStopNow() error
- func UpdRollbackHash(dbTx *DbTransaction, hash []byte) error
- func UpdateBlockMsgBatches(dbTx *gorm.DB, newBlockID int64, updBlockMsg []*pbgo.TxResult) error
- func UpdateSchema() error
- func UpdateTxInputs(inputTxHash []byte, txInputsMapCtx map[KeyUTXO][]SpentInfo, ...)
- type AppParam
- type BadBlocks
- type BanRequests
- type Binary
- type BlockChain
- func (b *BlockChain) Create(dbTx *DbTransaction) error
- func (b *BlockChain) DeleteById(dbTx *DbTransaction, id int64) error
- func (b *BlockChain) Get(blockID int64) (bool, error)
- func (b *BlockChain) GetBlocks(startFromID int64, limit int) ([]BlockChain, error)
- func (b *BlockChain) GetBlocksFrom(startFromID int64, ordering string, limit int) ([]BlockChain, error)
- func (b *BlockChain) GetByHash(BlockHash []byte) (bool, error)
- func (b *BlockChain) GetMaxBlock() (bool, error)
- func (b *BlockChain) GetMaxForeignBlock(keyId int64) (bool, error)
- func (b *BlockChain) GetNodeBlocksAtTime(from, to time.Time, node int64) ([]BlockChain, error)
- func (b *BlockChain) GetRecentBlockChain(startBlockId int64, maxBlockId int64) ([]BlockChain, error)
- func (b *BlockChain) GetReverseBlockchain(endBlockID int64, limit int) ([]BlockChain, error)
- func (BlockChain) TableName() string
- type CandidateNode
- func (c *CandidateNode) GetCandidateNodeByAddress(tcpAddress string) error
- func (c *CandidateNode) GetCandidateNodeById(id int64) error
- func (c *CandidateNode) GetCandidateNodeByPublicKey(nodePublicKey string) error
- func (ib *CandidateNode) TableName() string
- func (c *CandidateNode) UpdateCandidateNodeInfo() error
- type CandidateNodes
- type CodeType
- type Combustion
- type Confirmation
- type Contract
- func (c *Contract) Count(db *DbTransaction) (count int64, err error)
- func (c *Contract) CountByEcosystem() (n int64, err error)
- func (c *Contract) Get(Id int64) (bool, error)
- func (c *Contract) GetByApp(appID int64, ecosystemID int64) ([]Contract, error)
- func (c *Contract) GetFromEcosystem(db *DbTransaction, ecosystem int64) ([]Contract, error)
- func (c *Contract) GetList(offset, limit int) ([]Contract, error)
- func (c *Contract) GetListByEcosystem(offset, limit int) ([]Contract, error)
- func (c *Contract) TableName() string
- func (c *Contract) ToMap() (v map[string]string)
- type Cron
- type DbTransaction
- func (dbTx *DbTransaction) AlterTableAddColumn(tableName, columnName, columnType string) error
- func (dbTx *DbTransaction) AlterTableDropColumn(tableName, columnName string) error
- func (tr *DbTransaction) Commit() error
- func (tr *DbTransaction) Connection() *gorm.DB
- func (dbTx *DbTransaction) CreateIndex(indexName, tableName, onColumn string) error
- func (d *DbTransaction) Debug() *DbTransaction
- func (dbTx *DbTransaction) Delete(tblname, where string) error
- func (dbTx *DbTransaction) DropDatabase(name string) error
- func (dbTx *DbTransaction) DropTable(tableName string) error
- func (dbTx *DbTransaction) DropTables() error
- func (dbTx *DbTransaction) ExecSql(sql string) error
- func (dbTx *DbTransaction) GetAllColumnTypes(tblname string) ([]map[string]string, error)
- func (dbTx *DbTransaction) GetAllTransaction(query string, countRows int, args ...any) ([]map[string]string, error)
- func (dbTx *DbTransaction) GetColumnCount(tableName string) (int64, error)
- func (dbTx *DbTransaction) GetColumnDataTypeCharMaxLength(tableName, columnName string) (map[string]string, error)
- func (dbTx *DbTransaction) GetColumnType(tblname, column string) (itype string, err error)
- func (dbTx *DbTransaction) GetList(query string, args ...any) *ListResult
- func (dbTx *DbTransaction) GetNextID(table string) (int64, error)
- func (dbTx *DbTransaction) GetOneRow(query string, args ...any) *OneRow
- func (dbTx *DbTransaction) GetOneRowTransaction(query string, args ...any) *OneRow
- func (dbTx *DbTransaction) GetRecordsCountTx(tableName, where string) (count int64, err error)
- func (dbTx *DbTransaction) GetRowConditionsByTableNameAndID(tblname string, id int64) (string, error)
- func (dbTx *DbTransaction) GetRows(tableName, columns string, offset, limit int) ([]map[string]string, error)
- func (dbTx *DbTransaction) GetSumColumn(table, column, where string) (result string, err error)
- func (dbTx *DbTransaction) GetSumColumnCount(table, column, where string) (result int, err error)
- func (dbTx *DbTransaction) HasTableOrView(names string) bool
- func (dbTx *DbTransaction) IsIndex(tblname, column string) (bool, error)
- func (dbTx *DbTransaction) IsTable(tblname string) bool
- func (dbTx *DbTransaction) NumIndexes(tblname string) (int, error)
- func (tr *DbTransaction) ResetSavepoint(mark string) error
- func (tr *DbTransaction) Rollback() error
- func (tr *DbTransaction) RollbackSavepoint(mark string) error
- func (tr *DbTransaction) Savepoint(mark string) error
- func (dbTx *DbTransaction) Single(query string, args ...any) *SingleResult
- func (dbTx *DbTransaction) Update(tblname, set, where string) error
- type DelayedContract
- type EcoParam
- type Ecosystem
- func (sys *Ecosystem) Delete(dbTx *DbTransaction) error
- func (sys *Ecosystem) FeeMode() (*FeeModeInfo, error)
- func (sys *Ecosystem) Get(dbTx *DbTransaction, id int64) (bool, error)
- func (sys *Ecosystem) GetTokenSymbol(dbTx *DbTransaction, id int64) (bool, error)
- func (sys *Ecosystem) TableName() string
- type EcosystemTx
- type ExternalBlockchain
- type FeeModeFlag
- type FeeModeInfo
- type History
- type InfoBlock
- func (ib *InfoBlock) Create(dbTx *DbTransaction) error
- func (ib *InfoBlock) Get() (bool, error)
- func (ib *InfoBlock) GetUnsent() (bool, error)
- func (ib *InfoBlock) MarkSent() error
- func (ib *InfoBlock) Marshall() []byte
- func (ib *InfoBlock) TableName() string
- func (ib *InfoBlock) Update(dbTx *DbTransaction) error
- type Install
- type Key
- type KeyTableChecker
- type KeyUTXO
- type Language
- type ListResult
- type LogTransaction
- type Member
- type Menu
- type Metric
- type MigrationHistory
- type MoneyTransfer
- type Namer
- type NextIDGetter
- type NodeBanLogs
- type Notification
- type NotificationsCount
- type OneRow
- type Page
- type Permissions
- type PlatformParameter
- func (sp *PlatformParameter) Get(dbTx *DbTransaction, name string) (bool, error)
- func (sp *PlatformParameter) GetJSONField(jsonField string, name string) (string, error)
- func (sp *PlatformParameter) GetNumberOfHonorNodes() (int, error)
- func (sp *PlatformParameter) GetTransaction(dbTx *DbTransaction, name string) (bool, error)
- func (sp *PlatformParameter) GetValueParameterByName(name, value string) (*string, error)
- func (sp *PlatformParameter) SaveArray(dbTx *DbTransaction, list [][]string) error
- func (sp PlatformParameter) TableName() string
- func (sp *PlatformParameter) ToMap() map[string]string
- func (sp PlatformParameter) Update(dbTx *DbTransaction, value string) error
- type QueueBlock
- type QueueTx
- type RawTx
- type Role
- type RolesParticipants
- type RollbackTx
- func (rt *RollbackTx) DeleteByHash(dbTx *DbTransaction) error
- func (rt *RollbackTx) DeleteByHashAndTableName(dbTx *DbTransaction) error
- func (rt *RollbackTx) Get(dbTx *DbTransaction, transactionHash []byte, tableName string) (bool, error)
- func (rt *RollbackTx) GetBlockRollbackTransactions(dbTx *DbTransaction, blockID int64) ([]RollbackTx, error)
- func (rt *RollbackTx) GetRollbackTransactions(dbTx *DbTransaction, transactionHash []byte) ([]map[string]string, error)
- func (rt *RollbackTx) GetRollbackTxsByTableIDAndTableName(tableID, tableName string, limit int) (*[]RollbackTx, error)
- func (rt *RollbackTx) GetRollbacksDiff(dbTx *DbTransaction, blockID int64) ([]byte, error)
- func (*RollbackTx) TableName() string
- type SchemaInter
- type SenderTxCount
- type Signature
- type SingleResult
- type Snippet
- type SpentInfo
- func GetAllOutputs(outputsMap map[KeyUTXO][]SpentInfo) []SpentInfo
- func GetBlockOutputs(dbTx *DbTransaction, blockID int64) ([]SpentInfo, error)
- func GetTxOutputs(db *DbTransaction, keyIds []int64) ([]SpentInfo, error)
- func GetTxOutputsEcosystem(db *DbTransaction, ecosystem int64, keyIds []int64) ([]SpentInfo, error)
- func GetUnusedOutputsMap(keyUTXO KeyUTXO, outputsMap map[KeyUTXO][]SpentInfo) []SpentInfo
- type StateParameter
- func (sp *StateParameter) Get(dbTx *DbTransaction, name string) (bool, error)
- func (sp *StateParameter) GetAllStateParameters(offset, limit *int, names []string) ([]StateParameter, error)
- func (sp *StateParameter) SetTablePrefix(prefix string) *StateParameter
- func (sp *StateParameter) TableName() string
- type StopDaemon
- type Table
- func (t *Table) Count() (count int64, err error)
- func (t *Table) Create(dbTx *DbTransaction) error
- func (t *Table) Delete(dbTx *DbTransaction) error
- func (t *Table) Get(dbTx *DbTransaction, name string) (bool, error)
- func (t *Table) GetAll(prefix string) ([]Table, error)
- func (t *Table) GetColumns(dbTx *DbTransaction, name, jsonKey string) (map[string]string, error)
- func (t *Table) GetPermissions(dbTx *DbTransaction, name, jsonKey string) (map[string]string, error)
- func (t *Table) IsExistsByPermissionsAndTableName(dbTx *DbTransaction, columnName, tableName string) (bool, error)
- func (t *Table) SetTablePrefix(prefix string)
- func (t *Table) TableName() string
- type Transaction
- func (t *Transaction) BeforeCreate(db *gorm.DB) error
- func (t *Transaction) BeforeUpdate(db *gorm.DB) error
- func (t *Transaction) Create(db *DbTransaction) error
- func (t *Transaction) Get(transactionHash []byte) (bool, error)
- func (t *Transaction) GetStopNetwork() (bool, error)
- func (t *Transaction) GetTransactionRateStopNetwork() bool
- func (t *Transaction) GetVerified(transactionHash []byte) (bool, error)
- func (t *Transaction) Read(hash []byte) (bool, error)
- func (t *Transaction) Update(db *DbTransaction) error
- type TransactionStatus
- func (ts *TransactionStatus) Create() error
- func (ts *TransactionStatus) Get(transactionHash []byte) (bool, error)
- func (ts *TransactionStatus) SetError(dbTx *DbTransaction, errorText string, transactionHash []byte) error
- func (ts *TransactionStatus) TableName() string
- func (ts *TransactionStatus) UpdateBlockID(dbTx *DbTransaction, newBlockID int64, transactionHash []byte) error
- func (ts *TransactionStatus) UpdatePenalty(dbTx *DbTransaction, transactionHash []byte) error
- type TransactionsAttempts
Constants ¶
const ( NotificationTypeSingle = 1 NotificationTypeRole = 2 )
const ( // OrderASC as ASC OrderASC = ordering("ASC") // OrderDESC as DESC OrderDESC = ordering("DESC") )
const ( TransactionRateOnBlock transactionRate = iota + 1 TransactionRateApiContract TransactionRateStopNetwork )
This constants contains values of transactions priority
const BinaryTableSuffix = "_binaries"
const ProgressComplete = "complete"
ProgressComplete status of installation progress
Variables ¶
var ( // DBConn is orm connection DBConn *gorm.DB // ErrRecordNotFound is Not Found Record wrapper ErrRecordNotFound = gorm.ErrRecordNotFound // ErrDBConn database connection error ErrDBConn = errors.New("database connection error") )
var ( //ErrEcosystemNotFound = errors.New("Ecosystem not found") //errContract = errType{"E_CONTRACT", "There is not %s contract", http.StatusNotFound} //errDBNil = errType{"E_DBNIL", "DB is nil", defaultStatus} //errDeletedKey = errType{"E_DELETEDKEY", "The key is deleted", http.StatusForbidden} //errEcosystem = errType{"E_ECOSYSTEM", "Ecosystem %d doesn't exist", defaultStatus} //errEmptyPublic = errType{"E_EMPTYPUBLIC", "Public key is undefined", http.StatusBadRequest} //errKeyNotFound = errType{"E_KEYNOTFOUND", "Key has not been found", http.StatusNotFound} //errEmptySign = errType{"E_EMPTYSIGN", "Signature is undefined", defaultStatus} //errHashWrong = errType{"E_HASHWRONG", "Hash is incorrect", http.StatusBadRequest} //errHashNotFound = errType{"E_HASHNOTFOUND", "Hash has not been found", defaultStatus} //errHeavyPage = errType{"E_HEAVYPAGE", "This page is heavy", defaultStatus} //errInstalled = errType{"E_INSTALLED", "Chain is already installed", defaultStatus} //errInvalidWallet = errType{"E_INVALIDWALLET", "Wallet %s is not valid", http.StatusBadRequest} //errLimitForsign = errType{"E_LIMITFORSIGN", "Length of forsign is too big (%d)", defaultStatus} //errLimitTxSize = errType{"E_LIMITTXSIZE", "The size of tx is too big (%d)", defaultStatus} //errNotFound = errType{"E_NOTFOUND", "Page not found", http.StatusNotFound} //errNotFoundRecord = errType{"E_NOTFOUND", "Record not found", http.StatusNotFound} //errParamNotFound = errType{"E_PARAMNOTFOUND", "Parameter %s has not been found", http.StatusNotFound} //errPermission = errType{"E_PERMISSION", "Permission denied", http.StatusUnauthorized} //errQuery = errType{"E_QUERY", "DB query is wrong", http.StatusInternalServerError} //errRecovered = errType{"E_RECOVERED", "API recovered", http.StatusInternalServerError} //errServer = errType{"E_SERVER", "Server error", defaultStatus} //errSignature = errType{"E_SIGNATURE", "Signature is incorrect", http.StatusBadRequest} //errUnknownSign = errType{"E_UNKNOWNSIGN", "Unknown signature", defaultStatus} //errStateLogin = errType{"E_STATELOGIN", "%s is not a membership of ecosystem %s", http.StatusForbidden} //errTableNotFound = errType{"E_TABLENOTFOUND", "Table %s has not been found", http.StatusNotFound} //errToken = errType{"E_TOKEN", "Token is not valid", defaultStatus} //errTokenExpired = errType{"E_TOKENEXPIRED", "Token is expired by %s", http.StatusUnauthorized} //errUnauthorized = errType{"E_UNAUTHORIZED", "Unauthorized", http.StatusUnauthorized} //errUndefineval = errType{"E_UNDEFINEVAL", "Value %s is undefined", defaultStatus} //errUnknownUID = errType{"E_UNKNOWNUID", "Unknown uid", defaultStatus} //errCLB = errType{"E_CLB", "Virtual Dedicated Ecosystem %d doesn't exist", defaultStatus} //errCLBCreated = errType{"E_CLBCREATED", "Virtual Dedicated Ecosystem is already created", http.StatusBadRequest} //errRequestNotFound = errType{"E_REQUESTNOTFOUND", "Request %s doesn't exist", defaultStatus} //errUpdating = errType{"E_UPDATING", "Node is updating blockchain", http.StatusServiceUnavailable} //errStopping = errType{"E_STOPPING", "Network is stopping", http.StatusServiceUnavailable} //errNotImplemented = errType{"E_NOTIMPLEMENTED", "Not implemented", http.StatusNotImplemented} //errParamMoneyDigit = errType{"E_PARAMMONEYDIGIT", "The number of decimal places cannot be exceeded ( %s )", http.StatusBadRequest} //errDiffKey = CodeType{"E_DIFKEY", "Sender's key is different from tx key", defaultStatus} //errBannded = errType{"E_BANNED", "The key is banned till %s", http.StatusForbidden} //errCheckRole = errType{"E_CHECKROLE", "Access denied", http.StatusForbidden} //errNewUser = errType{"E_NEWUSER", "Can't create a new user", http.StatusUnauthorized} CodeSystembusy = CodeType{-1, "System is busy", http.StatusOK, ""} CodeSuccess = CodeType{0, "Success", http.StatusOK, "OK"} //CodeFileNotExists = CodeType{40001, "File %s not exists", http.StatusOK, ""} //CodeFileFormatNotSupports = CodeType{40002, "File %s format is not supported", http.StatusOK, ""} CodeIlgmediafiletype = CodeType{40003, "illegal media file type ", http.StatusOK, ""} CodeIlgfiletype = CodeType{40004, "illegal file type ", http.StatusOK, ""} CodeFilesize = CodeType{40005, "illegal file size ", http.StatusOK, ""} CodeImagesize = CodeType{40006, "illegal image file size ", http.StatusOK, ""} CodeVoicesize = CodeType{40007, "illegal voice file size ", http.StatusOK, ""} CodeVideosize = CodeType{40008, "illegal video file size ", http.StatusOK, ""} CodeRequestformat = CodeType{40009, "illegal request format ", http.StatusOK, ""} CodeThumbnailfilesize = CodeType{400010, "illegal thumbnail file size ", http.StatusOK, ""} CodeUrllength = CodeType{400011, "illegal URL length ", http.StatusOK, ""} CodeMultimediafileempty = CodeType{400012, "The multimedia file is empty ", http.StatusOK, ""} CodePostpacketempty = CodeType{400013, "POST packet is empty ", http.StatusOK, ""} CodeContentempty = CodeType{400014, "The content of the graphic message is empty. ", http.StatusOK, ""} CodeTextcmpty = CodeType{400015, "text message content is empty ", http.StatusOK, ""} CodeMultimediasizelimit = CodeType{400016, "multimedia file size exceeds limit ", http.StatusOK, ""} CodeParamNotNull = CodeType{400017, "Param message content exceeds limit ", http.StatusOK, ""} CodeParamOutRange = CodeType{400018, "Param out of range ", http.StatusOK, ""} CodeParam = CodeType{400019, "Param error ", http.StatusOK, ""} CodeParamNotExists = CodeType{400020, "Param is exists ", http.StatusOK, ""} CodeParamType = CodeType{400021, "Param type error ", http.StatusOK, ""} CodeParamKeyConflict = CodeType{400022, "Param Keyword conflict error ", http.StatusOK, ""} CodeRecordExists = CodeType{400023, "Record already exists ", http.StatusOK, ""} CodeRecordNotExists = CodeType{400024, "Record not exists error ", http.StatusOK, ""} CodeNewRecordNotRelease = CodeType{400025, "New Record not Release error ", http.StatusOK, ""} CodeReleaseRule = CodeType{400026, "Release rule error ", http.StatusOK, ""} CodeDeleteRule = CodeType{400027, "Delete Record delete rule error ", http.StatusOK, ""} CodeHelpDirNotExists = CodeType{400028, "Help parentdir not exists error ", http.StatusOK, ""} CodeDBfinderr = CodeType{400029, "DB find error ", http.StatusOK, ""} CodeDBcreateerr = CodeType{400030, "DB create error ", http.StatusOK, ""} CodeDBupdateerr = CodeType{400031, "DB update error ", http.StatusOK, ""} CodeDBdeleteerr = CodeType{400032, "DB delete error ", http.StatusOK, ""} CodeDBopertionerr = CodeType{400033, "DB opertion error ", http.StatusOK, ""} CodeJsonformaterr = CodeType{400034, "Json format error ", http.StatusOK, ""} CodeBodyformaterr = CodeType{400035, "Body format error ", http.StatusOK, ""} CodeFileNotExists = CodeType{400036, "File not exists", http.StatusOK, ""} //CodeFileFormatNotSupports = CodeType{40002, "File %s format is not supported", http.StatusOK, ""} CodeFileExists = CodeType{400037, "File already exists", http.StatusOK, ""} CodeFileFormatNotSupports = CodeType{400038, "File format is not supported", http.StatusOK, ""} CodeFileCreated = CodeType{400039, "Create File is not supported ", http.StatusOK, ""} CodeFileOpen = CodeType{400039, "Open File is not supported", http.StatusOK, ""} CodeCheckParam = CodeType{400040, "Param error: ", http.StatusOK, ""} CodeGenerateMine = CodeType{400041, "new miner generate faile ", http.StatusOK, ""} CodeImportMine = CodeType{400042, "import miner faile ", http.StatusOK, ""} CodeBooltype = CodeType{400043, "bool type error ", http.StatusOK, ""} CodeUpdateRule = CodeType{400044, "rule error ", http.StatusOK, ""} CodePermissionDenied = CodeType{400045, "Permission denied ", http.StatusOK, ""} CodeNotMineDevidBindActiveid = CodeType{400046, "not mine devid boind Activeid ", http.StatusOK, ""} CodeSignError = CodeType{400047, "sign err ", http.StatusOK, ""} )
var (
EcosystemWallet = "ecosystem_wallet"
)
Functions ¶
func CreateBatchesRollbackTx ¶
func CreateBatchesRollbackTx(dbTx *gorm.DB, rts []*RollbackTx) error
func CreateLogTransactionBatches ¶
func CreateLogTransactionBatches(dbTx *gorm.DB, lts []*LogTransaction) error
func CreateSpentInfoBatches ¶
CreateSpentInfoBatches is creating record of model
func CreateTable ¶
func CreateTable(dbTx *DbTransaction, tableName, colsSQL string) error
CreateTable is creating table
func CreateTransactionBatches ¶
func CreateTransactionBatches(db *DbTransaction, trs []*Transaction) error
CreateTransactionBatches is creating record of model
func CreateView ¶
func CreateView(dbTx *DbTransaction, inViewName, inTables, inWhere, inColSQL string) error
CreateView is creating view table
func DataTypeToColumnType ¶
func DecrementTxAttemptCount ¶
func DecrementTxAttemptCount(dbTx *DbTransaction, transactionHash []byte) error
func DeleteLogTransactionsByHash ¶
func DeleteLogTransactionsByHash(dbTx *DbTransaction, hash []byte) (int64, error)
DeleteLogTransactionsByHash is deleting record by hash
func DeleteQueueTxByHash ¶
func DeleteQueueTxByHash(dbTx *DbTransaction, hash []byte) (int64, error)
DeleteQueueTxByHash is deleting queue tx by hash
func DeleteQueueTxs ¶
func DeleteQueueTxs(dbTx *DbTransaction, hs [][]byte) error
func DeleteTransactionByHash ¶
func DeleteTransactionByHash(dbTx *DbTransaction, hash []byte) error
DeleteTransactionByHash deleting transaction by hash
func DeleteTransactionIfUnused ¶
func DeleteTransactionIfUnused(dbTx *DbTransaction, transactionHash []byte) (int64, error)
DeleteTransactionIfUnused deleting unused transaction
func DeleteTransactionsAttemptsByHash ¶
func DeleteTransactionsAttemptsByHash(dbTx *DbTransaction, hash []byte) error
GetByHash returns TransactionsAttempts existence by hash
func DeleteUsedTransactions ¶
func DeleteUsedTransactions(dbTx *DbTransaction) (int64, error)
DeleteUsedTransactions deleting used transaction
func DropView ¶
func DropView(dbTx *DbTransaction, inViewName string) error
DropView is drop view table
func ExecCLBSchema ¶
ExecCLBSchema is executing schema for off blockchainService
func ExecSchemaEcosystem ¶
func ExecSchemaEcosystem(db *DbTransaction, data migration.SqlData) error
ExecSchemaEcosystem is executing ecosystem schema
func ExecSubSchema ¶
func ExecSubSchema() error
func GetAllSystemCount ¶
func GetAllSystemStatesIDs ¶
GetAllSystemStatesIDs is retrieving all ecosystems ids
func GetAllUnsentTransactions ¶
func GetAllUnsentTransactions(limit int) (*[]Transaction, error)
GetAllUnsentTransactions is retrieving all unset transactions
func GetBlockCountByNode ¶
func GetColumnByID ¶
GetColumnByID returns the value of the column from the table by id
func GetExcessCommonTokenMovementPerDay ¶
func GetExcessCommonTokenMovementPerDay(tx *DbTransaction) (amount decimal.Decimal, err error)
GetExcessCommonTokenMovementPerDay returns sum of amounts 24 hours
func GetLogTransactionsCount ¶
GetLogTransactionsCount count records by transaction hash
func GetLogTxCount ¶
func GetLogTxCount(dbTx *DbTransaction, ecosystemID int64) (int64, error)
GetLogTxCount count records by ecosystemID
func GetMemberRoles ¶
func GetMemberRoles(tx *DbTransaction, ecosys int64, account string) (roles []int64, err error)
GetMemberRoles return map[id]name all roles assign to member in ecosystem
func GetMetricValues ¶
GetMetricValues returns aggregated metric values in the time interval
func GetNodeRows ¶
func GetPledgeAmount ¶
func GetQueuedTransactionsCount ¶
GetQueuedTransactionsCount counting queued transactions
func GetRoleMembers ¶
func GetRoleMembers(tx *DbTransaction, ecosys int64, roles []int64) (members []string, err error)
GetRoleMembers return []id all members assign to roles in ecosystem
func GetTransactionCountAll ¶
GetTransactionCountAll count all transactions
func GetTransactionsCount ¶
GetTransactionsCount count all transactions by hash
func GetTxCount ¶
func GetTxRateByTxType ¶
func GetTxRateByTxType(txType int8) transactionRate
func GetTxRecord ¶
func GetTxRecord(tx *DbTransaction, hashStr string) (resultList []any, err error)
func HashExternalTx ¶
func IncExternalAttempt ¶
func IncrementTxAttemptCount ¶
func IncrementTxAttemptCount(dbTx *DbTransaction, transactionHash []byte) (int64, error)
IncrementTxAttemptCount increases attempt column
func InsertTxOutputs ¶
func MarkTransactionSent ¶
MarkTransactionSent is marking transaction as sent
func MarkTransactionSentBatches ¶
MarkTransactionSentBatches is marking transaction as sent
func MarkTransactionUnusedAndUnverified ¶
func MarkTransactionUnusedAndUnverified(dbTx *DbTransaction, transactionHash []byte) (int64, error)
MarkTransactionUnusedAndUnverified is marking transaction unused and unverified
func MarkTransactionUsed ¶
func MarkTransactionUsed(dbTx *DbTransaction, transactionHash []byte) (int64, error)
MarkTransactionUsed is marking transaction as used
func MarkVerifiedAndNotUsedTransactionsUnverified ¶
MarkVerifiedAndNotUsedTransactionsUnverified is marking verified and unused transaction as unverified
func MemberHasRole ¶
func MemberHasRole(tx *DbTransaction, role, ecosys int64, account string) (bool, error)
MemberHasRole returns true if member has role
func MemberHasRolebyName ¶
func MemberHasRolebyName(tx *DbTransaction, ecosys int64, role, account string) (bool, error)
MemberHasRole returns true if member has role
func PutAllOutputsMap ¶
func PutOutputsMap ¶
func RollbackOutputs ¶
func RollbackOutputs(blockID int64, db *DbTransaction, logger *log.Entry) error
func SendTxBatches ¶
func UpdRollbackHash ¶
func UpdRollbackHash(dbTx *DbTransaction, hash []byte) error
UpdRollbackHash update model rollbacks_hash field
func UpdateBlockMsgBatches ¶
Types ¶
type AppParam ¶
type AppParam struct { ID int64 `gorm:"primary_key;not null"` AppID int64 `gorm:"not null"` Name string `gorm:"not null;size:100"` Value string `gorm:"not null"` Conditions string `gorm:"not null"` // contains filtered or unexported fields }
AppParam is model
func (*AppParam) GetAllAppParameters ¶
func (sp *AppParam) GetAllAppParameters(app int64, offset, limit *int, names []string) ([]AppParam, error)
GetAllAppParameters is returning all state parameters
func (*AppParam) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type BadBlocks ¶
type BadBlocks struct { ID int64 ProducerNodeId int64 BlockId int64 ConsumerNodeId int64 BlockTime time.Time Deleted bool }
func (*BadBlocks) GetNeedToBanNodes ¶
GetNeedToBanNodes is returns list of ban requests for each node
func (*BadBlocks) GetNodeBlocks ¶
type BanRequests ¶
BanRequests represents count of unique ban requests for node
type Binary ¶
type Binary struct { ID int64 Name string Data []byte Hash string MimeType string // contains filtered or unexported fields }
Binary represents record of {prefix}_binaries table
func (*Binary) SetTableName ¶
SetTableName sets name of table
func (*Binary) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type BlockChain ¶
type BlockChain struct { ID int64 `gorm:"primary_key;not_null"` Hash []byte `gorm:"not null"` RollbacksHash []byte `gorm:"not null"` Data []byte `gorm:"not null"` EcosystemID int64 `gorm:"not null"` KeyID int64 `gorm:"not null"` NodePosition int64 `gorm:"not null"` Time int64 `gorm:"not null"` Tx int32 `gorm:"not null"` ConsensusMode int32 `gorm:"not null"` CandidateNodes []byte `gorm:"not null"` }
BlockChain is model
func GetBlockchain ¶
func GetBlockchain(startBlockID int64, endblockID int64, order ordering) ([]BlockChain, error)
GetBlockchain is retrieving chain of blocks from database
func (*BlockChain) Create ¶
func (b *BlockChain) Create(dbTx *DbTransaction) error
Create is creating record of model
func (*BlockChain) DeleteById ¶
func (b *BlockChain) DeleteById(dbTx *DbTransaction, id int64) error
DeleteById is deleting block by ID
func (*BlockChain) Get ¶
func (b *BlockChain) Get(blockID int64) (bool, error)
Get is retrieving model from database
func (*BlockChain) GetBlocks ¶
func (b *BlockChain) GetBlocks(startFromID int64, limit int) ([]BlockChain, error)
GetBlocks is retrieving limited chain of blocks from database
func (*BlockChain) GetBlocksFrom ¶
func (b *BlockChain) GetBlocksFrom(startFromID int64, ordering string, limit int) ([]BlockChain, error)
GetBlocksFrom is retrieving ordered chain of blocks from database
func (*BlockChain) GetByHash ¶
func (b *BlockChain) GetByHash(BlockHash []byte) (bool, error)
GetByHash is retrieving model from database
func (*BlockChain) GetMaxBlock ¶
func (b *BlockChain) GetMaxBlock() (bool, error)
GetMaxBlock returns last block existence
func (*BlockChain) GetMaxForeignBlock ¶
func (b *BlockChain) GetMaxForeignBlock(keyId int64) (bool, error)
GetMaxForeignBlock returns last block generated not by key_id
func (*BlockChain) GetNodeBlocksAtTime ¶
func (b *BlockChain) GetNodeBlocksAtTime(from, to time.Time, node int64) ([]BlockChain, error)
GetNodeBlocksAtTime returns records of blocks for time interval and position of node
func (*BlockChain) GetRecentBlockChain ¶
func (b *BlockChain) GetRecentBlockChain(startBlockId int64, maxBlockId int64) ([]BlockChain, error)
func (*BlockChain) GetReverseBlockchain ¶
func (b *BlockChain) GetReverseBlockchain(endBlockID int64, limit int) ([]BlockChain, error)
GetReverseBlockchain returns records of blocks in reverse ordering
type CandidateNode ¶
type CandidateNode struct { ID int64 `gorm:"column:id" json:"id"` ApiAddress string `gorm:"column:api_address" json:"apiAddress"` TcpAddress string `gorm:"column:tcp_address" json:"tcpAddress"` NodePubKey string `gorm:"column:node_pub_key" json:"nodePubKey"` DateCreated int64 `gorm:"column:date_created" json:"dateCreated"` Deleted uint8 `gorm:"column:deleted" json:"deleted"` DateDeleted int64 `gorm:"column:date_deleted" json:"dateDeleted"` Website string `gorm:"column:website" json:"website"` ReplyCount int64 `gorm:"column:reply_count" json:"replyCount"` DateReply int64 `gorm:"column:date_reply" json:"dateReply"` EarnestTotal decimal.Decimal `gorm:"column:earnest_total" json:"earnestTotal"` NodeName string `gorm:"column:node_name" json:"nodeName"` ReferendumTotal decimal.Decimal `gorm:"column:referendum_total" json:"referendumTotal"` CandidateNodes []byte `json:"candidateNodes"` }
func (*CandidateNode) GetCandidateNodeByAddress ¶
func (c *CandidateNode) GetCandidateNodeByAddress(tcpAddress string) error
func (*CandidateNode) GetCandidateNodeById ¶
func (c *CandidateNode) GetCandidateNodeById(id int64) error
func (*CandidateNode) GetCandidateNodeByPublicKey ¶
func (c *CandidateNode) GetCandidateNodeByPublicKey(nodePublicKey string) error
func (*CandidateNode) TableName ¶
func (ib *CandidateNode) TableName() string
TableName returns name of table
func (*CandidateNode) UpdateCandidateNodeInfo ¶
func (c *CandidateNode) UpdateCandidateNodeInfo() error
type CandidateNodes ¶
type CandidateNodes []CandidateNode
func GetCandidateNode ¶
func GetCandidateNode(numberOfNodes int) (CandidateNodes, error)
GetCandidateNode returns last good block
func (CandidateNodes) Len ¶
func (nodes CandidateNodes) Len() int
func (CandidateNodes) Less ¶
func (nodes CandidateNodes) Less(i, j int) bool
func (CandidateNodes) Swap ¶
func (nodes CandidateNodes) Swap(i, j int)
type CodeType ¶
type Combustion ¶
type Confirmation ¶
type Confirmation struct { BlockID int64 `gorm:"primary_key"` Good int32 `gorm:"not null"` Bad int32 `gorm:"not null"` Time int64 `gorm:"not null"` }
Confirmation is model
func (*Confirmation) CheckAllowGenBlock ¶
func (c *Confirmation) CheckAllowGenBlock() (bool, error)
GetGoodBlock returns last good block
func (*Confirmation) GetConfirmation ¶
func (c *Confirmation) GetConfirmation(blockID int64) (bool, error)
GetConfirmation returns if block with blockID exists
func (*Confirmation) GetGoodBlock ¶
func (c *Confirmation) GetGoodBlock(goodCount int) (bool, error)
GetGoodBlock returns last good block
func (*Confirmation) GetGoodBlockLast ¶
func (c *Confirmation) GetGoodBlockLast() (bool, error)
GetGoodBlockLast returns last good block
type Contract ¶
type Contract struct { ID int64 `json:"id,omitempty"` Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` WalletID int64 `json:"wallet_id,omitempty"` Active bool `json:"active,omitempty"` TokenID int64 `json:"token_id,omitempty"` Conditions string `json:"conditions,omitempty"` AppID int64 `json:"app_id,omitempty"` EcosystemID int64 `gorm:"column:ecosystem" json:"ecosystem_id,omitempty"` }
Contract represents record of 1_contracts table
func (*Contract) Count ¶
func (c *Contract) Count(db *DbTransaction) (count int64, err error)
Count returns count of records in table
func (*Contract) CountByEcosystem ¶
func (*Contract) GetFromEcosystem ¶
func (c *Contract) GetFromEcosystem(db *DbTransaction, ecosystem int64) ([]Contract, error)
GetFromEcosystem retrieving ecosystem contracts from database
func (*Contract) GetListByEcosystem ¶
type Cron ¶
Cron represents record of {prefix}_cron table
func (*Cron) GetAllCronTasks ¶
GetAllCronTasks is returning all cron tasks
func (*Cron) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type DbTransaction ¶
type DbTransaction struct { BinLogSql [][]byte // contains filtered or unexported fields }
DbTransaction is gorm.DB wrapper
func NewDbTransaction ¶
func NewDbTransaction(conn *gorm.DB) *DbTransaction
func StartTransaction ¶
func StartTransaction() (*DbTransaction, error)
StartTransaction is beginning transaction
func (*DbTransaction) AlterTableAddColumn ¶
func (dbTx *DbTransaction) AlterTableAddColumn(tableName, columnName, columnType string) error
AlterTableAddColumn is adding column to table
func (*DbTransaction) AlterTableDropColumn ¶
func (dbTx *DbTransaction) AlterTableDropColumn(tableName, columnName string) error
AlterTableDropColumn is dropping column from table
func (*DbTransaction) Connection ¶
func (tr *DbTransaction) Connection() *gorm.DB
Connection returns connection of database
func (*DbTransaction) CreateIndex ¶
func (dbTx *DbTransaction) CreateIndex(indexName, tableName, onColumn string) error
CreateIndex is creating index on table column
func (*DbTransaction) Debug ¶
func (d *DbTransaction) Debug() *DbTransaction
func (*DbTransaction) Delete ¶
func (dbTx *DbTransaction) Delete(tblname, where string) error
Delete is deleting table rows
func (*DbTransaction) DropDatabase ¶
func (dbTx *DbTransaction) DropDatabase(name string) error
DropDatabase kill all process and drop database
func (*DbTransaction) DropTable ¶
func (dbTx *DbTransaction) DropTable(tableName string) error
DropTable is dropping table
func (*DbTransaction) DropTables ¶
func (dbTx *DbTransaction) DropTables() error
DropTables is dropping all of the tables
func (*DbTransaction) ExecSql ¶
func (dbTx *DbTransaction) ExecSql(sql string) error
ExecSql is exec sql
func (*DbTransaction) GetAllColumnTypes ¶
func (dbTx *DbTransaction) GetAllColumnTypes(tblname string) ([]map[string]string, error)
GetAllColumnTypes returns column types for table
func (*DbTransaction) GetAllTransaction ¶
func (dbTx *DbTransaction) GetAllTransaction(query string, countRows int, args ...any) ([]map[string]string, error)
GetAllTransaction is retrieve all query result rows
func (*DbTransaction) GetColumnCount ¶
func (dbTx *DbTransaction) GetColumnCount(tableName string) (int64, error)
GetColumnCount is counting rows in table
func (*DbTransaction) GetColumnDataTypeCharMaxLength ¶
func (dbTx *DbTransaction) GetColumnDataTypeCharMaxLength(tableName, columnName string) (map[string]string, error)
GetColumnDataTypeCharMaxLength is returns max length of table column
func (*DbTransaction) GetColumnType ¶
func (dbTx *DbTransaction) GetColumnType(tblname, column string) (itype string, err error)
GetColumnType is returns type of column
func (*DbTransaction) GetList ¶
func (dbTx *DbTransaction) GetList(query string, args ...any) *ListResult
GetList returns the result of the query as ListResult variable
func (*DbTransaction) GetNextID ¶
func (dbTx *DbTransaction) GetNextID(table string) (int64, error)
GetNextID returns next ID of table
func (*DbTransaction) GetOneRow ¶
func (dbTx *DbTransaction) GetOneRow(query string, args ...any) *OneRow
GetOneRow returns one row
func (*DbTransaction) GetOneRowTransaction ¶
func (dbTx *DbTransaction) GetOneRowTransaction(query string, args ...any) *OneRow
GetOneRowTransaction returns one row from transactions
func (*DbTransaction) GetRecordsCountTx ¶
func (dbTx *DbTransaction) GetRecordsCountTx(tableName, where string) (count int64, err error)
GetRecordsCountTx is counting all records of table in transaction
func (*DbTransaction) GetRowConditionsByTableNameAndID ¶
func (dbTx *DbTransaction) GetRowConditionsByTableNameAndID(tblname string, id int64) (string, error)
GetRowConditionsByTableNameAndID returns value of `conditions` field for table row by id
func (*DbTransaction) GetSumColumn ¶
func (dbTx *DbTransaction) GetSumColumn(table, column, where string) (result string, err error)
GetSumColumn returns the value of the column from the table by id
func (*DbTransaction) GetSumColumnCount ¶
func (dbTx *DbTransaction) GetSumColumnCount(table, column, where string) (result int, err error)
GetSumColumnCount returns the value of the column from the table by id
func (*DbTransaction) HasTableOrView ¶
func (dbTx *DbTransaction) HasTableOrView(names string) bool
func (*DbTransaction) IsIndex ¶
func (dbTx *DbTransaction) IsIndex(tblname, column string) (bool, error)
IsIndex returns is table column is an index
func (*DbTransaction) IsTable ¶
func (dbTx *DbTransaction) IsTable(tblname string) bool
IsTable returns is table exists
func (*DbTransaction) NumIndexes ¶
func (dbTx *DbTransaction) NumIndexes(tblname string) (int, error)
NumIndexes is counting table indexes
func (*DbTransaction) ResetSavepoint ¶
func (tr *DbTransaction) ResetSavepoint(mark string) error
func (*DbTransaction) Rollback ¶
func (tr *DbTransaction) Rollback() error
Rollback is transaction rollback
func (*DbTransaction) RollbackSavepoint ¶
func (tr *DbTransaction) RollbackSavepoint(mark string) error
RollbackSavepoint rollbacks PostgreSQL Savepoint
func (*DbTransaction) Savepoint ¶
func (tr *DbTransaction) Savepoint(mark string) error
Savepoint creates PostgreSQL Savepoint
func (*DbTransaction) Single ¶
func (dbTx *DbTransaction) Single(query string, args ...any) *SingleResult
Single is retrieving single result
func (*DbTransaction) Update ¶
func (dbTx *DbTransaction) Update(tblname, set, where string) error
Update is updating table rows
type DelayedContract ¶
type DelayedContract struct { ID int64 `gorm:"primary_key;not null"` Contract string `gorm:"not null"` KeyID int64 `gorm:"not null"` BlockID int64 `gorm:"not null"` EveryBlock int64 `gorm:"not null"` Counter int64 `gorm:"not null"` HighRate int64 `gorm:"not null"` Limit int64 `gorm:"not null"` Delete bool `gorm:"not null"` Conditions string `gorm:"not null"` }
DelayedContract represents record of 1_delayed_contracts table
func GetAllDelayedContract ¶
func GetAllDelayedContract() ([]*DelayedContract, error)
func GetAllDelayedContractsForBlockID ¶
func GetAllDelayedContractsForBlockID(blockID int64) ([]*DelayedContract, error)
GetAllDelayedContractsForBlockID returns contracts that want to execute for blockID
func (*DelayedContract) Get ¶
func (dc *DelayedContract) Get(id int64) (bool, error)
Get is retrieving model from database
func (*DelayedContract) GetByContract ¶
func (dc *DelayedContract) GetByContract(dbTx *DbTransaction, contract string) (bool, error)
GetByContract is retrieving model by contract from database
func (DelayedContract) TableName ¶
func (DelayedContract) TableName() string
TableName returns name of table
type EcoParam ¶
func GetEcoParam ¶
func GetEcoParam(db *DbTransaction, ids []int64) ([]EcoParam, error)
GetEcoParam is ecosystem combustion percent, digits
type Ecosystem ¶
type Ecosystem struct { ID int64 `gorm:"primary_key;not null"` Name string IsValued bool EmissionAmount string `gorm:"type:jsonb"` TokenSymbol string TokenName string TypeEmission int64 TypeWithdraw int64 Digits int64 Info string `gorm:"type:jsonb"` FeeModeInfo string `json:"fee_mode_info" gorm:"type:jsonb"` }
Ecosystem is model
func (*Ecosystem) Delete ¶
func (sys *Ecosystem) Delete(dbTx *DbTransaction) error
Delete is deleting record
func (*Ecosystem) FeeMode ¶
func (sys *Ecosystem) FeeMode() (*FeeModeInfo, error)
FeeMode is get ecosystem fee mode
func (*Ecosystem) Get ¶
func (sys *Ecosystem) Get(dbTx *DbTransaction, id int64) (bool, error)
Get is fill receiver from db
func (*Ecosystem) GetTokenSymbol ¶
func (sys *Ecosystem) GetTokenSymbol(dbTx *DbTransaction, id int64) (bool, error)
GetTokenSymbol is get ecosystem token symbol
type EcosystemTx ¶
EcosystemTx represents value of metric
func GetEcosystemTxPerDay ¶
func GetEcosystemTxPerDay(timeBlock int64) ([]*EcosystemTx, error)
GetEcosystemTxPerDay returns the count of transactions per day for ecosystems, processes data for two days
type ExternalBlockchain ¶
type ExternalBlockchain struct { Id int64 `gorm:"primary_key;not null"` Value string `gorm:"not null"` ExternalContract string `gorm:"not null"` ResultContract string `gorm:"not null"` Url string `gorm:"not null"` Uid string `gorm:"not null"` TxTime int64 `gorm:"not null"` Sent int64 `gorm:"not null"` Hash []byte `gorm:"not null"` Attempts int64 `gorm:"not null"` }
ExternalBlockchain represents a txinfo table
func GetExternalList ¶
func GetExternalList() (list []ExternalBlockchain, err error)
GetExternalList returns the list of network tx
type FeeModeFlag ¶
type FeeModeFlag struct { Flag string `json:"flag"` ConversionRate string `json:"conversion_rate"` }
func (FeeModeFlag) ConversionRateToFloat ¶
func (f FeeModeFlag) ConversionRateToFloat() float64
func (FeeModeFlag) FlagToInt ¶
func (f FeeModeFlag) FlagToInt() int64
type FeeModeInfo ¶
type FeeModeInfo struct { FeeModeDetail map[string]FeeModeFlag `json:"fee_mode_detail"` Combustion Combustion `json:"combustion"` FollowFuel float64 `json:"follow_fuel"` }
type History ¶
type History struct { ID int64 SenderID int64 RecipientID int64 SenderBalance decimal.Decimal RecipientBalance decimal.Decimal Amount decimal.Decimal Comment string `json:"comment,omitempty"` BlockID int64 `json:"block_id,omitempty"` TxHash []byte `gorm:"column:txhash"` CreatedAt int64 `json:"created_at,omitempty"` Type int64 // contains filtered or unexported fields }
History represent record of history table
func GetWalletRecordHistory ¶
func (*History) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type InfoBlock ¶
type InfoBlock struct { Hash []byte `gorm:"not null"` EcosystemID int64 `gorm:"not null default 0"` KeyID int64 `gorm:"not null default 0"` NodePosition string `gorm:"not null default 0"` BlockID int64 `gorm:"not null"` Time int64 `gorm:"not null"` CurrentVersion string `gorm:"not null"` Sent int8 `gorm:"not null"` RollbacksHash []byte `gorm:"not null"` ConsensusMode int32 `gorm:"not null"` CandidateNodes []byte `gorm:"not null"` }
InfoBlock is model
func (*InfoBlock) Create ¶
func (ib *InfoBlock) Create(dbTx *DbTransaction) error
Create is creating record of model
func (*InfoBlock) Update ¶
func (ib *InfoBlock) Update(dbTx *DbTransaction) error
Update is update model
type Key ¶
type Key struct { ID int64 `gorm:"primary_key;not null"` AccountID string `gorm:"column:account;not null"` PublicKey []byte `gorm:"column:pub;not null"` Amount string `gorm:"not null"` Maxpay string `gorm:"not null"` Deleted int64 `gorm:"not null"` Blocked int64 `gorm:"not null"` // contains filtered or unexported fields }
Key is model
func (*Key) AccountKeyID ¶
func (*Key) CapableAmount ¶
func (*Key) Get ¶
func (m *Key) Get(db *DbTransaction, wallet int64) (bool, error)
Get is retrieving model from database
func (*Key) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type KeyTableChecker ¶
type KeyTableChecker struct{}
func (KeyTableChecker) IsKeyTable ¶
func (ktc KeyTableChecker) IsKeyTable(tableName string) bool
type Language ¶
type Language struct { ID int64 `gorm:"primary_key;not null"` Name string `gorm:"not null;size:100"` Res string `gorm:"type:jsonb"` Conditions string `gorm:"not null"` // contains filtered or unexported fields }
Language is model
func (*Language) GetAll ¶
func (l *Language) GetAll(dbTx *DbTransaction, prefix string) ([]Language, error)
GetAll is retrieving all records from database
func (*Language) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type ListResult ¶
type ListResult struct {
// contains filtered or unexported fields
}
ListResult is a structure for the list result
func (*ListResult) String ¶
func (r *ListResult) String() ([]string, error)
String return the slice of strings
type LogTransaction ¶
type LogTransaction struct { Hash []byte `gorm:"primary_key;not null"` Block int64 `gorm:"not null"` //TxData []byte `gorm:"not null"` Timestamp int64 `gorm:"not null"` Address int64 `gorm:"not null"` EcosystemID int64 `gorm:"not null"` Status int64 `gorm:"not null"` ContractName string `gorm:"not null"` }
LogTransaction is model
func (*LogTransaction) Create ¶
func (lt *LogTransaction) Create(dbTx *DbTransaction) error
Create is creating record of model
func (*LogTransaction) GetByHash ¶
func (lt *LogTransaction) GetByHash(dbTx *DbTransaction, hash []byte) (bool, error)
GetByHash returns LogTransactions existence by hash
type Member ¶
type Member struct { ID int64 `gorm:"primary_key;not null"` MemberName string `gorm:"not null"` ImageID *int64 MemberInfo string `gorm:"type:jsonb"` // contains filtered or unexported fields }
Member represents a ecosystem member
func (*Member) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type Menu ¶
type Menu struct { ID int64 `gorm:"primary_key;not null" json:"id"` Name string `gorm:"not null" json:"name"` Title string `gorm:"not null" json:"title"` Value string `gorm:"not null" json:"value"` Conditions string `gorm:"not null" json:"conditions"` // contains filtered or unexported fields }
Menu is model
func (*Menu) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type Metric ¶
type Metric struct { ID int64 `gorm:"primary_key;not null"` Time int64 `gorm:"not null"` Metric string `gorm:"not null"` Key string `gorm:"not null"` Value int64 `gorm:"not null"` }
Metric represents record of system_metrics table
type MigrationHistory ¶
type MigrationHistory struct { ID int64 `gorm:"primary_key;not null"` Version string `gorm:"not null"` DateApplied int64 `gorm:"not null"` }
MigrationHistory is model
func (*MigrationHistory) ApplyMigration ¶
func (mh *MigrationHistory) ApplyMigration(version, query string) error
ApplyMigration executes database schema and writes migration history
func (*MigrationHistory) CurrentVersion ¶
func (mh *MigrationHistory) CurrentVersion() (string, error)
CurrentVersion returns current version of database migrations
func (*MigrationHistory) TableName ¶
func (mh *MigrationHistory) TableName() string
TableName returns name of table
type MoneyTransfer ¶
MoneyTransfer from to amount
func GetExcessFromToTokenMovementPerDay ¶
func GetExcessFromToTokenMovementPerDay(tx *DbTransaction) (excess []MoneyTransfer, err error)
GetExcessFromToTokenMovementPerDay returns from to pairs where sum of amount greather than fromToPerDayLimit per 24 hours
type NextIDGetter ¶
type NextIDGetter struct {
Tx *DbTransaction
}
type NodeBanLogs ¶
func (NodeBanLogs) TableName ¶
func (r NodeBanLogs) TableName() string
TableName returns name of table
type Notification ¶
type Notification struct { ID int64 `gorm:"primary_key;not null"` Recipient string `gorm:"type:jsonb"` Sender string `gorm:"type:jsonb"` Notification string `gorm:"type:jsonb"` PageParams string `gorm:"type:jsonb"` ProcessingInfo string `gorm:"type:jsonb"` PageName string `gorm:"size:255"` DateCreated int64 DateStartProcessing int64 DateClosed int64 Closed bool // contains filtered or unexported fields }
Notification structure
func (*Notification) SetTablePrefix ¶
func (n *Notification) SetTablePrefix(tablePrefix string)
SetTablePrefix set table Prefix
func (*Notification) TableName ¶
func (n *Notification) TableName() string
TableName returns table name
type NotificationsCount ¶
type NotificationsCount struct { RecipientID int64 `gorm:"recipient_id"` Account string `gorm:"account"` RoleID int64 `gorm:"role_id"` Count int64 `gorm:"count"` }
func GetNotificationsCount ¶
func GetNotificationsCount(ecosystemID int64, accounts []string) ([]NotificationsCount, error)
GetNotificationsCount returns all unclosed notifications by users and ecosystem through role_id if userIDs is nil or empty then filter will be skipped
type OneRow ¶
OneRow is storing one row result
type Page ¶
type Page struct { ID int64 `gorm:"primary_key;not null" json:"id,omitempty"` Name string `gorm:"not null" json:"name,omitempty"` Value string `gorm:"not null" json:"value,omitempty"` Menu string `gorm:"not null;size:255" json:"menu,omitempty"` ValidateCount int64 `gorm:"not null" json:"nodesCount,omitempty"` AppID int64 `gorm:"column:app_id;not null" json:"app_id,omitempty"` Conditions string `gorm:"not null" json:"conditions,omitempty"` // contains filtered or unexported fields }
Page is model
func (*Page) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type Permissions ¶
type Permissions struct { Insert string `json:"insert"` NewColumn string `json:"new_column"` Update string `json:"update"` Read string `json:"read"` Filter string `json:"filter"` }
func (*Permissions) Scan ¶
func (p *Permissions) Scan(v any) error
type PlatformParameter ¶
type PlatformParameter struct { ID int64 `gorm:"primary_key;not null;"` Name string `gorm:"not null;size:255"` Value string `gorm:"not null"` Conditions string `gorm:"not null"` }
PlatformParameter is model
func GetAllPlatformParameters ¶
func GetAllPlatformParameters(dbTx *DbTransaction, offset, limit *int, names []string) ([]PlatformParameter, error)
GetAllPlatformParameters returns all platform parameters
func (*PlatformParameter) Get ¶
func (sp *PlatformParameter) Get(dbTx *DbTransaction, name string) (bool, error)
Get is retrieving model from database
func (*PlatformParameter) GetJSONField ¶
func (sp *PlatformParameter) GetJSONField(jsonField string, name string) (string, error)
GetJSONField returns fields as json
func (*PlatformParameter) GetNumberOfHonorNodes ¶
func (sp *PlatformParameter) GetNumberOfHonorNodes() (int, error)
func (*PlatformParameter) GetTransaction ¶
func (sp *PlatformParameter) GetTransaction(dbTx *DbTransaction, name string) (bool, error)
GetTransaction is retrieving model from database using transaction
func (*PlatformParameter) GetValueParameterByName ¶
func (sp *PlatformParameter) GetValueParameterByName(name, value string) (*string, error)
GetValueParameterByName returns value parameter by name
func (*PlatformParameter) SaveArray ¶
func (sp *PlatformParameter) SaveArray(dbTx *DbTransaction, list [][]string) error
SaveArray is saving array
func (PlatformParameter) TableName ¶
func (sp PlatformParameter) TableName() string
TableName returns name of table
func (*PlatformParameter) ToMap ¶
func (sp *PlatformParameter) ToMap() map[string]string
ToMap is converting PlatformParameter to map
func (PlatformParameter) Update ¶
func (sp PlatformParameter) Update(dbTx *DbTransaction, value string) error
Update is update model
type QueueBlock ¶
type QueueBlock struct { Hash []byte `gorm:"primary_key;not null"` BlockID int64 `gorm:"not null"` HonorNodeID int64 `gorm:"not null"` }
QueueBlock is model
func (*QueueBlock) DeleteOldBlocks ¶
func (qb *QueueBlock) DeleteOldBlocks() error
DeleteOldBlocks is deleting old blocks
func (*QueueBlock) DeleteQueueBlockByHash ¶
func (qb *QueueBlock) DeleteQueueBlockByHash() error
DeleteQueueBlockByHash is deleting queue by hash
func (*QueueBlock) Get ¶
func (qb *QueueBlock) Get() (bool, error)
Get is retrieving model from database
func (*QueueBlock) GetQueueBlockByHash ¶
func (qb *QueueBlock) GetQueueBlockByHash(hash []byte) (bool, error)
GetQueueBlockByHash is retrieving blocks queue by hash
type QueueTx ¶
type QueueTx struct { Hash []byte `gorm:"primary_key;not null"` Data []byte `gorm:"not null"` FromGate int `gorm:"not null"` Expedite decimal.Decimal `gorm:"not null"` Time int64 `gorm:"not null"` }
QueueTx is model
func GetAllUnverifiedAndUnusedTransactions ¶
func GetAllUnverifiedAndUnusedTransactions(dbTx *DbTransaction, limit int) ([]*QueueTx, error)
GetAllUnverifiedAndUnusedTransactions is returns all unverified and unused transaction
func (*QueueTx) DeleteTx ¶
func (qt *QueueTx) DeleteTx(dbTx *DbTransaction) error
DeleteTx is deleting tx
type RawTx ¶
func (*RawTx) GetExpedite ¶
type Role ¶
type Role struct { ID int64 `gorm:"primary_key;not null" json:"id"` DefaultPage string `gorm:"not null" json:"default_page"` RoleName string `gorm:"not null" json:"role_name"` Deleted int64 `gorm:"not null" json:"deleted"` RoleType int64 `gorm:"not null" json:"role_type"` // contains filtered or unexported fields }
Role is model
func (*Role) Get ¶
func (r *Role) Get(dbTx *DbTransaction, id int64) (bool, error)
Get is retrieving model from database
func (*Role) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type RolesParticipants ¶
type RolesParticipants struct { Id int64 Role string `gorm:"type:jsonb"` Member string `gorm:"type:jsonb"` Appointed string `gorm:"type:jsonb"` DateCreated int64 DateDeleted int64 Deleted bool // contains filtered or unexported fields }
RolesParticipants represents record of {prefix}roles_participants table
func (*RolesParticipants) GetActiveMemberRoles ¶
func (r *RolesParticipants) GetActiveMemberRoles(account string) ([]RolesParticipants, error)
GetActiveMemberRoles returns active assigned roles for memberID
func (*RolesParticipants) SetTablePrefix ¶
func (r *RolesParticipants) SetTablePrefix(prefix int64) *RolesParticipants
SetTablePrefix is setting table prefix
func (RolesParticipants) TableName ¶
func (r RolesParticipants) TableName() string
TableName returns name of table
type RollbackTx ¶
type RollbackTx struct { ID int64 `gorm:"primary_key;not null"` BlockID int64 `gorm:"not null" json:"block_id"` TxHash []byte `gorm:"not null" json:"tx_hash"` NameTable string `gorm:"not null;size:255;column:table_name" json:"table_name"` TableID string `gorm:"not null;size:255" json:"table_id"` Data string `gorm:"not null;type:jsonb" json:"data"` DataHash []byte `gorm:"not null" json:"data_hash"` }
RollbackTx is model
func (*RollbackTx) DeleteByHash ¶
func (rt *RollbackTx) DeleteByHash(dbTx *DbTransaction) error
DeleteByHash is deleting rollbackTx by hash
func (*RollbackTx) DeleteByHashAndTableName ¶
func (rt *RollbackTx) DeleteByHashAndTableName(dbTx *DbTransaction) error
DeleteByHashAndTableName is deleting tx by hash and table name
func (*RollbackTx) Get ¶
func (rt *RollbackTx) Get(dbTx *DbTransaction, transactionHash []byte, tableName string) (bool, error)
Get is retrieving model from database
func (*RollbackTx) GetBlockRollbackTransactions ¶
func (rt *RollbackTx) GetBlockRollbackTransactions(dbTx *DbTransaction, blockID int64) ([]RollbackTx, error)
GetBlockRollbackTransactions returns records of rollback by blockID
func (*RollbackTx) GetRollbackTransactions ¶
func (rt *RollbackTx) GetRollbackTransactions(dbTx *DbTransaction, transactionHash []byte) ([]map[string]string, error)
GetRollbackTransactions is returns rollback transactions
func (*RollbackTx) GetRollbackTxsByTableIDAndTableName ¶
func (rt *RollbackTx) GetRollbackTxsByTableIDAndTableName(tableID, tableName string, limit int) (*[]RollbackTx, error)
GetRollbackTxsByTableIDAndTableName returns records of rollback by table name and id
func (*RollbackTx) GetRollbacksDiff ¶
func (rt *RollbackTx) GetRollbacksDiff(dbTx *DbTransaction, blockID int64) ([]byte, error)
func (*RollbackTx) TableName ¶
func (*RollbackTx) TableName() string
TableName returns name of table
type SchemaInter ¶
type SchemaInter interface {
HasExists(tr *DbTransaction, name string) bool
}
type SenderTxCount ¶
SenderTxCount struct to scan query result
func GetExcessTokenMovementQtyPerBlock ¶
func GetExcessTokenMovementQtyPerBlock(tx *DbTransaction, blockID int64) (excess []SenderTxCount, err error)
GetExcessTokenMovementQtyPerBlock returns from to pairs where money transactions count greather than tokenMovementQtyPerBlockLimit per 24 hours
type Signature ¶
type Signature struct { Name string `gorm:"primary_key;not null;size:255"` Value string `gorm:"not null;type:jsonb"` Conditions string `gorm:"not null"` // contains filtered or unexported fields }
Signature is model
func (*Signature) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type SingleResult ¶
type SingleResult struct {
// contains filtered or unexported fields
}
SingleResult is a structure for the single result
func (*SingleResult) Float64 ¶
func (r *SingleResult) Float64() (float64, error)
Float64 converts string to float64
func (*SingleResult) Int64 ¶
func (r *SingleResult) Int64() (int64, error)
Int64 converts bytes to int64
type Snippet ¶
type Snippet struct { ID int64 `gorm:"primary_key;not null" json:"id,omitempty"` Name string `gorm:"not null" json:"name,omitempty"` Value string `gorm:"not null" json:"value,omitempty"` Conditions string `gorm:"not null" json:"conditions,omitempty"` // contains filtered or unexported fields }
Snippet is code snippet
func (*Snippet) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type SpentInfo ¶
type SpentInfo struct { InputTxHash []byte `gorm:"default:(-)"` InputIndex int32 OutputTxHash []byte `gorm:"not null"` OutputIndex int32 `gorm:"not null"` OutputKeyId int64 `gorm:"not null"` OutputValue string `gorm:"not null"` Ecosystem int64 BlockId int64 Type int32 }
SpentInfo is model
func GetAllOutputs ¶
func GetBlockOutputs ¶
func GetBlockOutputs(dbTx *DbTransaction, blockID int64) ([]SpentInfo, error)
func GetTxOutputs ¶
func GetTxOutputs(db *DbTransaction, keyIds []int64) ([]SpentInfo, error)
func GetTxOutputsEcosystem ¶
func GetTxOutputsEcosystem(db *DbTransaction, ecosystem int64, keyIds []int64) ([]SpentInfo, error)
func GetUnusedOutputsMap ¶
func (*SpentInfo) GetBalance ¶
type StateParameter ¶
type StateParameter struct { ID int64 `gorm:"primary_key;not null"` Name string `gorm:"not null;size:100"` Value string `gorm:"not null"` Conditions string `gorm:"not null"` // contains filtered or unexported fields }
StateParameter is model
func (*StateParameter) Get ¶
func (sp *StateParameter) Get(dbTx *DbTransaction, name string) (bool, error)
Get is retrieving model from database
func (*StateParameter) GetAllStateParameters ¶
func (sp *StateParameter) GetAllStateParameters(offset, limit *int, names []string) ([]StateParameter, error)
GetAllStateParameters is returning all state parameters
func (*StateParameter) SetTablePrefix ¶
func (sp *StateParameter) SetTablePrefix(prefix string) *StateParameter
SetTablePrefix is setting table prefix
func (*StateParameter) TableName ¶
func (sp *StateParameter) TableName() string
TableName returns name of table
type StopDaemon ¶
type StopDaemon struct {
StopTime int64 `gorm:"not null"`
}
StopDaemon is model
func (*StopDaemon) Get ¶
func (sd *StopDaemon) Get() (bool, error)
Get is retrieving model from database
func (*StopDaemon) TableName ¶
func (sd *StopDaemon) TableName() string
TableName returns name of table
type Table ¶
type Table struct { ID int64 `gorm:"primary_key;not null"` Name string `gorm:"not null;size:100"` Permissions Permissions `gorm:"not null;type:jsonb"` Columns string `gorm:"not null"` Conditions string `gorm:"not null"` AppID int64 `gorm:"not null"` Ecosystem int64 `gorm:"not null"` }
Table is model
func (*Table) Create ¶
func (t *Table) Create(dbTx *DbTransaction) error
Create is creating record of model
func (*Table) Delete ¶
func (t *Table) Delete(dbTx *DbTransaction) error
Delete is deleting model from database
func (*Table) Get ¶
func (t *Table) Get(dbTx *DbTransaction, name string) (bool, error)
Get is retrieving model from database
func (*Table) GetColumns ¶
GetColumns returns columns from database
func (*Table) GetPermissions ¶
func (t *Table) GetPermissions(dbTx *DbTransaction, name, jsonKey string) (map[string]string, error)
GetPermissions returns table permissions by name
func (*Table) IsExistsByPermissionsAndTableName ¶
func (t *Table) IsExistsByPermissionsAndTableName(dbTx *DbTransaction, columnName, tableName string) (bool, error)
IsExistsByPermissionsAndTableName returns columns existence by permission and table name
func (*Table) SetTablePrefix ¶
SetTablePrefix is setting table prefix
type Transaction ¶
type Transaction struct { Hash []byte `gorm:"private_key;not null"` Data []byte `gorm:"not null"` Used int8 `gorm:"not null"` HighRate transactionRate `gorm:"not null"` Expedite decimal.Decimal `gorm:"not null"` Type int8 `gorm:"not null"` KeyID int64 `gorm:"not null"` Sent int8 `gorm:"not null"` Verified int8 `gorm:"not null"` Time int64 `gorm:"not null"` }
Transaction is model
func GetAllUnusedTransactions ¶
func GetAllUnusedTransactions(dbTx *DbTransaction, limit int) ([]*Transaction, error)
GetAllUnusedTransactions is retrieving all unused transactions
func GetManyTransactions ¶
func GetManyTransactions(dbtx *DbTransaction, hashes [][]byte) ([]Transaction, error)
func (*Transaction) BeforeCreate ¶
func (t *Transaction) BeforeCreate(db *gorm.DB) error
func (*Transaction) BeforeUpdate ¶
func (t *Transaction) BeforeUpdate(db *gorm.DB) error
func (*Transaction) Create ¶
func (t *Transaction) Create(db *DbTransaction) error
Create is creating record of model
func (*Transaction) Get ¶
func (t *Transaction) Get(transactionHash []byte) (bool, error)
Get is retrieving model from database
func (*Transaction) GetStopNetwork ¶
func (t *Transaction) GetStopNetwork() (bool, error)
func (*Transaction) GetTransactionRateStopNetwork ¶
func (t *Transaction) GetTransactionRateStopNetwork() bool
func (*Transaction) GetVerified ¶
func (t *Transaction) GetVerified(transactionHash []byte) (bool, error)
GetVerified is checking transaction verification by hash
func (*Transaction) Read ¶
func (t *Transaction) Read(hash []byte) (bool, error)
Read is checking transaction existence by hash
func (*Transaction) Update ¶
func (t *Transaction) Update(db *DbTransaction) error
type TransactionStatus ¶
type TransactionStatus struct { Hash []byte `gorm:"primary_key;not null"` Time int64 `gorm:"not null;"` Type byte `gorm:"not null"` WalletID int64 `gorm:"not null"` BlockID int64 `gorm:"not null"` Error string `gorm:"not null"` Penalty int64 `gorm:"not null"` }
TransactionStatus is model
func (*TransactionStatus) Create ¶
func (ts *TransactionStatus) Create() error
Create is creating record of model
func (*TransactionStatus) Get ¶
func (ts *TransactionStatus) Get(transactionHash []byte) (bool, error)
Get is retrieving model from database
func (*TransactionStatus) SetError ¶
func (ts *TransactionStatus) SetError(dbTx *DbTransaction, errorText string, transactionHash []byte) error
SetError is updating transaction status error
func (*TransactionStatus) TableName ¶
func (ts *TransactionStatus) TableName() string
TableName returns name of table
func (*TransactionStatus) UpdateBlockID ¶
func (ts *TransactionStatus) UpdateBlockID(dbTx *DbTransaction, newBlockID int64, transactionHash []byte) error
UpdateBlockID is updating block id
func (*TransactionStatus) UpdatePenalty ¶
func (ts *TransactionStatus) UpdatePenalty(dbTx *DbTransaction, transactionHash []byte) error
UpdatePenalty is updating penalty
type TransactionsAttempts ¶
type TransactionsAttempts struct { Hash []byte `gorm:"primary_key;not null"` Attempt int8 `gorm:"not null"` }
TransactionsAttempts is model
func FindTxAttemptCount ¶
func FindTxAttemptCount(dbTx *DbTransaction, count int) ([]*TransactionsAttempts, error)
func (*TransactionsAttempts) GetByHash ¶
func (ta *TransactionsAttempts) GetByHash(dbTx *DbTransaction, hash []byte) (bool, error)
GetByHash returns TransactionsAttempts existence by hash
func (TransactionsAttempts) TableName ¶
func (m TransactionsAttempts) TableName() string
TableName returns name of table
Source Files ¶
- app_param.go
- bad_blocks.go
- binary.go
- blockchain.go
- candidate_node.go
- confirmations.go
- contract.go
- cron.go
- database.go
- db.go
- delayed_contract.go
- ecosystem.go
- ecosystem_parameter.go
- external_blockchain.go
- history.go
- info_block.go
- install.go
- keys.go
- language.go
- log_transaction.go
- members.go
- menu.go
- metric.go
- migration_history.go
- node_ban_logs.go
- notification.go
- ordering.go
- pages.go
- platform_parameter.go
- queue_block.go
- queue_tx.go
- responecode.go
- result.go
- role.go
- roles_participants.go
- rollback_tx.go
- schema.go
- send_tx.go
- signatures.go
- snippet.go
- spent_info.go
- stop_daemons.go
- tables.go
- transaction.go
- transaction_status.go
- transactions_attempts.go
- tx_record.go
- upd_full_nodes.go
- utxo_token.go
Directories ¶
Path | Synopsis |
---|---|
---------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------- |