Documentation ¶
Index ¶
- Constants
- func NewBurrowJsonService(codec rpc.Codec, pipe definitions.Pipe, eventSubs *event.EventSubscriptions) server.HttpService
- func NewBurrowWsService(codec rpc.Codec, pipe definitions.Pipe) server.WebSocketService
- func NewTCodec() rpc.Codec
- type AccountsParam
- type AddressParam
- type BlocksParam
- type BurrowJsonService
- func (this *BurrowJsonService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowJsonService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowJsonService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowJsonService) Process(r *http.Request, w http.ResponseWriter)
- type BurrowMethods
- func (burrowMethods *BurrowMethods) Account(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) AccountStorage(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) AccountStorageAt(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Accounts(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Block(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) BlockchainInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Blocks(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) BroadcastTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Call(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) CallCode(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) ChainId(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) ClientVersion(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) ConsensusState(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) GenPrivAccount(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) GenPrivAccountFromKey(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) GenesisHash(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) LatestBlock(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) LatestBlockHeight(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Listeners(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Listening(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Moniker(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) NameRegEntries(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) NameRegEntry(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) NetworkInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Peer(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Peers(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowMethods) Send(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowMethods) SendAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) SignTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Transact(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) TransactAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) TransactNameReg(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) UnconfirmedTxs(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (burrowMethods *BurrowMethods) Validators(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- type BurrowWsService
- func (this *BurrowWsService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowWsService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowWsService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
- func (this *BurrowWsService) Process(msg []byte, session *server.WSSession)
- type CallCodeParam
- type CallParam
- type EventIdParam
- type FilterListParam
- type HeightParam
- type JsonRpcServer
- type NameRegEntryParam
- type PeerParam
- type PrivKeyParam
- type RequestHandlerFunc
- type RestServer
- type SendParam
- type SignTxParam
- type StorageAtParam
- type SubIdParam
- type TCodec
- func (this *TCodec) Decode(v interface{}, r io.Reader) error
- func (this *TCodec) DecodeBytes(v interface{}, bts []byte) error
- func (this *TCodec) DecodeBytesPtr(v interface{}, bts []byte) error
- func (this *TCodec) Encode(v interface{}, w io.Writer) error
- func (this *TCodec) EncodeBytes(v interface{}) ([]byte, error)
- type TransactNameRegParam
- type TransactParam
Constants ¶
const ( SERVICE_NAME = "burrow" GET_ACCOUNTS = SERVICE_NAME + ".getAccounts" // Accounts GET_ACCOUNT = SERVICE_NAME + ".getAccount" GET_STORAGE = SERVICE_NAME + ".getStorage" GET_STORAGE_AT = SERVICE_NAME + ".getStorageAt" GEN_PRIV_ACCOUNT = SERVICE_NAME + ".genPrivAccount" GEN_PRIV_ACCOUNT_FROM_KEY = SERVICE_NAME + ".genPrivAccountFromKey" GET_BLOCKCHAIN_INFO = SERVICE_NAME + ".getBlockchainInfo" // Blockchain GET_GENESIS_HASH = SERVICE_NAME + ".getGenesisHash" GET_LATEST_BLOCK_HEIGHT = SERVICE_NAME + ".getLatestBlockHeight" GET_LATEST_BLOCK = SERVICE_NAME + ".getLatestBlock" GET_BLOCKS = SERVICE_NAME + ".getBlocks" GET_BLOCK = SERVICE_NAME + ".getBlock" GET_CONSENSUS_STATE = SERVICE_NAME + ".getConsensusState" // Consensus GET_VALIDATORS = SERVICE_NAME + ".getValidators" GET_NETWORK_INFO = SERVICE_NAME + ".getNetworkInfo" // Net GET_CLIENT_VERSION = SERVICE_NAME + ".getClientVersion" GET_MONIKER = SERVICE_NAME + ".getMoniker" GET_CHAIN_ID = SERVICE_NAME + ".getChainId" IS_LISTENING = SERVICE_NAME + ".isListening" GET_LISTENERS = SERVICE_NAME + ".getListeners" GET_PEERS = SERVICE_NAME + ".getPeers" GET_PEER = SERVICE_NAME + ".getPeer" CALL = SERVICE_NAME + ".call" // Tx CALL_CODE = SERVICE_NAME + ".callCode" BROADCAST_TX = SERVICE_NAME + ".broadcastTx" GET_UNCONFIRMED_TXS = SERVICE_NAME + ".getUnconfirmedTxs" SIGN_TX = SERVICE_NAME + ".signTx" TRANSACT = SERVICE_NAME + ".transact" TRANSACT_AND_HOLD = SERVICE_NAME + ".transactAndHold" SEND = SERVICE_NAME + ".send" SEND_AND_HOLD = SERVICE_NAME + ".sendAndHold" TRANSACT_NAMEREG = SERVICE_NAME + ".transactNameReg" EVENT_SUBSCRIBE = SERVICE_NAME + ".eventSubscribe" // Events EVENT_UNSUBSCRIBE = SERVICE_NAME + ".eventUnsubscribe" EVENT_POLL = SERVICE_NAME + ".eventPoll" GET_NAMEREG_ENTRY = SERVICE_NAME + ".getNameRegEntry" // Namereg GET_NAMEREG_ENTRIES = SERVICE_NAME + ".getNameRegEntries" )
TODO use the method name definition file.
Variables ¶
This section is empty.
Functions ¶
func NewBurrowJsonService ¶ added in v0.16.2
func NewBurrowJsonService(codec rpc.Codec, pipe definitions.Pipe, eventSubs *event.EventSubscriptions) server.HttpService
Create a new JSON-RPC 2.0 service for burrow (tendermint).
func NewBurrowWsService ¶ added in v0.16.2
func NewBurrowWsService(codec rpc.Codec, pipe definitions.Pipe) server.WebSocketService
Create a new websocket service.
Types ¶
type AccountsParam ¶
type AccountsParam struct {
Filters []*event.FilterData `json:"filters"`
}
Used to send an address TODO deprecate in favor of 'FilterListParam'
type AddressParam ¶
type AddressParam struct {
Address []byte `json:"address"`
}
Used to send an address. The address should be hex and properly formatted. TODO enforce.
type BlocksParam ¶
type BlocksParam struct {
Filters []*event.FilterData `json:"filters"`
}
Get a series of blocks TODO deprecate in favor of 'FilterListParam'
type BurrowJsonService ¶ added in v0.16.2
type BurrowJsonService struct {
// contains filtered or unexported fields
}
Used for Burrow. Implements server.HttpService
func (*BurrowJsonService) EventPoll ¶ added in v0.16.2
func (this *BurrowJsonService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
Check subscription event cache for new data.
func (*BurrowJsonService) EventSubscribe ¶ added in v0.16.2
func (this *BurrowJsonService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
Subscribe to an event.
func (*BurrowJsonService) EventUnsubscribe ¶ added in v0.16.2
func (this *BurrowJsonService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
Un-subscribe from an event.
func (*BurrowJsonService) Process ¶ added in v0.16.2
func (this *BurrowJsonService) Process(r *http.Request, w http.ResponseWriter)
Process a request.
type BurrowMethods ¶ added in v0.16.2
type BurrowMethods struct {
// contains filtered or unexported fields
}
The rpc method handlers.
func NewBurrowMethods ¶ added in v0.16.2
func NewBurrowMethods(codec rpc.Codec, pipe definitions.Pipe) *BurrowMethods
func (*BurrowMethods) Account ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Account(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) AccountStorage ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) AccountStorage(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) AccountStorageAt ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) AccountStorageAt(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Accounts ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Accounts(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Block ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Block(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) BlockchainInfo ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) BlockchainInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Blocks ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Blocks(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) BroadcastTx ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) BroadcastTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Call ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Call(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) CallCode ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) CallCode(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) ChainId ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) ChainId(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) ClientVersion ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) ClientVersion(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) ConsensusState ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) ConsensusState(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) GenPrivAccount ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) GenPrivAccount(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) GenPrivAccountFromKey ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) GenPrivAccountFromKey(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) GenesisHash ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) GenesisHash(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) LatestBlock ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) LatestBlock(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) LatestBlockHeight ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) LatestBlockHeight(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Listeners ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Listeners(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Listening ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Listening(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Moniker ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Moniker(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) NameRegEntries ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) NameRegEntries(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) NameRegEntry ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) NameRegEntry(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) NetworkInfo ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) NetworkInfo(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Peer ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Peer(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Peers ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Peers(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Send ¶ added in v0.16.2
func (this *BurrowMethods) Send(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) SendAndHold ¶ added in v0.16.2
func (this *BurrowMethods) SendAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) SignTx ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) SignTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Transact ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Transact(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) TransactAndHold ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) TransactAndHold(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) TransactNameReg ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) TransactNameReg(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) UnconfirmedTxs ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) UnconfirmedTxs(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowMethods) Validators ¶ added in v0.16.2
func (burrowMethods *BurrowMethods) Validators(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
type BurrowWsService ¶ added in v0.16.2
type BurrowWsService struct {
// contains filtered or unexported fields
}
Used for Burrow. Implements WebSocketService.
func (*BurrowWsService) EventPoll ¶ added in v0.16.2
func (this *BurrowWsService) EventPoll(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowWsService) EventSubscribe ¶ added in v0.16.2
func (this *BurrowWsService) EventSubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
func (*BurrowWsService) EventUnsubscribe ¶ added in v0.16.2
func (this *BurrowWsService) EventUnsubscribe(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error)
type CallCodeParam ¶
type CallCodeParam struct { From []byte `json:"from"` Code []byte `json:"code"` Data []byte `json:"data"` }
Used when doing code calls
type CallParam ¶
type CallParam struct { Address []byte `json:"address"` From []byte `json:"from"` Data []byte `json:"data"` }
Used when doing calls
type FilterListParam ¶
type FilterListParam struct {
Filters []*event.FilterData `json:"filters"`
}
Used to send an address
type JsonRpcServer ¶
type JsonRpcServer struct {
// contains filtered or unexported fields
}
Server used to handle JSON-RPC 2.0 requests. Implements server.Server
func NewJsonRpcServer ¶
func NewJsonRpcServer(service server.HttpService) *JsonRpcServer
Create a new JsonRpcServer
func (*JsonRpcServer) Running ¶
func (this *JsonRpcServer) Running() bool
Is the server currently running?
func (*JsonRpcServer) ShutDown ¶
func (this *JsonRpcServer) ShutDown()
Shut the server down. Does nothing.
func (*JsonRpcServer) Start ¶
func (this *JsonRpcServer) Start(config *server.ServerConfig, router *gin.Engine)
Start adds the rpc path to the router.
type NameRegEntryParam ¶
type NameRegEntryParam struct {
Name string `json:"name"`
}
type PrivKeyParam ¶
type PrivKeyParam struct {
PrivKey []byte `json:"priv_key"`
}
type RequestHandlerFunc ¶
type RequestHandlerFunc func(*rpc.RPCRequest, interface{}) (interface{}, int, error)
Used to handle requests. interface{} param is a wildcard used for example with socket events.
type RestServer ¶
type RestServer struct {
// contains filtered or unexported fields
}
Provides a REST-like web-api. Implements server.Server TODO more routers. Also, start looking into how better status codes can be gotten.
func NewRestServer ¶
func NewRestServer(codec rpc.Codec, pipe definitions.Pipe, eventSubs *event.EventSubscriptions) *RestServer
Create a new rest server.
func (*RestServer) Running ¶
func (restServer *RestServer) Running() bool
Is the server currently running?
func (*RestServer) ShutDown ¶
func (restServer *RestServer) ShutDown()
Shut the server down. Does nothing.
func (*RestServer) Start ¶
func (restServer *RestServer) Start(config *server.ServerConfig, router *gin.Engine)
Starting the server means registering all the handlers with the router.
type SendParam ¶
type SendParam struct { PrivKey []byte `json:"priv_key"` ToAddress []byte `json:"to_address"` Amount int64 `json:"amount"` }
Used when sending a 'Send' transaction.
type SignTxParam ¶
type SignTxParam struct { Tx *txs.CallTx `json:"tx"` PrivAccounts []*account.PrivAccount `json:"priv_accounts"` }
Used when signing a tx. Uses placeholders just like TxParam
type StorageAtParam ¶
StorageAt
type TCodec ¶
type TCodec struct { }
Codec that uses tendermints 'binary' package for JSON.
func (*TCodec) DecodeBytes ¶
Decode from a byte array.
func (*TCodec) DecodeBytesPtr ¶ added in v0.16.0
Decode from a byte array pointer.
func (*TCodec) EncodeBytes ¶
Encode to a byte array.
type TransactNameRegParam ¶
type TransactNameRegParam struct { PrivKey []byte `json:"priv_key"` Name string `json:"name"` Data string `json:"data"` Fee int64 `json:"fee"` Amount int64 `json:"amount"` }
Used when sending a namereg transaction to be created and signed on the server (using the private key). This only uses the standard key type for now.
type TransactParam ¶
type TransactParam struct { PrivKey []byte `json:"priv_key"` Data []byte `json:"data"` Address []byte `json:"address"` Fee int64 `json:"fee"` GasLimit int64 `json:"gas_limit"` }
Used when sending a transaction to be created and signed on the server (using the private key). This only uses the standard key type for now.