Documentation ¶
Index ¶
- Variables
- type InternalServer
- type PublicServer
- func (s *PublicServer) Close() error
- func (s *PublicServer) ConnectFullPublicInterface()
- func (s *PublicServer) OnNewBlock(hash string, height uint32)
- func (s *PublicServer) OnNewFiatRatesTicker(ticker *db.CurrencyRatesTicker)
- func (s *PublicServer) OnNewTxAddr(tx *bchain.Tx, desc bchain.AddressDescriptor)
- func (s *PublicServer) Run() error
- func (s *PublicServer) Shutdown(ctx context.Context) error
- type SocketIoServer
- type TemplateData
- type WebsocketServer
- func (s *WebsocketServer) GetHandler() http.Handler
- func (s *WebsocketServer) OnNewBlock(hash string, height uint32)
- func (s *WebsocketServer) OnNewFiatRatesTicker(ticker *db.CurrencyRatesTicker)
- func (s *WebsocketServer) OnNewTxAddr(tx *bchain.Tx, addrDesc bchain.AddressDescriptor)
- func (s *WebsocketServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorMethodNotAllowed is returned when client tries to upgrade method other than GET ErrorMethodNotAllowed = errors.New("Method not allowed") )
Functions ¶
This section is empty.
Types ¶
type InternalServer ¶
type InternalServer struct {
// contains filtered or unexported fields
}
InternalServer is handle to internal http server
func NewInternalServer ¶
func NewInternalServer(binding, certFiles string, db *db.RocksDB, chain bchain.BlockChain, mempool bchain.Mempool, txCache *db.TxCache, is *common.InternalState) (*InternalServer, error)
NewInternalServer creates new internal http interface to blockbook and returns its handle
type PublicServer ¶
type PublicServer struct {
// contains filtered or unexported fields
}
PublicServer is a handle to public http server
func NewPublicServer ¶
func NewPublicServer(binding string, certFiles string, db *db.RocksDB, chain bchain.BlockChain, mempool bchain.Mempool, txCache *db.TxCache, explorerURL string, metrics *common.Metrics, is *common.InternalState, debugMode bool) (*PublicServer, error)
NewPublicServer creates new public server http interface to blockbook and returns its handle only basic functionality is mapped, to map all functions, call
func (*PublicServer) ConnectFullPublicInterface ¶
func (s *PublicServer) ConnectFullPublicInterface()
ConnectFullPublicInterface enables complete public functionality
func (*PublicServer) OnNewBlock ¶
func (s *PublicServer) OnNewBlock(hash string, height uint32)
OnNewBlock notifies users subscribed to bitcoind/hashblock about new block
func (*PublicServer) OnNewFiatRatesTicker ¶
func (s *PublicServer) OnNewFiatRatesTicker(ticker *db.CurrencyRatesTicker)
OnNewFiatRatesTicker notifies users subscribed to bitcoind/fiatrates about new ticker
func (*PublicServer) OnNewTxAddr ¶
func (s *PublicServer) OnNewTxAddr(tx *bchain.Tx, desc bchain.AddressDescriptor)
OnNewTxAddr notifies users subscribed to bitcoind/addresstxid about new block
type SocketIoServer ¶
type SocketIoServer struct {
// contains filtered or unexported fields
}
SocketIoServer is handle to SocketIoServer
func NewSocketIoServer ¶
func NewSocketIoServer(db *db.RocksDB, chain bchain.BlockChain, mempool bchain.Mempool, txCache *db.TxCache, metrics *common.Metrics, is *common.InternalState) (*SocketIoServer, error)
NewSocketIoServer creates new SocketIo interface to blockbook and returns its handle
func (*SocketIoServer) GetHandler ¶
func (s *SocketIoServer) GetHandler() http.Handler
GetHandler returns socket.io http handler
func (*SocketIoServer) OnNewBlockHash ¶
func (s *SocketIoServer) OnNewBlockHash(hash string)
OnNewBlockHash notifies users subscribed to bitcoind/hashblock about new block
func (*SocketIoServer) OnNewTxAddr ¶
func (s *SocketIoServer) OnNewTxAddr(txid string, desc bchain.AddressDescriptor)
OnNewTxAddr notifies users subscribed to bitcoind/addresstxid about new block
type TemplateData ¶
type TemplateData struct { CoinName string CoinShortcut string CoinLabel string InternalExplorer bool ChainType bchain.ChainType Address *api.Address AddrStr string Tx *api.Tx Error *api.APIError Blocks *api.Blocks Block *api.Block Info *api.SystemInfo MempoolTxids *api.MempoolTxids Page int PrevPage int NextPage int PagingRange []int PageParams template.URL TOSLink string SendTxHex string Status string NonZeroBalanceTokens bool }
TemplateData is used to transfer data to the templates
type WebsocketServer ¶
type WebsocketServer struct {
// contains filtered or unexported fields
}
WebsocketServer is a handle to websocket server
func NewWebsocketServer ¶
func NewWebsocketServer(db *db.RocksDB, chain bchain.BlockChain, mempool bchain.Mempool, txCache *db.TxCache, metrics *common.Metrics, is *common.InternalState) (*WebsocketServer, error)
NewWebsocketServer creates new websocket interface to blockbook and returns its handle
func (*WebsocketServer) GetHandler ¶
func (s *WebsocketServer) GetHandler() http.Handler
GetHandler returns http handler
func (*WebsocketServer) OnNewBlock ¶
func (s *WebsocketServer) OnNewBlock(hash string, height uint32)
OnNewBlock is a callback that broadcasts info about new block to subscribed clients
func (*WebsocketServer) OnNewFiatRatesTicker ¶
func (s *WebsocketServer) OnNewFiatRatesTicker(ticker *db.CurrencyRatesTicker)
OnNewFiatRatesTicker is a callback that broadcasts info about fiat rates affecting subscribed currency
func (*WebsocketServer) OnNewTxAddr ¶
func (s *WebsocketServer) OnNewTxAddr(tx *bchain.Tx, addrDesc bchain.AddressDescriptor)
OnNewTxAddr is a callback that broadcasts info about a tx affecting subscribed address
func (*WebsocketServer) ServeHTTP ¶
func (s *WebsocketServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP sets up handler of websocket channel