rpc

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: BSD-2-Clause Imports: 72 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DebugCmd           = ""
	BlockChainCmd      = "BlockChain"
	ControlCmd         = "Control"
	GeneratingCmd      = "Generating"
	MiningCmd          = "Mining"
	NetworkCmd         = "Network"
	RawTransactionsCmd = "RawTransactions"
	UtilCmd            = "Util"
	WalletCmd          = "Wallet"
)

Variables

This section is empty.

Functions

func BIP22ValidationResult

func BIP22ValidationResult(err error) (interface{}, error)

func GenCertPair

func GenCertPair(certFile, keyFile string) error

GenCertPair generates a key/cert pair to the paths provided.

func GetNetworkHashPS added in v0.0.3

func GetNetworkHashPS(lookup int32, height int32) float64

func GetTransaction

func GetTransaction(hash *util.Hash, allowSlow bool) (*tx.Tx, *util.Hash, bool)

func GetTxnOutputType

func GetTxnOutputType(sType int) string

func HelpExampleCli added in v0.0.5

func HelpExampleCli(methodname string, args ...string) string

func HelpExampleRPC added in v0.0.5

func HelpExampleRPC(methodname string, args ...string) string

func NewTLSCertPair

func NewTLSCertPair(organization string, validUntil time.Time, extraHosts []string) (cert, key []byte, err error)

NewTLSCertPair returns a new PEM-encoded x.509 certificate pair based on a 521-bit ECDSA private key. The machine's local interface addresses and all variants of IPv4 and IPv6 localhost are included as valid IP addresses.

func ScriptPubKeyToJSON

func ScriptPubKeyToJSON(script *script.Script, includeHex bool) *btcjson.ScriptPubKeyResult

func ScriptToAsmStr

func ScriptToAsmStr(s *script.Script, attemptSighashDecode bool) string

func SetupRPCListeners

func SetupRPCListeners() ([]net.Listener, error)

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.

func TxInErrorToJSON

func TxInErrorToJSON(in *txin.TxIn, errorMessage string) *btcjson.SignRawTransactionError

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server provides a concurrent safe RPC server to a chain server.

func InitRPCServer

func InitRPCServer(timeSource *util.MedianTime) (*Server, error)

func NewServer

func NewServer(config *ServerConfig, ts *util.MedianTime) (*Server, error)

func (*Server) RequestedProcessShutdown

func (s *Server) RequestedProcessShutdown() <-chan struct{}

RequestedProcessShutdown returns a channel that is sent to when an authorized RPC client requests the process to shutdown. If the request can not be read immediately, it is dropped.

func (*Server) Start

func (s *Server) Start()

Start func starts the rpc listener.

func (*Server) Stop

func (s *Server) Stop() error

Stop is used by server.go to stop the rpc listener.

type ServerConfig

type ServerConfig struct {
	Listeners []net.Listener
	// unix timestamp for when the server that is hosting the RPC server started.
	StartupTime int64
	ConnMgr     server.RPCConnManager
}

Directories

Path Synopsis
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL