Documentation
¶
Index ¶
- func AccountGet(w http.ResponseWriter, r *http.Request)
- func AdminInfoGet(w http.ResponseWriter, r *http.Request)
- func AdminsGet(w http.ResponseWriter, r *http.Request)
- func BlockInfoGet(w http.ResponseWriter, r *http.Request)
- func BlockMinePost(w http.ResponseWriter, r *http.Request)
- func ChainNew(w http.ResponseWriter, r *http.Request)
- func ChainsGet(w http.ResponseWriter, r *http.Request)
- func CryptoCheck(w http.ResponseWriter, r *http.Request)
- func CryptoSign(w http.ResponseWriter, r *http.Request)
- func DataExist(w http.ResponseWriter, r *http.Request)
- func DataGet(w http.ResponseWriter, r *http.Request)
- func DataNextKeyGet(w http.ResponseWriter, r *http.Request)
- func DataPost(w http.ResponseWriter, r *http.Request)
- func EventPost(w http.ResponseWriter, r *http.Request)
- func HashPowerGet(w http.ResponseWriter, r *http.Request)
- func Index(w http.ResponseWriter, r *http.Request)
- func Logger(inner http.Handler, name string) http.Handler
- func MiningBlockGet(w http.ResponseWriter, r *http.Request)
- func NewRouter() *mux.Router
- func NodeAddressGet(w http.ResponseWriter, r *http.Request)
- func NodePost(w http.ResponseWriter, r *http.Request)
- func NodesGet(w http.ResponseWriter, r *http.Request)
- func TimeGet(w http.ResponseWriter, r *http.Request)
- func TransactionAdminPost(w http.ResponseWriter, r *http.Request)
- func TransactionAppInfoGet(w http.ResponseWriter, r *http.Request)
- func TransactionAppLifePost(w http.ResponseWriter, r *http.Request)
- func TransactionInfoGet(w http.ResponseWriter, r *http.Request)
- func TransactionMinerPost(w http.ResponseWriter, r *http.Request)
- func TransactionMovePost(w http.ResponseWriter, r *http.Request)
- func TransactionNew(w http.ResponseWriter, r *http.Request)
- func TransactionNewAppPost(w http.ResponseWriter, r *http.Request)
- func TransactionRunAppPost(w http.ResponseWriter, r *http.Request)
- func TransactionTransferPost(w http.ResponseWriter, r *http.Request)
- func TrustedBlockGet(w http.ResponseWriter, r *http.Request)
- func VersionGet(w http.ResponseWriter, r *http.Request)
- func VoteInfoGet(w http.ResponseWriter, r *http.Request)
- func VoteRewardGet(w http.ResponseWriter, r *http.Request)
- func WSBlockForMining(ws *websocket.Conn)
- type Account
- type Admin
- type AdminInfo
- type AppLife
- type ChainNewInfo
- type CryptoInfo
- type DataInfo
- type DataNextKey
- type EventInfo
- type Miner
- type NewApp
- type NodeInfo
- type RespOfNewTrans
- type Route
- type Routes
- type RunApp
- type TransInfo
- type TransMoveInfo
- type TransferInfo
- type VersionInfo
- type VoteInfo
- type VoteReward
- type WSRoute
- type WSRoutes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountGet ¶
func AccountGet(w http.ResponseWriter, r *http.Request)
AccountGet get account of the address on the chain
func AdminInfoGet ¶
func AdminInfoGet(w http.ResponseWriter, r *http.Request)
AdminInfoGet get admin info
func BlockInfoGet ¶
func BlockInfoGet(w http.ResponseWriter, r *http.Request)
BlockInfoGet get block info
func ChainsGet ¶ added in v0.5.11
func ChainsGet(w http.ResponseWriter, r *http.Request)
ChainsGet get chains list
func CryptoCheck ¶
func CryptoCheck(w http.ResponseWriter, r *http.Request)
CryptoCheck Crypto:check the sign
func CryptoSign ¶
func CryptoSign(w http.ResponseWriter, r *http.Request)
CryptoSign crypto:sign message
func DataExist ¶ added in v0.5.11
func DataExist(w http.ResponseWriter, r *http.Request)
DataExist return 200OK when exist the key
func DataNextKeyGet ¶
func DataNextKeyGet(w http.ResponseWriter, r *http.Request)
DataNextKeyGet get next key
func HashPowerGet ¶
func HashPowerGet(w http.ResponseWriter, r *http.Request)
HashPowerGet get hashpower info
func MiningBlockGet ¶
func MiningBlockGet(w http.ResponseWriter, r *http.Request)
MiningBlockGet get block for mining
func NodeAddressGet ¶
func NodeAddressGet(w http.ResponseWriter, r *http.Request)
NodeAddressGet get self node address
func TransactionAdminPost ¶
func TransactionAdminPost(w http.ResponseWriter, r *http.Request)
TransactionAdminPost register admin candidate
func TransactionAppInfoGet ¶
func TransactionAppInfoGet(w http.ResponseWriter, r *http.Request)
TransactionAppInfoGet get app info
func TransactionAppLifePost ¶
func TransactionAppLifePost(w http.ResponseWriter, r *http.Request)
TransactionAppLifePost update app life
func TransactionInfoGet ¶
func TransactionInfoGet(w http.ResponseWriter, r *http.Request)
TransactionInfoGet get transaction info
func TransactionMinerPost ¶
func TransactionMinerPost(w http.ResponseWriter, r *http.Request)
TransactionMinerPost register miner
func TransactionMovePost ¶
func TransactionMovePost(w http.ResponseWriter, r *http.Request)
TransactionMovePost move cost to other chain
func TransactionNew ¶
func TransactionNew(w http.ResponseWriter, r *http.Request)
TransactionNew new transaction
func TransactionNewAppPost ¶
func TransactionNewAppPost(w http.ResponseWriter, r *http.Request)
TransactionNewAppPost new app
func TransactionRunAppPost ¶
func TransactionRunAppPost(w http.ResponseWriter, r *http.Request)
TransactionRunAppPost run app
func TransactionTransferPost ¶
func TransactionTransferPost(w http.ResponseWriter, r *http.Request)
TransactionTransferPost transfer
func TrustedBlockGet ¶
func TrustedBlockGet(w http.ResponseWriter, r *http.Request)
TrustedBlockGet get the trusted blocks
func VersionGet ¶
func VersionGet(w http.ResponseWriter, r *http.Request)
VersionGet get software version
func VoteInfoGet ¶
func VoteInfoGet(w http.ResponseWriter, r *http.Request)
VoteInfoGet get vote info
func VoteRewardGet ¶
func VoteRewardGet(w http.ResponseWriter, r *http.Request)
VoteRewardGet get vote info
Types ¶
type Account ¶
type Account struct { Chain uint64 `json:"chain,omitempty"` Address string `json:"address,omitempty"` Cost uint64 `json:"cost,omitempty"` }
Account account
type Admin ¶
type Admin struct { Cost uint64 `json:"cost,omitempty"` TransKey string `json:"trans_key,omitempty"` }
Admin admin
type AdminInfo ¶
type AdminInfo struct { Address string `json:"address"` Deposit uint64 `json:"deposit"` Votes uint64 `json:"votes"` }
AdminInfo admin info
type AppLife ¶
type AppLife struct { Energy uint64 `json:"energy,omitempty"` AppName string `json:"app_name,omitempty"` Life uint64 `json:"life,omitempty"` TransKey string `json:"trans_key,omitempty"` }
AppLife app life
type ChainNewInfo ¶
type ChainNewInfo struct { DstChain uint64 `json:"dst_chain,omitempty"` Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` TransKey string `json:"trans_key,omitempty"` }
ChainNewInfo info of new chain
type CryptoInfo ¶
CryptoInfo crypto info
type DataInfo ¶
type DataInfo struct { AppName string `json:"app_name,omitempty"` StructName string `json:"struct_name,omitempty"` IsDBData bool `json:"is_db_data,omitempty"` Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` Life uint64 `json:"life,omitempty"` }
DataInfo data info
type DataNextKey ¶
type DataNextKey struct { AppName string `json:"app_name,omitempty"` StructName string `json:"struct_name,omitempty"` PreKey string `json:"pre_key,omitempty"` IsDBData bool `json:"is_db_data,omitempty"` Key string `json:"key,omitempty"` }
DataNextKey the next key of data
type Miner ¶
type Miner struct { TargetChain uint64 `json:"target_chain,omitempty"` Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` Miner string `json:"miner,omitempty"` TransKey string `json:"trans_key,omitempty"` }
Miner miner info
type NewApp ¶
type NewApp struct { Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` CodePath string `json:"code_path,omitempty"` IsPrivate bool `json:"is_private,omitempty"` EnableRun bool `json:"enable_run,omitempty"` EnableImport bool `json:"enable_import,omitempty"` AppName string `json:"app_name,omitempty"` TransKey string `json:"trans_key,omitempty"` }
NewApp new app
type NodeInfo ¶
type NodeInfo struct { Address string `json:"address,omitempty"` Miners int `json:"miners,omitempty"` NodeNumber int `json:"node_number,omitempty"` }
NodeInfo node info
type RespOfNewTrans ¶
type RespOfNewTrans struct { Chain uint64 `json:"chain,omitempty"` TransKey string `json:"trans_key,omitempty"` }
RespOfNewTrans the response of New Transaction
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
Route route item
type RunApp ¶
type RunApp struct { Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` AppName string `json:"app_name,omitempty"` Param string `json:"param,omitempty"` ParamType string `json:"param_type,omitempty"` JSONParam interface{} `json:"json_param,omitempty"` }
RunApp run app
type TransInfo ¶
type TransInfo struct { core.TransactionHead Key []byte Size int Others interface{} }
TransInfo transaction info
type TransMoveInfo ¶
type TransMoveInfo struct { DstChain uint64 `json:"dst_chain,omitempty"` Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` TransKey string `json:"trans_key,omitempty"` }
TransMoveInfo move info
type TransferInfo ¶
type TransferInfo struct { Peer string `json:"peer,omitempty"` Cost uint64 `json:"cost,omitempty"` Energy uint64 `json:"energy,omitempty"` TransKey string `json:"trans_key,omitempty"` }
TransferInfo transfer info
type VersionInfo ¶
VersionInfo version info
type VoteInfo ¶
type VoteInfo struct { Address string `json:"address,omitempty"` Admin string `json:"admin,omitempty"` Votes uint64 `json:"votes,omitempty"` StartDay uint64 `json:"start_day,omitempty"` }
VoteInfo vote info
type VoteReward ¶
type VoteReward struct { Reward uint64 `json:"reward,omitempty"` Day uint64 `json:"day,omitempty"` }
VoteReward vote reward