Documentation ¶
Index ¶
- Variables
- func A(vars *map[string]string, pars ...string) (out string)
- func And(vars *map[string]string, pars ...string) string
- func Android() bool
- func AutoUpdate(vars *map[string]string, pars ...string) string
- func AutoUpdateEnd(vars *map[string]string, pars ...string) (out string)
- func Back(vars *map[string]string, pars ...string) string
- func Balance(walletID int64) (decimal.Decimal, error)
- func Bin2Hex(vars *map[string]string, pars ...string) string
- func BinToDec(bin []byte) int64
- func BinToDecBytesShift(bin *[]byte, num int64) int64
- func BinToHex(v interface{}) []byte
- func BlockInfo(vars *map[string]string, pars ...string) string
- func BtnContract(vars *map[string]string, pars ...string) string
- func BtnEdit(vars *map[string]string, pars ...string) string
- func BtnPage(vars *map[string]string, pars ...string) string
- func BytesShift(str *[]byte, index int64) (ret []byte)
- func BytesShiftReverse(str *[]byte, v interface{}) []byte
- func BytesToFloat64(s []byte) float64
- func BytesToInt(s []byte) int
- func BytesToInt64(s []byte) int64
- func CallMethod(i interface{}, methodName string) interface{}
- func Caller(steps int) string
- func ChartBar(vars *map[string]string, pars *map[string]string) string
- func ChartPie(vars *map[string]string, pars *map[string]string) string
- func CheckInputData(idata interface{}, dataType string) bool
- func CheckSign(publicKeys [][]byte, forSign string, signs []byte, nodeKeyOrLogin bool) (bool, error)
- func CmpTime(vars *map[string]string, pars ...string) string
- func CopyFileContents(src, dst string) error
- func CreateHTMLFromTemplate(page string, citizenID, stateID int64, params *map[string]string) (string, error)
- func DSha256(v interface{}) []byte
- func Date(vars *map[string]string, pars ...string) string
- func DateTime(vars *map[string]string, pars ...string) string
- func DecToBin(v interface{}, sizeBytes int64) []byte
- func DecodeLength(buf *[]byte) (ret int64)
- func DecryptCFB(iv, encrypted, key []byte) ([]byte, error)
- func DefLang() string
- func Desktop() bool
- func Div(vars *map[string]string, pars ...string) (out string)
- func Divs(vars *map[string]string, pars ...string) (out string)
- func DivsEnd(vars *map[string]string, pars ...string) (out string)
- func DownloadToFile(url, file string, timeoutSec int64, DaemonCh chan bool, ...) (int64, error)
- func EGSRate(idstate int64) (float64, error)
- func EgaasUpdate(url string) error
- func Else(vars *map[string]string, pars ...string) string
- func ElseIf(vars *map[string]string, pars ...string) string
- func Em(vars *map[string]string, pars ...string) (out string)
- func EncodeLengthPlusData(idata interface{}) []byte
- func EncryptCFB(text, key, iv []byte) ([]byte, []byte, error)
- func ErrInfo(verr interface{}, additionally ...string) error
- func ErrInfoFmt(err string, a ...interface{}) error
- func FirstBlock(exit bool)
- func Float64ToStr(f float64) string
- func ForList(vars *map[string]string, pars ...string) string
- func ForListEnd(vars *map[string]string, pars ...string) (out string)
- func Form(vars *map[string]string, pars ...string) string
- func FormEnd(vars *map[string]string, pars ...string) string
- func FormatQueryArgs(q, dbType string, args ...interface{}) (string, []interface{})
- func FullScreen(vars *map[string]string, pars ...string) string
- func GetBlockBody(host string, blockID int64, dataTypeBlockBody int64) ([]byte, error)
- func GetColumnType(tblname, column string) (itype string)
- func GetCurrentDir() string
- func GetEndBlockID() (int64, error)
- func GetHTTPTextAnswer(url string) (string, error)
- func GetList(vars *map[string]string, pars ...string) string
- func GetMap(vars *map[string]string, pars ...string) string
- func GetMrklroot(binaryData []byte, first bool) ([]byte, error)
- func GetNetworkTime() (*time.Time, error)
- func GetOne(vars *map[string]string, pars ...string) string
- func GetParent() string
- func GetPrefix(tableName, stateID string) (string, error)
- func GetRowVars(vars *map[string]string, pars ...string) string
- func GetTxTypeAndUserID(binaryBlock []byte) (txType int64, walletID int64, citizenID int64)
- func GetUpdVerAndURL(host string) (updinfo *lib.Update, err error)
- func GetVar(vars *map[string]string, pars ...string) (out string)
- func HexToBin(ihexdata interface{}) []byte
- func IDToAddress(vars *map[string]string, pars ...string) string
- func IOS() bool
- func If(vars *map[string]string, pars ...string) string
- func IfEnd(vars *map[string]string, pars ...string) string
- func Image(vars *map[string]string, pars ...string) string
- func ImageInput(vars *map[string]string, pars ...string) string
- func InSliceString(search string, slice []string) bool
- func Include(vars *map[string]string, pars ...string) string
- func Input(vars *map[string]string, pars ...string) string
- func InputAddress(vars *map[string]string, pars ...string) string
- func InputCheckbox(vars *map[string]string, pars ...string) string
- func InputDate(vars *map[string]string, pars ...string) string
- func InputMap(vars *map[string]string, pars ...string) string
- func InputMapPoly(vars *map[string]string, pars ...string) string
- func InputMoney(vars *map[string]string, pars ...string) string
- func Int64ToByte(num int64) []byte
- func Int64ToStr(num int64) string
- func IntToStr(num int) string
- func InterfaceSliceToStr(i []interface{}) []string
- func InterfaceToFloat64(i interface{}) float64
- func InterfaceToStr(v interface{}) string
- func IsLang(code string) bool
- func JSONScript(vars *map[string]string, pars ...string) string
- func Label(vars *map[string]string, pars ...string) string
- func LangJS(vars *map[string]string, pars ...string) string
- func LangMacro(input string, state int, accept string) string
- func LangRes(vars *map[string]string, pars ...string) string
- func LangText(in string, state int, accept string) (string, bool)
- func Legend(vars *map[string]string, pars ...string) (out string)
- func Li(vars *map[string]string, pars ...string) (out string)
- func LiBegin(vars *map[string]string, pars ...string) string
- func LiEnd(vars *map[string]string, pars ...string) string
- func LiTemplate(vars *map[string]string, pars ...string) string
- func LinkPage(vars *map[string]string, pars ...string) string
- func ListVal(vars *map[string]string, pars ...string) string
- func LoadContract(prefix string) (err error)
- func LoadContracts() (err error)
- func Map(vars *map[string]string, pars ...string) string
- func MapPoint(vars *map[string]string, pars ...string) string
- func MarkDown(vars *map[string]string, pars ...string) string
- func Md5(v interface{}) []byte
- func MenuBack(vars *map[string]string, pars ...string) string
- func MenuEnd(vars *map[string]string, pars ...string) string
- func MenuGroup(vars *map[string]string, pars ...string) string
- func MenuItem(vars *map[string]string, pars ...string) string
- func MenuPage(vars *map[string]string, pars ...string) string
- func MerkleTreeRoot(dataArray [][]byte) []byte
- func MessageBoard(vars *map[string]string, pars ...string) string
- func Mobile() bool
- func Money(vars *map[string]string, pars ...string) string
- func Mult(vars *map[string]string, pars ...string) string
- func Navigation(vars *map[string]string, pars ...string) string
- func Now(vars *map[string]string, pars ...string) string
- func Or(vars *map[string]string, pars ...string) string
- func PageEnd(vars *map[string]string, pars ...string) string
- func PageTitle(vars *map[string]string, pars ...string) string
- func Par(vars *map[string]string, pars ...string) (out string)
- func Param(vars *map[string]string, pars ...string) string
- func ProceedTemplate(html string, data interface{}) (string, error)
- func RSortMap(m map[int64]string) []map[int64]string
- func RandInt(min int, max int) int
- func RandSeq(n int) string
- func ReplQ(q string) string
- func Ring(vars *map[string]string, pars ...string) string
- func Round(num float64, precision int) float64
- func Select(vars *map[string]string, pars ...string) string
- func SetVar(vars *map[string]string, pars ...string) string
- func Sha256(v interface{}) []byte
- func ShellExecute(cmdline string)
- func Sleep(sec time.Duration)
- func SliceReverse(s []int64) []int64
- func Small(vars *map[string]string, pars ...string) (out string)
- func SortMap(m map[int64]string) []map[int64]string
- func Source(vars *map[string]string, pars ...string) string
- func Span(vars *map[string]string, pars ...string) (out string)
- func StateLink(vars *map[string]string, pars ...string) string
- func StateParam(idstate int64, name string) (string, error)
- func StateVal(vars *map[string]string, pars ...string) string
- func StrToFloat64(s string) float64
- func StrToInt(s string) int
- func StrToInt64(s string) int64
- func StrToMoney(str string) float64
- func StrToUint64(s string) uint64
- func Strong(vars *map[string]string, pars ...string) (out string)
- func TCPConn(Addr string) (net.Conn, error)
- func TXButton(vars *map[string]string, pars *map[string]string) string
- func TXForm(vars *map[string]string, pars *map[string]string) string
- func Table(vars *map[string]string, pars *map[string]string) string
- func Tag(vars *map[string]string, pars ...string) (out string)
- func TextHidden(vars *map[string]string, pars ...string) (out string)
- func Textarea(vars *map[string]string, pars ...string) string
- func Time() int64
- func Title(vars *map[string]string, pars ...string) string
- func Trim(vars *map[string]string, pars ...string) string
- func TxForm(vars *map[string]string, pars *map[string]string) string
- func TxID(vars *map[string]string, pars ...string) string
- func TypeInt(txType string) int64
- func UInt32ToStr(num uint32) string
- func UList(vars *map[string]string, pars ...string) string
- func UListEnd(vars *map[string]string, pars ...string) string
- func UpdateLang(state int, name, value string)
- func Upload(vars *map[string]string, pars ...string) string
- func Val(vars *map[string]string, pars ...string) string
- func ValidateEmail(email string) bool
- func ValueByID(vars *map[string]string, pars ...string) string
- func WhiteBg(vars *map[string]string, pars ...string) string
- func WhiteMobileBg(vars *map[string]string, pars ...string) string
- func WiAccount(vars *map[string]string, pars ...string) string
- func WiBalance(vars *map[string]string, pars ...string) string
- func WiCitizen(vars *map[string]string, pars ...string) string
- func WriteSelectiveLog(text interface{})
- func WriteSizeAndData(binaryData []byte, conn net.Conn) error
- type BlockData
- type CommonPage
- type DCDB
- func (db *DCDB) CheckDaemonsRestart() bool
- func (db *DCDB) CheckDelegateCB(myStateID int64) (bool, error)
- func (db *DCDB) CheckInstall(DaemonCh chan bool, AnswerDaemonCh chan string, GoroutineName string) bool
- func (db *DCDB) CheckStateName(stateID int64) (bool, error)
- func (db *DCDB) DbLock(DaemonCh chan bool, AnswerDaemonCh chan string, goRoutineName string) (bool, error)
- func (db *DCDB) DbUnlock(goRoutineName string) error
- func (db *DCDB) DecryptData(binaryTx *[]byte) ([]byte, []byte, []byte, error)
- func (db *DCDB) DelLogTx(binaryTx []byte) error
- func (db *DCDB) DeleteQueueBlock(hashHex string) error
- func (db *DCDB) ExecSQL(query string, args ...interface{}) error
- func (db *DCDB) ExecSQLGetAffect(query string, args ...interface{}) (int64, error)
- func (db *DCDB) ExecSQLGetLastInsertID(query, table string, args ...interface{}) (string, error)
- func (db *DCDB) FindInFullNodes(myStateID, myWalletID int64) (int64, error)
- func (db *DCDB) FormatQuery(q string) string
- func (db *DCDB) GetAiID(table string) (string, error)
- func (db *DCDB) GetAll(query string, countRows int, args ...interface{}) ([]map[string]string, error)
- func (db *DCDB) GetAllTables() ([]string, error)
- func (db *DCDB) GetBinSign(forSign string) ([]byte, error)
- func (db *DCDB) GetBlockDataFromBlockChain(blockID int64) (*BlockData, error)
- func (db *DCDB) GetBlockID() (int64, error)
- func (db *DCDB) GetConfirmedBlockID() (int64, error)
- func (db *DCDB) GetFirstColumnName(table string) (string, error)
- func (db *DCDB) GetFirstColumnNamesPg(table string) (string, error)
- func (db *DCDB) GetFuel() decimal.Decimal
- func (db *DCDB) GetHosts() ([]string, error)
- func (db *DCDB) GetInfoBlock() (map[string]string, error)
- func (db *DCDB) GetLastBlockData() (map[string]int64, error)
- func (db *DCDB) GetList(query string, args ...interface{}) *ListResult
- func (db *DCDB) GetMap(query string, name, value string, args ...interface{}) (map[string]string, error)
- func (db *DCDB) GetMyStateID() (int64, error)
- func (db *DCDB) GetMyStateIDAndWalletID() (int64, int64, error)
- func (db *DCDB) GetMyWalletID() (int64, error)
- func (db *DCDB) GetNodeConfig() (map[string]string, error)
- func (db *DCDB) GetNodePrivateKey() (string, error)
- func (db *DCDB) GetNodePublicKey(waletID int64) ([]byte, error)
- func (db *DCDB) GetNodePublicKeyWalletOrCB(walletID, stateID int64) ([]byte, error)
- func (db *DCDB) GetPublicKeyWalletOrCitizen(walletID, citizenID int64) ([]byte, error)
- func (db *DCDB) GetSleepTime(myWalletID, myStateID, prevBlockStateID, prevBlockWalletID int64) (int64, error)
- func (db *DCDB) GetStateName(stateID int64) (string, error)
- func (db *DCDB) GetWalletIDByPublicKey(publicKey []byte) (int64, error)
- func (db *DCDB) InsertInLogTx(binaryTx []byte, time int64) error
- func (db *DCDB) InsertReplaceTxInQueue(data []byte) error
- func (db *DCDB) IsCustomTable(table string) (isCustom bool, err error)
- func (db *DCDB) IsIndex(tblname, column string) (bool, error)
- func (db *DCDB) IsNodeState(state int64, host string) bool
- func (db *DCDB) IsState(country string) (int64, error)
- func (db *DCDB) IsTable(tblname string) bool
- func (db *DCDB) NodesBan(info string) error
- func (db *DCDB) NumIndexes(tblname string) (int, error)
- func (db *DCDB) OneRow(query string, args ...interface{}) *oneRow
- func (db *DCDB) PrintSleep(v interface{}, sleep time.Duration)
- func (db *DCDB) QueryRows(query string, args ...interface{}) (*sql.Rows, error)
- func (db *DCDB) SendTx(txType int64, adminWallet int64, data []byte) (err error)
- func (db *DCDB) SetAI(table string, AI int64) error
- func (db *DCDB) Single(query string, args ...interface{}) *SingleResult
- func (db *DCDB) UpdDaemonTime(name string)
- func (db *DCDB) UpdMainLock() error
- func (db *DCDB) UpdateFuel()
- type DaemonsChansType
- type FieldInfo
- type FormInfo
- type ListResult
- type PageTpl
- type SelInfo
- type SelList
- type SingleResult
- type TxBtnCont
- type TxButtonInfo
- type TxInfo
Constants ¶
This section is empty.
Variables ¶
var ( // FirstBlockDir is a folder where 1block file will be stored FirstBlockDir = flag.String("firstBlockDir", "", "FirstBlockDir") // FirstBlockPublicKey is the private key FirstBlockPublicKey = flag.String("firstBlockPublicKey", "", "FirstBlockPublicKey") // FirstBlockNodePublicKey is the node private key FirstBlockNodePublicKey = flag.String("firstBlockNodePublicKey", "", "FirstBlockNodePublicKey") // FirstBlockHost is the host of the first block FirstBlockHost = flag.String("firstBlockHost", "", "FirstBlockHost") // WalletAddress is a wallet address for forging WalletAddress = flag.String("walletAddress", "", "walletAddress for forging ") // TCPHost is the tcp host TCPHost = flag.String("tcpHost", "", "tcpHost (e.g. 127.0.0.1)") // ListenHTTPPort is HTTP port ListenHTTPPort = flag.String("listenHttpPort", "7079", "ListenHTTPPort") // GenerateFirstBlock show if the first block must be generated GenerateFirstBlock = flag.Int64("generateFirstBlock", 0, "generateFirstBlock") // OldVersion is the number of the old version OldVersion = flag.String("oldVersion", "", "") // TestRollBack equals 1 for testing rollback TestRollBack = flag.Int64("testRollBack", 0, "testRollBack") // Dir is EGAAS folder Dir = flag.String("dir", GetCurrentDir(), "DayLight directory") // OldFileName is the old file name OldFileName = flag.String("oldFileName", "", "") // LogLevel is the log level LogLevel = flag.String("logLevel", "", "DayLight LogLevel") // Console equals 1 for starting in console Console = flag.Int64("console", 0, "Start from console") // StartBlockID is the start block StartBlockID = flag.Int64("startBlockId", 0, "Start block for blockCollection daemon") // EndBlockID is the end block EndBlockID = flag.Int64("endBlockId", 0, "End block for blockCollection daemon") // RollbackToBlockID is the target block for rollback RollbackToBlockID = flag.Int64("rollbackToBlockId", 0, "Rollback to block_id") // TLS is a directory for .well-known and keys. It is required for https TLS = flag.String("tls", "", "Support https. Specify directory for .well-known") // DevTools switches on dev tools in thrust shell DevTools = flag.Int64("devtools", 0, "Devtools in thrust-shell") // BoltDir is the edir for BoltDb folder BoltDir = flag.String("boltDir", GetCurrentDir(), "Bolt directory") // BoltPsw is the password for BoltDB BoltPsw = flag.String("boltPsw", "", "Bolt password") // APIToken is an api token for exchange api APIToken = flag.String("apiToken", "", "API Token") // OneCountry is the country which is supported OneCountry int64 // PrivCountry is protect system from registering PrivCountry bool // LogoExt is the extension of the logotype LogoExt = `png` // DltWalletID is the wallet identifier DltWalletID = flag.Int64("dltWalletId", 0, "DltWalletID") // DaemonsChans is a slice of DaemonsChansType DaemonsChans []*DaemonsChansType // Thrust is true for thrust shell Thrust bool )
var ( // LangList is the list of available languages. It stores two-bytes codes LangList []string )
var Mutex = &sync.Mutex{}
Mutex for locking DB
Functions ¶
func AutoUpdate ¶
AutoUpdate reloads inner commands each pars[0] seconds
func AutoUpdateEnd ¶
AutoUpdateEnd must be used with AutoUpdate for text processing
func BinToDecBytesShift ¶
BinToDecBytesShift converts the input binary []byte to int64 and shifts the input bin
func BtnContract ¶
BtnContract returns the button for executing of the contract
func BytesShift ¶
BytesShift returns the index bytes of the input []byte and shift str pointer
func BytesShiftReverse ¶
BytesShiftReverse gets []byte from the end of the input and cut the input pointer to []byte
func BytesToFloat64 ¶
BytesToFloat64 converts []byte to float64
func CallMethod ¶
func CallMethod(i interface{}, methodName string) interface{}
CallMethod calls the function by its name
func CheckInputData ¶
CheckInputData checks the input data
func CheckSign ¶
func CheckSign(publicKeys [][]byte, forSign string, signs []byte, nodeKeyOrLogin bool) (bool, error)
CheckSign checks the signature
func CmpTime ¶
CmpTime compares two time. It returns 0 if they equal, -1 - left < right, 1 - left > right
func CreateHTMLFromTemplate ¶
func CreateHTMLFromTemplate(page string, citizenID, stateID int64, params *map[string]string) (string, error)
CreateHTMLFromTemplate gets the template of the page from the table and proceeds it
func DSha256 ¶
func DSha256(v interface{}) []byte
DSha256 returns the double calculation of SHA256 hash
func DecodeLength ¶
DecodeLength decodes length from []byte
func DecryptCFB ¶
DecryptCFB decrypts the ciphertext with AES CFB
func DownloadToFile ¶
func DownloadToFile(url, file string, timeoutSec int64, DaemonCh chan bool, AnswerDaemonCh chan string, GoroutineName string) (int64, error)
DownloadToFile downloads and saves the specified file
func EgaasUpdate ¶
EgaasUpdate decompresses and updates executable file
func EncodeLengthPlusData ¶
func EncodeLengthPlusData(idata interface{}) []byte
EncodeLengthPlusData encoding interface into []byte
func EncryptCFB ¶
EncryptCFB encrypts the text with AES CFB
func ErrInfoFmt ¶
ErrInfoFmt fomats the error message
func ForListEnd ¶
ForListEnd must be used with ForList for text processing
func FormatQueryArgs ¶
FormatQueryArgs formats the query
func FullScreen ¶
FullScreen inserts java script for switching the workarea to the full browser window
func GetBlockBody ¶
GetBlockBody gets the block data
func GetColumnType ¶
GetColumnType returns the type of the column
func GetHTTPTextAnswer ¶
GetHTTPTextAnswer returns HTTP answer as a string
func GetMrklroot ¶
GetMrklroot returns MerkleTreeRoot
func GetNetworkTime ¶
GetNetworkTime returns the network time
func GetParent ¶
func GetParent() string
GetParent returns the information where the call of function happened
func GetPrefix ¶
GetPrefix returns the prefix of the table. In this case it is checked that the prefix was global or matched with the identifier of the state
func GetRowVars ¶
GetRowVars assignes the value of row result to the variables
func GetTxTypeAndUserID ¶
GetTxTypeAndUserID returns tx type, wallet and citizen id from the block data
func GetUpdVerAndURL ¶
GetUpdVerAndURL downloads the information about the version
func HexToBin ¶
func HexToBin(ihexdata interface{}) []byte
HexToBin converts hex interface to binary []byte
func IDToAddress ¶
IDToAddress converts the number to the wallet address
func ImageInput ¶
ImageInput returns HTML tags for uploading image
func InSliceString ¶
InSliceString searches the string in the slice of strings
func InputAddress ¶
InputAddress returns input HTML tag for entering wallet address
func InputCheckbox ¶
InputCheckbox returns styled input HTML tag with checkbox type
func InputMapPoly ¶
InputMapPoly returns HTML tags for polygon map
func InputMoney ¶
InputMoney returns input HTML tag with a special money mask
func InterfaceSliceToStr ¶
func InterfaceSliceToStr(i []interface{}) []string
InterfaceSliceToStr converts the slice of interfaces to the slice of strings
func InterfaceToFloat64 ¶
func InterfaceToFloat64(i interface{}) float64
InterfaceToFloat64 converts the interfaces to the float64
func InterfaceToStr ¶
func InterfaceToStr(v interface{}) string
InterfaceToStr converts the interfaces to the string
func JSONScript ¶
JSONScript returns json object
func LangMacro ¶
LangMacro replaces all inclusions of $resname$ in the incoming text with the corresponding language resources, if they exist
func LangText ¶
LangText looks for the specified word through language sources and returns the meaning of the source if it is found. Search goes according to the languages specified in 'accept'
func LiTemplate ¶
LiTemplate returns li HTML tag with a link to the template page
func LoadContract ¶
LoadContract reads and compiles contract of new state
func LoadContracts ¶
func LoadContracts() (err error)
LoadContracts reads and compiles contracts from smart_contracts tables
func MerkleTreeRoot ¶
MerkleTreeRoot rertun Merkle value
func MessageBoard ¶
MessageBoard returns HTML source for displaying messages
func Navigation ¶
Navigation returns bread crumb navigation links
func ProceedTemplate ¶
ProceedTemplate proceeds html template
func StateParam ¶
StateParam returns the value of state parameters
func StrToUint64 ¶
StrToUint64 converts string to the unsinged int64
func TextHidden ¶
TextHidden returns hidden textarea HTML tag
func UpdateLang ¶
UpdateLang updates language sources for the specified state
func ValueByID ¶
ValueByID gets a row from table with the specified id and aasigns the values of fields to variables
func WhiteMobileBg ¶
WhiteMobileBg switches flatPageMobile class
func WriteSelectiveLog ¶
func WriteSelectiveLog(text interface{})
WriteSelectiveLog writes info into SelectiveLog.txt
Types ¶
type BlockData ¶
type BlockData struct { BlockId int64 Time int64 WalletId int64 StateID int64 Sign []byte Hash []byte }
BlockData is a structure of the block's header
func ParseBlockHeader ¶
ParseBlockHeader parses the header of the block
type CommonPage ¶
type CommonPage struct { Address string WalletId int64 CitizenId int64 StateId int64 StateName string }
CommonPage contains the common information for each template page
type DCDB ¶
DCDB is a database structure
var DB *DCDB
DB is a database variable
func NewDbConnect ¶
NewDbConnect creates a new database connection
func (*DCDB) CheckDaemonsRestart ¶
CheckDaemonsRestart is reserved
func (*DCDB) CheckDelegateCB ¶
CheckDelegateCB checks if the state is delegated
func (*DCDB) CheckInstall ¶
func (db *DCDB) CheckInstall(DaemonCh chan bool, AnswerDaemonCh chan string, GoroutineName string) bool
CheckInstall waits for the end of the installation
func (*DCDB) CheckStateName ¶
CheckStateName checks if the state id is valid
func (*DCDB) DbLock ¶
func (db *DCDB) DbLock(DaemonCh chan bool, AnswerDaemonCh chan string, goRoutineName string) (bool, error)
DbLock locks deamons
func (*DCDB) DecryptData ¶
DecryptData decrypts tx data
func (*DCDB) DeleteQueueBlock ¶
DeleteQueueBlock deletes a row from queue_blocks with the specified hash
func (*DCDB) ExecSQLGetAffect ¶
ExecSQLGetAffect executes the query and returns amount of affected rows
func (*DCDB) ExecSQLGetLastInsertID ¶
ExecSQLGetLastInsertID inserts a row and returns the last id
func (*DCDB) FindInFullNodes ¶
FindInFullNodes returns id of the node
func (*DCDB) FormatQuery ¶
FormatQuery formats the query
func (*DCDB) GetAll ¶
func (db *DCDB) GetAll(query string, countRows int, args ...interface{}) ([]map[string]string, error)
GetAll returns the result of the query as slice of map[string]string
func (*DCDB) GetAllTables ¶
GetAllTables returns the list of the tables
func (*DCDB) GetBinSign ¶
GetBinSign returns a signature made with node private key
func (*DCDB) GetBlockDataFromBlockChain ¶
GetBlockDataFromBlockChain returns the block information from the blockchain
func (*DCDB) GetBlockID ¶
GetBlockID return the latest block id from info_block
func (*DCDB) GetConfirmedBlockID ¶
GetConfirmedBlockID returns the maximal block id from confirmations
func (*DCDB) GetFirstColumnName ¶
GetFirstColumnName returns the name of the first column in the table
func (*DCDB) GetFirstColumnNamesPg ¶
GetFirstColumnNamesPg returns the first name of the column with PostgreSQL request
func (*DCDB) GetInfoBlock ¶
GetInfoBlock returns the information about the latest block
func (*DCDB) GetLastBlockData ¶
GetLastBlockData returns the data of the latest block
func (*DCDB) GetList ¶
func (db *DCDB) GetList(query string, args ...interface{}) *ListResult
GetList returns the result of the query as ListResult variable
func (*DCDB) GetMap ¶
func (db *DCDB) GetMap(query string, name, value string, args ...interface{}) (map[string]string, error)
GetMap returns the map of strings as the result of query
func (*DCDB) GetMyStateID ¶
GetMyStateID returns state id from config
func (*DCDB) GetMyStateIDAndWalletID ¶
GetMyStateIDAndWalletID returns state id and wallet id from config
func (*DCDB) GetMyWalletID ¶
GetMyWalletID returns wallet id from config
func (*DCDB) GetNodeConfig ¶
GetNodeConfig returns config parameters
func (*DCDB) GetNodePrivateKey ¶
GetNodePrivateKey returns the private key from my_nodes_key
func (*DCDB) GetNodePublicKey ¶
GetNodePublicKey returns the node public key of the wallet id
func (*DCDB) GetNodePublicKeyWalletOrCB ¶
GetNodePublicKeyWalletOrCB returns node public key of wallet id or state id
func (*DCDB) GetPublicKeyWalletOrCitizen ¶
GetPublicKeyWalletOrCitizen returns public key of the wallet id or citizen id
func (*DCDB) GetSleepTime ¶
func (db *DCDB) GetSleepTime(myWalletID, myStateID, prevBlockStateID, prevBlockWalletID int64) (int64, error)
GetSleepTime returns the waiting time for wallet id and state id
func (*DCDB) GetStateName ¶
GetStateName returns the name of the state
func (*DCDB) GetWalletIDByPublicKey ¶
GetWalletIDByPublicKey converts public key to wallet id
func (*DCDB) InsertInLogTx ¶
InsertInLogTx inserts md5 hash and time into log_transaction
func (*DCDB) InsertReplaceTxInQueue ¶
InsertReplaceTxInQueue replaces a row in queue_tx
func (*DCDB) IsCustomTable ¶
IsCustomTable checks if the table is created by the users
func (*DCDB) IsNodeState ¶
IsNodeState checks if the state is specified as node_stat_id in config file
func (*DCDB) NumIndexes ¶
NumIndexes returns the amount of the indexes in the table
func (*DCDB) PrintSleep ¶
PrintSleep writes the error to log and make a pause
func (*DCDB) Single ¶
func (db *DCDB) Single(query string, args ...interface{}) *SingleResult
Single returns the single result of the query
type DaemonsChansType ¶
DaemonsChansType is a structure for deamons
type FieldInfo ¶
type FieldInfo struct { Name string `json:"name"` HTMLType string `json:"htmlType"` TxType string `json:"txType"` Title string `json:"title"` Value interface{} `json:"value"` Param string `json:"param"` }
FieldInfo contains the information of contract data field
type FormInfo ¶
type FormInfo struct { TxName string Unique template.JS OnSuccess template.JS Fields []FieldInfo AutoClose bool Silent bool }
FormInfo contains parameters of TxForm function
type ListResult ¶
type ListResult struct {
// contains filtered or unexported fields
}
ListResult is a structure for the list result
func (*ListResult) Int64 ¶
func (r *ListResult) Int64() ([]int64, error)
Int64 converts all string values to int64
func (*ListResult) String ¶
func (r *ListResult) String() ([]string, error)
String return the slice of strings
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 TxBtnCont ¶
type TxBtnCont struct { TxName string Name string Class string ClassBtn string Unique template.JS OnSuccess template.JS Fields []TxInfo AutoClose bool Silent bool }
TxBtnCont contains parameters of TxBtnCont function