rpc

package
v0.0.0-...-686c1ca Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: GPL-2.0 Imports: 21 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

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

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

func NewDecodeParamError

func NewDecodeParamError(errstr string) error

func NewHashesRes

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

func NewValidationError

func NewValidationError(param string, msg string) error

func RpcResponse

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

func Start

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

func Stop

func Stop() error

Types

type BlockFilterArgs

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

func (*BlockFilterArgs) UnmarshalJSON

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

type BlockNumArg

type BlockNumArg struct {
	BlockNumber int64
}

func (*BlockNumArg) UnmarshalJSON

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

type BlockNumIndexArgs

type BlockNumIndexArgs struct {
	BlockNumber int64
	Index       int64
}

func (*BlockNumIndexArgs) UnmarshalJSON

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

type BlockRes

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

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

func (*BlockRes) MarshalJSON

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

type CallArgs

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

	BlockNumber int64
}

func (*CallArgs) UnmarshalJSON

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

type CompileArgs

type CompileArgs struct {
	Source string
}

func (*CompileArgs) UnmarshalJSON

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

type DbArgs

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

func (*DbArgs) UnmarshalJSON

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

type DbHexArgs

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

func (*DbHexArgs) UnmarshalJSON

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

type DecodeParamError

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

func (*DecodeParamError) Error

func (e *DecodeParamError) Error() string

type EthereumApi

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

func NewEthereumApi

func NewEthereumApi(xeth *xeth.XEth) *EthereumApi

func (*EthereumApi) GetRequestReply

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

type FilterIdArgs

type FilterIdArgs struct {
	Id int
}

func (*FilterIdArgs) UnmarshalJSON

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

type FilterStringArgs

type FilterStringArgs struct {
	Word string
}

func (*FilterStringArgs) UnmarshalJSON

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

type GetBalanceArgs

type GetBalanceArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetBalanceArgs) UnmarshalJSON

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

type GetBlockByHashArgs

type GetBlockByHashArgs struct {
	BlockHash  string
	IncludeTxs bool
}

func (*GetBlockByHashArgs) UnmarshalJSON

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

type GetBlockByNumberArgs

type GetBlockByNumberArgs struct {
	BlockNumber int64
	IncludeTxs  bool
}

func (*GetBlockByNumberArgs) UnmarshalJSON

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

type GetDataArgs

type GetDataArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetDataArgs) UnmarshalJSON

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

type GetStorageArgs

type GetStorageArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetStorageArgs) UnmarshalJSON

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

type GetStorageAtArgs

type GetStorageAtArgs struct {
	Address     string
	Key         string
	BlockNumber int64
}

func (*GetStorageAtArgs) UnmarshalJSON

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

type GetTxCountArgs

type GetTxCountArgs struct {
	Address     string
	BlockNumber int64
}

func (*GetTxCountArgs) UnmarshalJSON

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

type HashArgs

type HashArgs struct {
	Hash string
}

func (*HashArgs) UnmarshalJSON

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

type HashIndexArgs

type HashIndexArgs struct {
	Hash  string
	Index int64
}

func (*HashIndexArgs) UnmarshalJSON

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

type InsufficientParamsError

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

func NewInsufficientParamsError

func NewInsufficientParamsError(have int, want int) *InsufficientParamsError

func (*InsufficientParamsError) Error

func (e *InsufficientParamsError) Error() string

type InvalidTypeError

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

func NewInvalidTypeError

func NewInvalidTypeError(method, msg string) *InvalidTypeError

func (*InvalidTypeError) Error

func (e *InvalidTypeError) Error() string

type Jeth

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

func NewJeth

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

func (*Jeth) Send

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

type LogRes

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

func NewLogRes(log *state.Log) LogRes

func NewLogsRes

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

type NewSigArgs

type NewSigArgs struct {
	From string
	Data string
}

func (*NewSigArgs) UnmarshalJSON

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

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

type NotAvailableError

type NotAvailableError struct {
	Method string
	Reason string
}

func NewNotAvailableError

func NewNotAvailableError(method string, reason string) *NotAvailableError

func (*NotAvailableError) Error

func (e *NotAvailableError) Error() string

type NotImplementedError

type NotImplementedError struct {
	Method string
}

func NewNotImplementedError

func NewNotImplementedError(method string) *NotImplementedError

func (*NotImplementedError) Error

func (e *NotImplementedError) Error() string

type RpcConfig

type RpcConfig struct {
	ListenAddress string
	ListenPort    uint
	CorsDomain    string
}

type RpcErrorObject

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

type RpcErrorResponse

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

type RpcRequest

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

type RpcSuccessResponse

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

type Sha3Args

type Sha3Args struct {
	Data string
}

func (*Sha3Args) UnmarshalJSON

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

type SourceArgs

type SourceArgs struct {
	Source string
}

func (*SourceArgs) UnmarshalJSON

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

type SubmitWorkArgs

type SubmitWorkArgs struct {
	Nonce  uint64
	Header string
	Digest string
}

func (*SubmitWorkArgs) UnmarshalJSON

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

type TransactionRes

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

func NewTransactionRes(tx *types.Transaction) *TransactionRes

type UncleRes

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

func NewUncleRes(h *types.Header) *UncleRes

type ValidationError

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

func (*ValidationError) Error

func (e *ValidationError) Error() string

type WhisperFilterArgs

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

func (*WhisperFilterArgs) UnmarshalJSON

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

type WhisperIdentityArgs struct {
	Identity string
}

func (*WhisperIdentityArgs) UnmarshalJSON

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

type WhisperMessageArgs

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

func (*WhisperMessageArgs) UnmarshalJSON

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