Documentation ¶
Index ¶
- Constants
- func AddCTK(stub shim.ChaincodeStubInterface, fee string)
- func AddMortUSDT(stub shim.ChaincodeStubInterface, fee string)
- func AddNodesFee(stub shim.ChaincodeStubInterface, fee string)
- func AddPoolFee(stub shim.ChaincodeStubInterface, fee string)
- func AddSuperFee(stub shim.ChaincodeStubInterface, fee string)
- func AddWithdrawCTK(stub shim.ChaincodeStubInterface, fee string)
- func GetAllCTK(stub shim.ChaincodeStubInterface) string
- func GetAllNodesFee(stub shim.ChaincodeStubInterface) string
- func GetAllPoolFee(stub shim.ChaincodeStubInterface) string
- func GetAllSuperFee(stub shim.ChaincodeStubInterface) string
- func GetAllUSDT(stub shim.ChaincodeStubInterface) string
- func GetAllWithdrawCTK(stub shim.ChaincodeStubInterface) string
- func GetTokenAccountKey(token, address string) string
- func ReduceCTK(stub shim.ChaincodeStubInterface, fee string)
- func ReduceMortUSDT(stub shim.ChaincodeStubInterface, fee string)
- type Account
- type AccountInfo
- type AppendSuperParam
- type BindPoolParam
- type BlockAwardLog
- type BlockAwardParam
- type ExchangeParam
- type MortageToken
- type NodeAccounts
- type QuitSuperParam
- type RegisterParam
- type Super17Param
- type TokenConfig
- type TokenInfo
- type Transaction
- type TransactionsParam
- type TransferParam
Constants ¶
View Source
const DB_ALL_CTK = "all_ctk"
View Source
const DB_ALL_MORT_USDT = "all_mrot_usdt"
View Source
const DB_ALL_NODES_FEE = "all_nodes_fee"
View Source
const DB_ALL_POOL_FEE = "all_pool_fee"
View Source
const DB_ALL_SUPER_FEE = "all_super_fee"
View Source
const DB_ALL_WITHDRAW_CTK = "all_withdraw_ctk"
View Source
const DB_TRANSACTIONS = "transactions"
View Source
const DB_TRANS_FROM = "from"
View Source
const DB_TRANS_TO = "to"
Variables ¶
This section is empty.
Functions ¶
func AddWithdrawCTK ¶
func AddWithdrawCTK(stub shim.ChaincodeStubInterface, fee string)
add withdraw ctk fee
func GetAllNodesFee ¶
func GetAllNodesFee(stub shim.ChaincodeStubInterface) string
get all nodes fee
func GetAllWithdrawCTK ¶
func GetAllWithdrawCTK(stub shim.ChaincodeStubInterface) string
get all usdt fee
func GetTokenAccountKey ¶
func ReduceMortUSDT ¶
func ReduceMortUSDT(stub shim.ChaincodeStubInterface, fee string)
reduce usdt fee
Types ¶
type Account ¶
type Account struct { Address string `json:"address"` Balance string `json:"balance"` Role int `json:"role"` PoolAddr string `json:"pool_addr"` Withdraw string `json:"withdraw"` Recharge string `json:"recharge"` }
func GetTokenAccountInfo ¶
func GetTokenAccountInfo(stub shim.ChaincodeStubInterface, token, address string) *Account
type AccountInfo ¶
type AppendSuperParam ¶
type BindPoolParam ¶
type BlockAwardLog ¶
type BlockAwardLog struct { StartHeight int `json:"start_height"` EndHeight int `json:"end_height"` Transactions []Transaction `json:"transactions"` CreateTime int64 `json:"create_time"` }
block award
func (*BlockAwardLog) Bytes ¶
func (this *BlockAwardLog) Bytes() []byte
func (*BlockAwardLog) Save ¶
func (this *BlockAwardLog) Save(stub shim.ChaincodeStubInterface, token string)
type BlockAwardParam ¶
type ExchangeParam ¶
type MortageToken ¶
func (*MortageToken) Bytes ¶
func (this *MortageToken) Bytes() []byte
type NodeAccounts ¶
type NodeAccounts []string
func GetNormalNodeAccounts ¶
func GetNormalNodeAccounts(stub shim.ChaincodeStubInterface) NodeAccounts
func GetSuperNodeAccounts ¶
func GetSuperNodeAccounts(stub shim.ChaincodeStubInterface) NodeAccounts
func (*NodeAccounts) Add ¶
func (this *NodeAccounts) Add(addr string)
func (*NodeAccounts) Bytes ¶
func (this *NodeAccounts) Bytes() []byte
func (*NodeAccounts) Has ¶
func (this *NodeAccounts) Has(addr string) bool
func (*NodeAccounts) Remove ¶
func (this *NodeAccounts) Remove(addr string)
type QuitSuperParam ¶
type RegisterParam ¶
type Super17Param ¶
type Super17Param struct { Accounts NodeAccounts `json:"accounts"` Sign string `json:"sign"` }
type TokenConfig ¶
type TokenConfig struct { OriginatorAccount string `json:"originator_account"` Name string `json:"name"` Title string `json:"title"` Logo string `json:"logo"` Precision int64 `json:"precision"` Site string `json:"site"` Email string `json:"email"` CreateTime string `json:"create_time"` TokenCharge int `json:"token_charge"` //publish token need the ctk count NormalNodeFreezeCTK int `json:"normal_node_freeze_ctk"` SuperNodeFreezeCTK int `json:"super_node_freeze_ctk"` PoolNodeFreezeCTK int `json:"pool_node_freeze_ctk"` AllCostFee string `json:"all_cost_fee"` AllCount string `json:"all_count"` }
func GetTokenInfo ¶
func GetTokenInfo(stub shim.ChaincodeStubInterface, token string) *TokenConfig
func (*TokenConfig) Byte ¶
func (this *TokenConfig) Byte() []byte
func (*TokenConfig) Save ¶
func (this *TokenConfig) Save(stub shim.ChaincodeStubInterface)
type TokenInfo ¶
type TokenInfo struct { Creator string `json:"creator"` CC string `json:"cc"` Name string `json:"name"` Desc string `json:"desc"` Logo string `json:"logo"` Total string `json:"total"` Award string `json:"award"` Balance string `json:"balance"` Decimal string `json:"decimal"` Mineral string `json:"mineral"` Url string `json:"url"` Email string `json:"email"` PublishTime string `json:"publish_time"` }
type Transaction ¶
type Transaction struct { Type int `json:"type"` From string `json:"from"` To string `json:"to"` Fee string `json:"fee"` Amount string `json:"amount"` CreateTime int64 `json:"create_time"` Memo string `json:"memo"` Token string `json:"token"` TxID string `json:"tx_id"` }
transaction
func NodeBonus ¶
func NodeBonus(stub shim.ChaincodeStubInterface, freezeMoney decimal.Decimal, token string, from string, isRegister bool) (txs []Transaction)
node bonus when normal node register or pool node register
func (*Transaction) Bytes ¶
func (this *Transaction) Bytes() []byte
func (*Transaction) Save ¶
func (this *Transaction) Save(stub shim.ChaincodeStubInterface, token string)
type TransactionsParam ¶
Click to show internal directories.
Click to hide internal directories.