Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderBlockchainID = "Blockchain-ID" HeaderCoreID = "Bytom-Core-ID" HeaderTimeout = "RPC-Timeout" )
Bytom-specific header fields
Variables ¶
View Source
var ErrWrongNetwork = errors.New("connected to a peer on a different network")
ErrWrongNetwork is returned when a peer's blockchain ID differs from the RPC client's blockchain ID.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string AccessToken string Username string BuildTag string BlockchainID string CoreID string // If set, Client is used for outgoing requests. // TODO(kr): make this required (crash on nil) Client *http.Client }
A Client is a Bytom RPC client. It performs RPCs over HTTP using JSON request and responses. A Client must be configured with a secret token to authenticate with other Cores on the network.
type ErrStatusCode ¶
ErrStatusCode is an error returned when an rpc fails with a non-200 response code.
func (ErrStatusCode) Error ¶
func (e ErrStatusCode) Error() string
Click to show internal directories.
Click to hide internal directories.