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/>.
For each request type, define the following:
1. RpcRequest "To" method [message.go], which does basic validation and conversion to "Args" type via json.Decoder() 2. json.Decoder() calls "UnmarshalON" defined on each "Args" struct 3. EthereumApi method, taking the "Args" type and replying with an interface to be marshalled to ON
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
- func NewErrorResponse(msg string) error
- func NewErrorResponseWithError(msg string, err error) error
- type BalanceRes
- type DbArgs
- type EthereumApi
- func (p *EthereumApi) Accounts(reply *interface{}) error
- func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error
- func (p *EthereumApi) BlockNumber(reply *interface{}) error
- func (p *EthereumApi) Call(args *NewTxArgs, reply *interface{}) error
- func (p *EthereumApi) CompileSerpent(script string, reply *interface{}) error
- func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error
- func (p *EthereumApi) DbPut(args *DbArgs, reply *interface{}) error
- func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error
- func (p *EthereumApi) GetBalanceAt(args *GetBalanceArgs, reply *interface{}) error
- func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error
- func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error
- func (p *EthereumApi) GetCoinbase(reply *interface{}) error
- func (p *EthereumApi) GetCompilers(reply *interface{}) error
- func (p *EthereumApi) GetIsListening(reply *interface{}) error
- func (p *EthereumApi) GetIsMining(reply *interface{}) error
- func (p *EthereumApi) GetPeerCount(reply *interface{}) error
- func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
- func (p *EthereumApi) GetStateAt(args *GetStateArgs, reply *interface{}) error
- func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *interface{}) error
- func (p *EthereumApi) GetTxCountAt(args *GetTxCountArgs, reply *interface{}) error
- func (p *EthereumApi) HasWhisperIdentity(args string, reply *interface{}) error
- func (self *EthereumApi) Logs(id int, reply *interface{}) error
- func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error
- func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) error
- func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
- func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) error
- func (p *EthereumApi) NewWhisperIdentity(reply *interface{}) error
- func (p *EthereumApi) PushTx(args *PushTxArgs, reply *interface{}) error
- func (self *EthereumApi) Register(args string, reply *interface{}) error
- func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error
- func (p *EthereumApi) Sha3(args *Sha3Args, reply *interface{}) error
- func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) error
- func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error
- func (self *EthereumApi) Unregister(args string, reply *interface{}) error
- func (self *EthereumApi) WatchTx(args string, reply *interface{}) error
- func (p *EthereumApi) WhisperMessages(id int, reply *interface{}) error
- func (p *EthereumApi) WhisperPost(args *WhisperMessageArgs, reply *interface{}) error
- type FilterChangedArgs
- type FilterOptions
- type GetBalanceArgs
- type GetBlockArgs
- type GetCodeAtArgs
- type GetStateArgs
- type GetStorageArgs
- type GetStorageAtRes
- type GetTxCountArgs
- type JsonWrapper
- type Log
- type NewTxArgs
- type PushTxArgs
- type RpcErrorObject
- type RpcErrorResponse
- type RpcRequest
- func (req *RpcRequest) ToBoolArgs() (bool, error)
- func (req *RpcRequest) ToCompileArgs() (string, error)
- func (req *RpcRequest) ToDbGetArgs() (*DbArgs, error)
- func (req *RpcRequest) ToDbPutArgs() (*DbArgs, error)
- func (req *RpcRequest) ToFilterArgs() (*FilterOptions, error)
- func (req *RpcRequest) ToFilterChangedArgs() (int, error)
- func (req *RpcRequest) ToFilterStringArgs() (string, error)
- func (req *RpcRequest) ToGetBalanceArgs() (*GetBalanceArgs, error)
- func (req *RpcRequest) ToGetBlockArgs() (*GetBlockArgs, error)
- func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error)
- func (req *RpcRequest) ToGetStateArgs() (*GetStateArgs, error)
- func (req *RpcRequest) ToGetTxCountArgs() (*GetTxCountArgs, error)
- func (req *RpcRequest) ToIdArgs() (int, error)
- func (req *RpcRequest) ToNewTxArgs() (*NewTxArgs, error)
- func (req *RpcRequest) ToPushTxArgs() (*PushTxArgs, error)
- func (req *RpcRequest) ToRegisterArgs() (string, error)
- func (req *RpcRequest) ToSha3Args() (*Sha3Args, error)
- func (req *RpcRequest) ToStorageAtArgs() (*GetStorageArgs, error)
- func (req *RpcRequest) ToUninstallFilterArgs() (int, error)
- func (req *RpcRequest) ToWatchTxArgs() (string, error)
- func (req *RpcRequest) ToWhisperFilterArgs() (*xeth.Options, error)
- func (req *RpcRequest) ToWhisperHasIdentityArgs() (string, error)
- func (req *RpcRequest) ToWhisperPostArgs() (*WhisperMessageArgs, error)
- type RpcServer
- type RpcSuccessResponse
- type Sha3Args
- type WhisperMessageArgs
Constants ¶
View Source
const ( ErrorArguments = "Error: Insufficient arguments" ErrorNotImplemented = "Error: Method not implemented" ErrorUnknown = "Error: Unknown error" ErrorParseRequest = "Error: Could not parse request" ErrorDecodeArgs = "Error: Could not decode arguments" )
Variables ¶
This section is empty.
Functions ¶
func NewErrorResponse ¶
func NewErrorResponseWithError ¶ added in v0.8.4
Types ¶
type BalanceRes ¶
type EthereumApi ¶
type EthereumApi struct {
// contains filtered or unexported fields
}
func NewEthereumApi ¶ added in v0.8.4
func NewEthereumApi(eth *xeth.XEth) *EthereumApi
func (*EthereumApi) Accounts ¶ added in v0.8.4
func (p *EthereumApi) Accounts(reply *interface{}) error
func (*EthereumApi) AllLogs ¶ added in v0.8.5
func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error
func (*EthereumApi) BlockNumber ¶ added in v0.8.4
func (p *EthereumApi) BlockNumber(reply *interface{}) error
func (*EthereumApi) Call ¶ added in v0.8.4
func (p *EthereumApi) Call(args *NewTxArgs, reply *interface{}) error
func (*EthereumApi) CompileSerpent ¶ added in v0.8.4
func (p *EthereumApi) CompileSerpent(script string, reply *interface{}) error
func (*EthereumApi) DbGet ¶ added in v0.8.4
func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error
func (*EthereumApi) DbPut ¶ added in v0.8.4
func (p *EthereumApi) DbPut(args *DbArgs, reply *interface{}) error
func (*EthereumApi) FilterChanged ¶ added in v0.8.4
func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error
func (*EthereumApi) GetBalanceAt ¶
func (p *EthereumApi) GetBalanceAt(args *GetBalanceArgs, reply *interface{}) error
func (*EthereumApi) GetBlock ¶
func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error
func (*EthereumApi) GetCodeAt ¶ added in v0.8.4
func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error
func (*EthereumApi) GetCoinbase ¶
func (p *EthereumApi) GetCoinbase(reply *interface{}) error
func (*EthereumApi) GetCompilers ¶ added in v0.8.4
func (p *EthereumApi) GetCompilers(reply *interface{}) error
func (*EthereumApi) GetIsListening ¶
func (p *EthereumApi) GetIsListening(reply *interface{}) error
func (*EthereumApi) GetIsMining ¶
func (p *EthereumApi) GetIsMining(reply *interface{}) error
func (*EthereumApi) GetPeerCount ¶
func (p *EthereumApi) GetPeerCount(reply *interface{}) error
func (*EthereumApi) GetRequestReply ¶ added in v0.8.4
func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
func (*EthereumApi) GetStateAt ¶ added in v0.8.4
func (p *EthereumApi) GetStateAt(args *GetStateArgs, reply *interface{}) error
func (*EthereumApi) GetStorageAt ¶
func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *interface{}) error
func (*EthereumApi) GetTxCountAt ¶
func (p *EthereumApi) GetTxCountAt(args *GetTxCountArgs, reply *interface{}) error
func (*EthereumApi) HasWhisperIdentity ¶ added in v0.8.4
func (p *EthereumApi) HasWhisperIdentity(args string, reply *interface{}) error
func (*EthereumApi) Logs ¶ added in v0.8.4
func (self *EthereumApi) Logs(id int, reply *interface{}) error
func (*EthereumApi) MessagesChanged ¶ added in v0.8.4
func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error
func (*EthereumApi) NewFilter ¶ added in v0.8.4
func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) error
func (*EthereumApi) NewFilterString ¶ added in v0.8.4
func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
func (*EthereumApi) NewWhisperFilter ¶ added in v0.8.4
func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) error
func (*EthereumApi) NewWhisperIdentity ¶ added in v0.8.4
func (p *EthereumApi) NewWhisperIdentity(reply *interface{}) error
func (*EthereumApi) PushTx ¶
func (p *EthereumApi) PushTx(args *PushTxArgs, reply *interface{}) error
func (*EthereumApi) Register ¶ added in v0.8.4
func (self *EthereumApi) Register(args string, reply *interface{}) error
func (*EthereumApi) SetMining ¶ added in v0.8.4
func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error
func (*EthereumApi) Sha3 ¶ added in v0.8.4
func (p *EthereumApi) Sha3(args *Sha3Args, reply *interface{}) error
func (*EthereumApi) Transact ¶
func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) error
func (*EthereumApi) UninstallFilter ¶ added in v0.8.4
func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error
func (*EthereumApi) Unregister ¶ added in v0.8.4
func (self *EthereumApi) Unregister(args string, reply *interface{}) error
func (*EthereumApi) WatchTx ¶ added in v0.8.4
func (self *EthereumApi) WatchTx(args string, reply *interface{}) error
func (*EthereumApi) WhisperMessages ¶ added in v0.8.4
func (p *EthereumApi) WhisperMessages(id int, reply *interface{}) error
func (*EthereumApi) WhisperPost ¶ added in v0.8.4
func (p *EthereumApi) WhisperPost(args *WhisperMessageArgs, reply *interface{}) error
type FilterChangedArgs ¶ added in v0.8.4
type FilterChangedArgs struct {
// contains filtered or unexported fields
}
type FilterOptions ¶ added in v0.8.4
type GetBalanceArgs ¶
type GetBalanceArgs struct {
Address string
}
func (*GetBalanceArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetBalanceArgs) UnmarshalJSON(b []byte) (err error)
type GetBlockArgs ¶
func (*GetBlockArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetBlockArgs) UnmarshalJSON(b []byte) (err error)
type GetCodeAtArgs ¶ added in v0.8.4
type GetCodeAtArgs struct {
Address string
}
func (*GetCodeAtArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetCodeAtArgs) UnmarshalJSON(b []byte) (err error)
type GetStateArgs ¶ added in v0.8.4
func (*GetStateArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetStateArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageArgs ¶
type GetStorageArgs struct {
Address string
}
func (*GetStorageArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetStorageArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageAtRes ¶
type GetTxCountArgs ¶
type GetTxCountArgs struct {
Address string `json:"address"`
}
func (*GetTxCountArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *GetTxCountArgs) UnmarshalJSON(b []byte) (err error)
type JsonWrapper ¶ added in v0.8.4
type JsonWrapper struct{}
func (JsonWrapper) ParseRequestBody ¶ added in v0.8.4
func (self JsonWrapper) ParseRequestBody(req *http.Request) (RpcRequest, error)
type NewTxArgs ¶
type NewTxArgs struct { From string `json:"from"` To string `json:"to"` Value string `json:"value"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Data string `json:"data"` }
func (*NewTxArgs) UnmarshalJSON ¶ added in v0.8.4
type PushTxArgs ¶
type PushTxArgs struct {
Tx string `json:"tx"`
}
func (*PushTxArgs) UnmarshalJSON ¶ added in v0.8.4
func (obj *PushTxArgs) UnmarshalJSON(b []byte) (err error)
type RpcErrorObject ¶ added in v0.8.4
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"` }
func (*RpcRequest) ToBoolArgs ¶ added in v0.8.4
func (req *RpcRequest) ToBoolArgs() (bool, error)
func (*RpcRequest) ToCompileArgs ¶ added in v0.8.4
func (req *RpcRequest) ToCompileArgs() (string, error)
func (*RpcRequest) ToDbGetArgs ¶ added in v0.8.4
func (req *RpcRequest) ToDbGetArgs() (*DbArgs, error)
func (*RpcRequest) ToDbPutArgs ¶ added in v0.8.4
func (req *RpcRequest) ToDbPutArgs() (*DbArgs, error)
func (*RpcRequest) ToFilterArgs ¶ added in v0.8.4
func (req *RpcRequest) ToFilterArgs() (*FilterOptions, error)
func (*RpcRequest) ToFilterChangedArgs ¶ added in v0.8.4
func (req *RpcRequest) ToFilterChangedArgs() (int, error)
func (*RpcRequest) ToFilterStringArgs ¶ added in v0.8.4
func (req *RpcRequest) ToFilterStringArgs() (string, error)
func (*RpcRequest) ToGetBalanceArgs ¶ added in v0.8.4
func (req *RpcRequest) ToGetBalanceArgs() (*GetBalanceArgs, error)
func (*RpcRequest) ToGetBlockArgs ¶ added in v0.8.4
func (req *RpcRequest) ToGetBlockArgs() (*GetBlockArgs, error)
func (*RpcRequest) ToGetCodeAtArgs ¶ added in v0.8.4
func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error)
func (*RpcRequest) ToGetStateArgs ¶ added in v0.8.4
func (req *RpcRequest) ToGetStateArgs() (*GetStateArgs, error)
func (*RpcRequest) ToGetTxCountArgs ¶ added in v0.8.4
func (req *RpcRequest) ToGetTxCountArgs() (*GetTxCountArgs, error)
func (*RpcRequest) ToIdArgs ¶ added in v0.8.4
func (req *RpcRequest) ToIdArgs() (int, error)
func (*RpcRequest) ToNewTxArgs ¶ added in v0.8.4
func (req *RpcRequest) ToNewTxArgs() (*NewTxArgs, error)
func (*RpcRequest) ToPushTxArgs ¶ added in v0.8.4
func (req *RpcRequest) ToPushTxArgs() (*PushTxArgs, error)
func (*RpcRequest) ToRegisterArgs ¶ added in v0.8.4
func (req *RpcRequest) ToRegisterArgs() (string, error)
func (*RpcRequest) ToSha3Args ¶ added in v0.8.4
func (req *RpcRequest) ToSha3Args() (*Sha3Args, error)
func (*RpcRequest) ToStorageAtArgs ¶ added in v0.8.4
func (req *RpcRequest) ToStorageAtArgs() (*GetStorageArgs, error)
func (*RpcRequest) ToUninstallFilterArgs ¶ added in v0.8.4
func (req *RpcRequest) ToUninstallFilterArgs() (int, error)
func (*RpcRequest) ToWatchTxArgs ¶ added in v0.8.4
func (req *RpcRequest) ToWatchTxArgs() (string, error)
func (*RpcRequest) ToWhisperFilterArgs ¶ added in v0.8.4
func (req *RpcRequest) ToWhisperFilterArgs() (*xeth.Options, error)
func (*RpcRequest) ToWhisperHasIdentityArgs ¶ added in v0.8.4
func (req *RpcRequest) ToWhisperHasIdentityArgs() (string, error)
func (*RpcRequest) ToWhisperPostArgs ¶ added in v0.8.4
func (req *RpcRequest) ToWhisperPostArgs() (*WhisperMessageArgs, error)
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
Directories ¶
Path | Synopsis |
---|---|
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.
|
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. |
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.
|
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. |
Click to show internal directories.
Click to hide internal directories.