rpc

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: LGPL-2.1-or-later Imports: 22 Imported by: 0

Documentation

Overview

This file is part of go-ethereum

go-ethereum is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

go-ethereum is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONRPC added in v0.9.17

func JSONRPC(pipe *xeth.XEth) http.Handler

JSONRPC returns a handler that implements the Ethereum JSON-RPC API.

func NewDecodeParamError added in v0.9.17

func NewDecodeParamError(errstr string) error

func NewHashesRes added in v0.9.17

func NewHashesRes(hs []common.Hash) []string

func NewValidationError added in v0.9.17

func NewValidationError(param string, msg string) error

func RpcResponse added in v0.9.17

func RpcResponse(api *EthereumApi, request *RpcRequest) *interface{}

func Start added in v0.9.17

func Start(pipe *xeth.XEth, config RpcConfig) error

func Stop added in v0.9.17

func Stop() error

Types

type BlockFilterArgs added in v0.9.17

type BlockFilterArgs struct {
	Earliest int64
	Latest   int64
	Address  []string
	Topics   [][]string
	Skip     int
	Max      int
}

func (*BlockFilterArgs) UnmarshalJSON added in v0.9.17

func (args *BlockFilterArgs) UnmarshalJSON(b []byte) (err error)

type BlockNumArg added in v0.9.17

type BlockNumArg struct {
	BlockNumber int64
}

func (*BlockNumArg) UnmarshalJSON added in v0.9.17

func (args *BlockNumArg) UnmarshalJSON(b []byte) (err error)

type BlockNumIndexArgs added in v0.9.17

type BlockNumIndexArgs struct {
	BlockNumber int64
	Index       int64
}

func (*BlockNumIndexArgs) UnmarshalJSON added in v0.9.17

func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error)

type BlockRes added in v0.9.17

type BlockRes struct {
	BlockNumber     *hexnum           `json:"number"`
	BlockHash       *hexdata          `json:"hash"`
	ParentHash      *hexdata          `json:"parentHash"`
	Nonce           *hexdata          `json:"nonce"`
	Sha3Uncles      *hexdata          `json:"sha3Uncles"`
	LogsBloom       *hexdata          `json:"logsBloom"`
	TransactionRoot *hexdata          `json:"transactionsRoot"`
	StateRoot       *hexdata          `json:"stateRoot"`
	Miner           *hexdata          `json:"miner"`
	Difficulty      *hexnum           `json:"difficulty"`
	TotalDifficulty *hexnum           `json:"totalDifficulty"`
	Size            *hexnum           `json:"size"`
	ExtraData       *hexdata          `json:"extraData"`
	GasLimit        *hexnum           `json:"gasLimit"`
	GasUsed         *hexnum           `json:"gasUsed"`
	UnixTimestamp   *hexnum           `json:"timestamp"`
	Transactions    []*TransactionRes `json:"transactions"`
	Uncles          []*UncleRes       `json:"uncles"`
	// contains filtered or unexported fields
}

func NewBlockRes added in v0.9.17

func NewBlockRes(block *types.Block, fullTx bool) *BlockRes

func (*BlockRes) MarshalJSON added in v0.9.17

func (b *BlockRes) MarshalJSON() ([]byte, error)

type CallArgs added in v0.9.17

type CallArgs struct {
	From     string
	To       string
	Value    *big.Int
	Gas      *big.Int
	GasPrice *big.Int
	Data     string

	BlockNumber int64
}

func (*CallArgs) UnmarshalJSON added in v0.9.17

func (args *CallArgs) UnmarshalJSON(b []byte) (err error)

type CompileArgs added in v0.9.17

type CompileArgs struct {
	Source string
}

func (*CompileArgs) UnmarshalJSON added in v0.9.17

func (args *CompileArgs) UnmarshalJSON(b []byte) (err error)

type DbArgs added in v0.8.4

type DbArgs struct {
	Database string
	Key      string
	Value    []byte
}

func (*DbArgs) UnmarshalJSON added in v0.9.17

func (args *DbArgs) UnmarshalJSON(b []byte) (err error)

type DbHexArgs added in v0.9.17

type DbHexArgs struct {
	Database string
	Key      string
	Value    []byte
}

func (*DbHexArgs) UnmarshalJSON added in v0.9.17

func (args *DbHexArgs) UnmarshalJSON(b []byte) (err error)

type DecodeParamError added in v0.9.17

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

func (*DecodeParamError) Error added in v0.9.17

func (e *DecodeParamError) Error() string

type EthereumApi

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

func NewEthereumApi added in v0.8.4

func NewEthereumApi(xeth *xeth.XEth) *EthereumApi

func (*EthereumApi) GetRequestReply added in v0.8.4

func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error

type FilterIdArgs added in v0.9.17

type FilterIdArgs struct {
	Id int
}

func (*FilterIdArgs) UnmarshalJSON added in v0.9.17

func (args *FilterIdArgs) UnmarshalJSON(b []byte) (err error)

type FilterStringArgs added in v0.9.17

type FilterStringArgs struct {
	Word string
}

func (*FilterStringArgs) UnmarshalJSON added in v0.9.17

func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error)

type GetBalanceArgs

type GetBalanceArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetBalanceArgs) UnmarshalJSON added in v0.8.4

func (args *GetBalanceArgs) UnmarshalJSON(b []byte) (err error)

type GetBlockByHashArgs added in v0.9.17

type GetBlockByHashArgs struct {
	BlockHash  string
	IncludeTxs bool
}

func (*GetBlockByHashArgs) UnmarshalJSON added in v0.9.17

func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error)

type GetBlockByNumberArgs added in v0.9.17

type GetBlockByNumberArgs struct {
	BlockNumber int64
	IncludeTxs  bool
}

func (*GetBlockByNumberArgs) UnmarshalJSON added in v0.9.17

func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error)

type GetDataArgs added in v0.9.17

type GetDataArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetDataArgs) UnmarshalJSON added in v0.9.17

func (args *GetDataArgs) UnmarshalJSON(b []byte) (err error)

type GetStorageArgs

type GetStorageArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetStorageArgs) UnmarshalJSON added in v0.8.4

func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error)

type GetStorageAtArgs added in v0.9.17

type GetStorageAtArgs struct {
	Address     string
	Key         string
	BlockNumber int64
}

func (*GetStorageAtArgs) UnmarshalJSON added in v0.9.17

func (args *GetStorageAtArgs) UnmarshalJSON(b []byte) (err error)

type GetTxCountArgs

type GetTxCountArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetTxCountArgs) UnmarshalJSON added in v0.8.4

func (args *GetTxCountArgs) UnmarshalJSON(b []byte) (err error)

type HashArgs added in v0.9.17

type HashArgs struct {
	Hash string
}

func (*HashArgs) UnmarshalJSON added in v0.9.17

func (args *HashArgs) UnmarshalJSON(b []byte) (err error)

type HashIndexArgs added in v0.9.17

type HashIndexArgs struct {
	Hash  string
	Index int64
}

func (*HashIndexArgs) UnmarshalJSON added in v0.9.17

func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error)

type InsufficientParamsError added in v0.9.17

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

func NewInsufficientParamsError added in v0.9.17

func NewInsufficientParamsError(have int, want int) *InsufficientParamsError

func (*InsufficientParamsError) Error added in v0.9.17

func (e *InsufficientParamsError) Error() string

type InvalidTypeError added in v0.9.17

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

func NewInvalidTypeError added in v0.9.17

func NewInvalidTypeError(method, msg string) *InvalidTypeError

func (*InvalidTypeError) Error added in v0.9.17

func (e *InvalidTypeError) Error() string

type Jeth added in v0.9.17

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

func NewJeth added in v0.9.17

func NewJeth(ethApi *EthereumApi, toVal func(interface{}) otto.Value, re *jsre.JSRE) *Jeth

func (*Jeth) Send added in v0.9.17

func (self *Jeth) Send(call otto.FunctionCall) (response otto.Value)

type LogRes added in v0.9.17

type LogRes struct {
	Address          *hexdata   `json:"address"`
	Topics           []*hexdata `json:"topics"`
	Data             *hexdata   `json:"data"`
	BlockNumber      *hexnum    `json:"blockNumber"`
	LogIndex         *hexnum    `json:"logIndex"`
	BlockHash        *hexdata   `json:"blockHash"`
	TransactionHash  *hexdata   `json:"transactionHash"`
	TransactionIndex *hexnum    `json:"transactionIndex"`
}

func NewLogRes added in v0.9.17

func NewLogRes(log *state.Log) LogRes

func NewLogsRes added in v0.9.17

func NewLogsRes(logs state.Logs) (ls []LogRes)

type NewSigArgs added in v0.9.20

type NewSigArgs struct {
	From string
	Data string
}

func (*NewSigArgs) UnmarshalJSON added in v0.9.20

func (args *NewSigArgs) UnmarshalJSON(b []byte) (err error)

type NewTxArgs

type NewTxArgs struct {
	From     string
	To       string
	Nonce    *big.Int
	Value    *big.Int
	Gas      *big.Int
	GasPrice *big.Int
	Data     string

	BlockNumber int64
}

func (*NewTxArgs) UnmarshalJSON added in v0.8.4

func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error)

type NotAvailableError added in v0.9.20

type NotAvailableError struct {
	Method string
	Reason string
}

func NewNotAvailableError added in v0.9.20

func NewNotAvailableError(method string, reason string) *NotAvailableError

func (*NotAvailableError) Error added in v0.9.20

func (e *NotAvailableError) Error() string

type NotImplementedError added in v0.9.17

type NotImplementedError struct {
	Method string
}

func NewNotImplementedError added in v0.9.17

func NewNotImplementedError(method string) *NotImplementedError

func (*NotImplementedError) Error added in v0.9.17

func (e *NotImplementedError) Error() string

type RpcConfig added in v0.9.17

type RpcConfig struct {
	ListenAddress string
	ListenPort    uint
	CorsDomain    string
}

type RpcErrorObject added in v0.8.4

type RpcErrorObject struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RpcErrorResponse added in v0.8.4

type RpcErrorResponse struct {
	Id      interface{}     `json:"id"`
	Jsonrpc string          `json:"jsonrpc"`
	Error   *RpcErrorObject `json:"error"`
}

type RpcRequest added in v0.8.4

type RpcRequest struct {
	Id      interface{}     `json:"id"`
	Jsonrpc string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params"`
}

type RpcSuccessResponse added in v0.8.4

type RpcSuccessResponse struct {
	Id      interface{} `json:"id"`
	Jsonrpc string      `json:"jsonrpc"`
	Result  interface{} `json:"result"`
}

type Sha3Args added in v0.8.4

type Sha3Args struct {
	Data string
}

func (*Sha3Args) UnmarshalJSON added in v0.8.4

func (args *Sha3Args) UnmarshalJSON(b []byte) (err error)

type SourceArgs added in v0.9.17

type SourceArgs struct {
	Source string
}

func (*SourceArgs) UnmarshalJSON added in v0.9.17

func (args *SourceArgs) UnmarshalJSON(b []byte) (err error)

type SubmitWorkArgs added in v0.9.17

type SubmitWorkArgs struct {
	Nonce  uint64
	Header string
	Digest string
}

func (*SubmitWorkArgs) UnmarshalJSON added in v0.9.17

func (args *SubmitWorkArgs) UnmarshalJSON(b []byte) (err error)

type TransactionRes added in v0.9.17

type TransactionRes struct {
	Hash        *hexdata `json:"hash"`
	Nonce       *hexnum  `json:"nonce"`
	BlockHash   *hexdata `json:"blockHash"`
	BlockNumber *hexnum  `json:"blockNumber"`
	TxIndex     *hexnum  `json:"transactionIndex"`
	From        *hexdata `json:"from"`
	To          *hexdata `json:"to"`
	Value       *hexnum  `json:"value"`
	Gas         *hexnum  `json:"gas"`
	GasPrice    *hexnum  `json:"gasPrice"`
	Input       *hexdata `json:"input"`
}

func NewTransactionRes added in v0.9.17

func NewTransactionRes(tx *types.Transaction) *TransactionRes

type UncleRes added in v0.9.17

type UncleRes struct {
	BlockNumber     *hexnum  `json:"number"`
	BlockHash       *hexdata `json:"hash"`
	ParentHash      *hexdata `json:"parentHash"`
	Nonce           *hexdata `json:"nonce"`
	Sha3Uncles      *hexdata `json:"sha3Uncles"`
	ReceiptHash     *hexdata `json:"receiptHash"`
	LogsBloom       *hexdata `json:"logsBloom"`
	TransactionRoot *hexdata `json:"transactionsRoot"`
	StateRoot       *hexdata `json:"stateRoot"`
	Miner           *hexdata `json:"miner"`
	Difficulty      *hexnum  `json:"difficulty"`
	ExtraData       *hexdata `json:"extraData"`
	GasLimit        *hexnum  `json:"gasLimit"`
	GasUsed         *hexnum  `json:"gasUsed"`
	UnixTimestamp   *hexnum  `json:"timestamp"`
}

func NewUncleRes added in v0.9.17

func NewUncleRes(h *types.Header) *UncleRes

type ValidationError added in v0.9.17

type ValidationError struct {
	ParamName string
	// contains filtered or unexported fields
}

func (*ValidationError) Error added in v0.9.17

func (e *ValidationError) Error() string

type WhisperFilterArgs added in v0.9.17

type WhisperFilterArgs struct {
	To     string
	From   string
	Topics [][]string
}

func (*WhisperFilterArgs) UnmarshalJSON added in v0.9.17

func (args *WhisperFilterArgs) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface, invoked to convert a JSON message blob into a WhisperFilterArgs structure.

type WhisperIdentityArgs added in v0.9.17

type WhisperIdentityArgs struct {
	Identity string
}

func (*WhisperIdentityArgs) UnmarshalJSON added in v0.9.17

func (args *WhisperIdentityArgs) UnmarshalJSON(b []byte) (err error)

type WhisperMessageArgs added in v0.8.4

type WhisperMessageArgs struct {
	Payload  string
	To       string
	From     string
	Topics   []string
	Priority uint32
	Ttl      uint32
}

func (*WhisperMessageArgs) UnmarshalJSON added in v0.9.17

func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error)

Jump to

Keyboard shortcuts

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