# Packages
No description provided by the author
# Functions
AddLocalAddress adds an address that this node is listening on to the address manager so that it may be relayed to peers.
AddrStringToNetAddr takes an address in the form of 'host:port' and returns a net.Addr which maps to the original address with any host names resolved to IP addresses.
BigToLEUint256 returns the passed big integer as an unsigned 256-bit integer encoded as little-endian bytes.
BlockDetails creates a BlockDetails struct to include in btcws notifications from a block and a transaction's block index.
BuilderScript is a convenience function which is used for hard-coded scripts built with the script builder.
ChainErrToGBTErrString converts an error returned from btcchain to a string which matches the reasons and format described in BIP0022 for rejection reasons.
CheckAddressValidity checks the validity of each address in the passed string slice.
CreateMarshalledReply returns a new marshalled JSON-RPC response given the passed parameters.
CreateTxRawResult converts the passed transaction and associated parameters to a raw transaction JSON object.
CreateVinList returns a slice of JSON objects for the inputs of the passed transaction.
CreateVinListPrevOut returns a slice of JSON objects for the inputs of the passed transaction.
CreateVoutList returns a slice of JSON objects for the outputs of the passed transaction.
DecodeHexError is a convenience function for returning a nicely formatted RPC error which indicates the provided hex string failed to decode.
DecodeTemplateID decodes an ID that is used to uniquely identify a block template.
DescendantBlock returns the appropriate JSON-RPC error if a current block fetched during a reorganize is not a direct child of the parent block hash.
DeserializeOutpoints deserializes each serialized outpoint.
DisconnectPeer attempts to drop the connection of a targeted peer in the passed peer list.
DynamicTickDuration is a convenience function used to dynamically choose a tick duration based on remaining time.
EncodeTemplateID encodes the passed details into an ID that can be used to uniquely identify a block template.
FetchInputTxos fetches the outpoints from all transactions referenced by the inputs to the passed transaction by checking the transaction mempool first then the transaction index for those already mined into blocks.
FetchMempoolTxnsForAddress queries the address index for all unconfirmed transactions that involve the provided address.
FileExists reports whether the named file or directory exists.
GenCertPair generates a key/cert pair to the paths provided.
No description provided by the author
GetDifficultyRatio returns the proof-of-work difficulty as a multiple of the minimum difficulty using the passed bits field from the header of a block.
GetHasServices returns whether or not the provided advertised service flags have all of the provided desired service flags set.
GetIsWhitelisted returns whether the IP address is included in the whitelisted networks and IPs.
HandleAddNode handles addnode commands.
HandleAskWallet is the handler for commands that are recognized as valid, but are unable to answer correctly since it involves wallet state.
HandleCreateRawTransaction handles createrawtransaction commands.
HandleDecodeRawTransaction handles decoderawtransaction commands.
HandleDecodeScript handles decodescript commands.
HandleEstimateFee handles estimatefee commands.
HandleGenerate handles generate commands.
HandleGetAddedNodeInfo handles getaddednodeinfo commands.
HandleGetBestBlock implements the getbestblock command.
HandleGetBestBlockHash implements the getbestblockhash command.
HandleGetBlock implements the getblock command.
HandleGetBlockChainInfo implements the getblockchaininfo command.
HandleGetBlockCount implements the getblockcount command.
HandleGetBlockHash implements the getblockhash command.
HandleGetBlockHeader implements the getblockheader command.
HandleGetBlockTemplate implements the getblocktemplate command.
HandleGetBlockTemplateLongPoll is a helper for handleGetBlockTemplateRequest which deals with handling long polling for block templates.
HandleGetBlockTemplateProposal is a helper for handleGetBlockTemplate which deals with block proposals.
HandleGetBlockTemplateRequest is a helper for handleGetBlockTemplate which deals with generating and returning block templates to the caller.
HandleGetCFilter implements the getcfilter command.
HandleGetCFilterHeader implements the getcfilterheader command.
HandleGetConnectionCount implements the getconnectioncount command.
HandleGetCurrentNet implements the getcurrentnet command.
HandleGetDifficulty implements the getdifficulty command.
HandleGetGenerate implements the getgenerate command.
HandleGetHashesPerSec implements the gethashespersec command.
HandleGetHeaders implements the getheaders command.
HandleGetInfo implements the getinfo command.
HandleGetMempoolInfo implements the getmempoolinfo command.
HandleGetMiningInfo implements the getmininginfo command.
HandleGetNetTotals implements the getnettotals command.
HandleGetNetworkHashPS implements the getnetworkhashps command.
HandleGetPeerInfo implements the getpeerinfo command.
HandleGetRawMempool implements the getrawmempool command.
HandleGetRawTransaction implements the getrawtransaction command.
HandleGetTxOut handles gettxout commands.
HandleGetWork handles the getwork call.
HandleGetWorkSubmission is a helper for handleGetWork which deals with the calling submitting work to be verified and processed.
HandleHelp implements the help command.
HandleLoadTxFilter implements the loadtxfilter command extension for websocket connections.
HandleNode handles node commands.
HandleNotifyBlocks implements the notifyblocks command extension for websocket connections.
HandleNotifyNewTransactions implements the notifynewtransactions command extension for websocket connections.
HandleNotifyReceived implements the notifyreceived command extension for websocket connections.
HandleNotifySpent implements the notifyspent command extension for websocket connections.
HandlePing implements the ping command.
HandleRescan implements the rescan command extension for websocket connections.
HandleRescanBlocks implements the rescanblocks command extension for websocket connections.
HandleResetChain deletes the existing chain database and restarts.
HandleRestart implements the restart command.
HandleSearchRawTransactions implements the searchrawtransactions command.
HandleSendRawTransaction implements the sendrawtransaction command.
HandleSession implements the session command extension for websocket connections.
HandleSetGenerate implements the setgenerate command.
HandleStop implements the stop command.
HandleStopNotifyBlocks implements the stopnotifyblocks command extension for websocket connections.
HandleStopNotifyNewTransactions implements the stopnotifynewtransactions command extension for websocket connections.
HandleStopNotifyReceived implements the stopnotifyreceived command extension for websocket connections.
HandleStopNotifySpent implements the stopnotifyspent command extension for websocket connections.
HandleSubmitBlock implements the submitblock command.
HandleUnimplemented is the handler for commands that should ultimately be supported but are not yet implemented.
HandleUptime implements the uptime command.
HandleValidateAddress implements the validateaddress command.
HandleVerifyChain implements the verifychain command.
HandleVerifyMessage implements the verifymessage command.
HandleVersion implements the version command.
HandleWebsocketHelp implements the help command for websocket connections.
InitListeners initializes the configured net listeners and adds any bound addresses to the address manager.
InternalRPCError is a convenience function to convert an internal error to an RPC error with the appropriate code set.
JSONAuthFail sends a message back to the client if the http auth is rejected.
No description provided by the author
MergeCheckpoints returns two slices of checkpoints merged into one slice such that the checkpoints are sorted by height.
MessageToHex serializes a message to the wire protocol encoding using the latest protocol version and returns a hex-encoded string of the result.
NewCAPI returns a new CAPI .
New creates a new client for a kopach_worker.
NewGbtWorkState returns a new instance of a GBTWorkState with all internal fields initialized and ready to use.
NewHelpCacher returns a new instance of a help cacher which provides help and usage for the RPC server commands and caches the results for future calls.
NewNode returns a new pod server configured to listen on addr for the bitcoin network type specified by chainParams.
NewPeerConfig returns the configuration for the given ServerPeer.
NewRedeemingTxNotification returns a new marshalled redeemingtx notification with the passed parameters.
NewRPCServer returns a new instance of the RPCServer struct.
NewServerPeer returns a new ServerPeer instance.
NewWebsocketClient returns a new websocket client given the notification manager, websocket connection, remote address, and whether or not the client has already been authenticated (via HTTP Basic access authentication).
NewWSClientFilter creates a new, empty wsClientFilter struct to be used for a websocket client.
NewWSNotificationManager returns a new notification manager ready for use.
NormalizeAddress returns addr with the passed default port appended if there is not already a port specified.
NoTxInfoError is a convenience function for returning a nicely formatted RPC error which indicates there is no information available for the provided transaction hash.
ParseCmd parses a JSON-RPC request object into known concrete command.
ParseListeners determines whether each listen address is IPv4 and IPv6 and returns a slice of appropriate net.Addrs to listen on with TCP.
PeerExists determines if a certain peer is currently connected given information about all currently connected peers.
QueueHandler manages a queue of empty interfaces, reading from in and sending the oldest unsent to out.
RandomUint16Number returns a random uint16 in a specified input range.
RecoverFromReorg attempts to recover from a detected reorganize during a rescan.
RescanBlock rescans all transactions in a single block.
RescanBlockFilter rescans a block for any relevant transactions for the passed lookup keys.
ReverseUint32Array treats the passed bytes as a series of uint32s and reverses the byte order of each uint32.
RunAPI starts up the api handler server that receives rpc.API messages and runs the handler and returns the result Note that the parameters are type asserted to prevent the consumer of the API from sending wrong message types not because it's necessary since they are interfaces end to end.
SetupRPCListeners returns a slice of listeners that are configured for use with the RPC server depending on the configuration settings for listen addresses and TLS.
SoftForkStatus converts a ThresholdState state into a human readable string corresponding to the particular state.
TxHexString returns the serialized transaction encoded in hexadecimal.
VerifyChain does?.
# Constants
ConnectionRetryInterval is the base amount of time to wait in between retries when connecting to persistent peers.
No description provided by the author
DefaultRequiredServices describes the default services that are required to be supported by outbound peers.
DefaultServices describes the default services that are supported by the server.
DefaultTargetOutbound is the default number of outbound peers to target.
GBTNonceRange is two 32-bit big-endian hexadecimal integers which represent the valid ranges of nonces returned by the getblocktemplate RPC.
GBTRegenerateSeconds is the number of seconds that must pass before a new template is generated when the previous block hash has not changed and there have been changes to the available transactions in the memory pool.
API version constants.
API version constants.
API version constants.
API version constants.
MaxProtocolVersion is the max protocol version the server supports.
RPCAuthTimeoutSeconds is the number of seconds a connection to the RPC server is allowed to stay open without authenticating before it is closed.
Uint256Size is the number of bytes needed to represent an unsigned 256-bit integer.
WebsocketSendBufferSize is the number of elements the send channel can queue before blocking.
# Variables
No description provided by the author
DefaultConnectTimeout is a reasonable 30 seconds.
Dial connects to the address on the named network using the appropriate dial function depending on the address and configuration options.
No description provided by the author
ErrClientQuit describes the error where a client send is not processed due to the client having already been disconnected or dropped.
ErrRescanReorg defines the error that is returned when an unrecoverable reorganize is detected during a rescan.
ErrRPCNoWallet is an error returned to RPC clients when the provided command is recognized as a wallet command.
ErrRPCUnimplemented is an error returned to RPC clients when the provided command is recognized, but not implemented.
No description provided by the author
GBTCapabilities describes additional capabilities returned with a block template generated by the getblocktemplate RPC.
GBTCoinbaseAux describes additional data that miners should include in the coinbase signature script.
GBTMutableFields are the manipulations the server allows to be made to block templates generated by the getblocktemplate RPC.
GetworkDataLen is the length of the data field of the getwork RPC.
Hash1Len is the length of the hash1 field of the getwork RPC.
HelpDescsEnUS defines the English descriptions used for the help strings.
No description provided by the author
Lookup resolves the IP of the given host using the correct DNS lookup function depending on the configuration options.
ResultTypes specifies the result types that each RPC command can return.
RPCAskWallet is list of commands that we recognize, but for which pod has no support because it lacks support for wallet functionality.
RPCHandlers maps RPC command strings to appropriate handler functions.
RPCHandlersBeforeInit are created first and are added to the main list when the init runs.
RPCLimited isCommands that are available to a limited user.
RPCUnimplemented is commands that are currently unimplemented, but should ultimately be.
No description provided by the author
TimeZeroVal is simply the zero value for a time.Time and is used to avoid creating multiple instances.
UserAgentName is the user agent name and is used to help identify ourselves to peers.
UserAgentVersion is the user agent version and is used to help identify ourselves to peers.
No description provided by the author
WSHandlers maps RPC command strings to appropriate websocket handler functions.
No description provided by the author
# Structs
No description provided by the author
API stores the channel, parameters and result values from calls via the channel.
No description provided by the author
CAPI is the central structure for configuration and access to a net/rpc API access endpoint for this RPC API.
Wrappers around RPC calls.
No description provided by the author
No description provided by the author
No description provided by the author
ConnManager provides a connection manager for use with the RPC server and implements the rpcserver ConnManager interface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GBTWorkState houses state that is used in between multiple RPC invocations to getblocktemplate.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
HelpCacher provides a concurrent safe type that provides help and usage for the RPC server commands and caches the results for future calls.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParsedRPCCmd represents a JSON-RPC request object that has been parsed into a known concrete command along with any error that might have happened while parsing it.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RetrievedTx represents a transaction that was either loaded from the transaction memory pool or from the database.
No description provided by the author
No description provided by the author
Server provides a concurrent safe RPC server to a chain server.
ServerConfig is a descriptor containing the RPC server configuration.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SyncManager provides a block manager for use with the RPC server and implements the RPCServerSyncManager interface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WSClient provides an abstraction for handling a websocket client.
WSClientFilter tracks relevant addresses for each websocket client for the `rescanblocks` extension.
WSNtfnMgr is a connection and notification manager used for websockets.
WSResponse houses a message to send to a connected websocket client as well as a channel to reply on when the message is sent.
# Interfaces
ServerConnManager represents a connection manager for use with the RPC server.
ServerPeer represents a peer for use with the RPC server.
ServerSyncManager represents a sync manager for use with the RPC server.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Peer provides a peer for use with the RPC server and implements the RPCServerPeer interface.
No description provided by the author
WSCommandHandler describes a callback function used to handle a specific command.