Documentation ¶
Index ¶
- func StartHTTP(node *node.BraftNode, user, pwd, endpoint string, allowedOrigins []string)
- type BlockInfo
- type HTTPHandler
- func (hd *HTTPHandler) GetBlockByHeight(w http.ResponseWriter, req *http.Request, params httprouter.Params)
- func (hd *HTTPHandler) GetBlockByID(w http.ResponseWriter, req *http.Request, params httprouter.Params)
- func (hd *HTTPHandler) GetBlockHeight(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (hd *HTTPHandler) GetBlocksByHeightSec(w http.ResponseWriter, req *http.Request, _ httprouter.Params)
- func (hd *HTTPHandler) GetCurrentBlock(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (hd *HTTPHandler) GetNodes(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (hd *HTTPHandler) GetTransActionByID(w http.ResponseWriter, req *http.Request, params httprouter.Params)
- func (hd *HTTPHandler) GetTxBySidechainTxId(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- type TestInput
- type TxInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockInfo ¶
type BlockInfo struct { Height int64 PackTime string `json:"pack_time"` Type string Term int64 Id string PrevId string `json:"prev_id"` }
BlockInfo 转json的结构体
type HTTPHandler ¶
type HTTPHandler struct {
// contains filtered or unexported fields
}
HTTPHandler 提供了HTTP请求的处理函数
func NewHTTPHandler ¶
func NewHTTPHandler(node *node.BraftNode) *HTTPHandler
NewHTTPHandler 新建一个HTTPHandler对象并返回
func (*HTTPHandler) GetBlockByHeight ¶
func (hd *HTTPHandler) GetBlockByHeight(w http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*HTTPHandler) GetBlockByID ¶
func (hd *HTTPHandler) GetBlockByID(w http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*HTTPHandler) GetBlockHeight ¶
func (hd *HTTPHandler) GetBlockHeight(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
GetBlockHeight 获取当前区块链的高度
func (*HTTPHandler) GetBlocksByHeightSec ¶
func (hd *HTTPHandler) GetBlocksByHeightSec(w http.ResponseWriter, req *http.Request, _ httprouter.Params)
func (*HTTPHandler) GetCurrentBlock ¶
func (hd *HTTPHandler) GetCurrentBlock(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
获取当前区块
func (*HTTPHandler) GetNodes ¶
func (hd *HTTPHandler) GetNodes(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
获取各个节点
func (*HTTPHandler) GetTransActionByID ¶
func (hd *HTTPHandler) GetTransActionByID(w http.ResponseWriter, req *http.Request, params httprouter.Params)
func (*HTTPHandler) GetTxBySidechainTxId ¶
func (hd *HTTPHandler) GetTxBySidechainTxId(w http.ResponseWriter, r *http.Request, params httprouter.Params)
GetTxBySidechainTxId 根据公链的交易ID来查询网关对应的交易状态
Click to show internal directories.
Click to hide internal directories.