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 ¶
Types ¶
type BalanceRes ¶
type EthereumApi ¶
type EthereumApi struct {
// contains filtered or unexported fields
}
func NewEthereumApi ¶
func NewEthereumApi(eth *xeth.XEth) *EthereumApi
func (*EthereumApi) Accounts ¶
func (p *EthereumApi) Accounts(reply *interface{}) error
func (*EthereumApi) AllLogs ¶
func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error
func (*EthereumApi) BlockNumber ¶
func (p *EthereumApi) BlockNumber(reply *interface{}) error
func (*EthereumApi) Call ¶
func (p *EthereumApi) Call(args *NewTxArgs, reply *interface{}) error
func (*EthereumApi) CompileSerpent ¶
func (p *EthereumApi) CompileSerpent(script string, reply *interface{}) error
func (*EthereumApi) DbGet ¶
func (p *EthereumApi) DbGet(args *DbArgs, reply *interface{}) error
func (*EthereumApi) DbPut ¶
func (p *EthereumApi) DbPut(args *DbArgs, reply *interface{}) error
func (*EthereumApi) FilterChanged ¶
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 ¶
func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error
func (*EthereumApi) GetCoinbase ¶
func (p *EthereumApi) GetCoinbase(reply *interface{}) error
func (*EthereumApi) GetCompilers ¶
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 ¶
func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
func (*EthereumApi) GetStateAt ¶
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 ¶
func (p *EthereumApi) HasWhisperIdentity(args string, reply *interface{}) error
func (*EthereumApi) Logs ¶
func (self *EthereumApi) Logs(id int, reply *interface{}) error
func (*EthereumApi) MessagesChanged ¶
func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error
func (*EthereumApi) NewFilter ¶
func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) error
func (*EthereumApi) NewFilterString ¶
func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error
func (*EthereumApi) NewWhisperFilter ¶
func (p *EthereumApi) NewWhisperFilter(args *xeth.Options, reply *interface{}) error
func (*EthereumApi) NewWhisperIdentity ¶
func (p *EthereumApi) NewWhisperIdentity(reply *interface{}) error
func (*EthereumApi) PushTx ¶
func (p *EthereumApi) PushTx(args *PushTxArgs, reply *interface{}) error
func (*EthereumApi) Register ¶
func (self *EthereumApi) Register(args string, reply *interface{}) error
func (*EthereumApi) SetMining ¶
func (p *EthereumApi) SetMining(shouldmine bool, reply *interface{}) error
func (*EthereumApi) Sha3 ¶
func (p *EthereumApi) Sha3(args *Sha3Args, reply *interface{}) error
func (*EthereumApi) Transact ¶
func (p *EthereumApi) Transact(args *NewTxArgs, reply *interface{}) error
func (*EthereumApi) UninstallFilter ¶
func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error
func (*EthereumApi) Unregister ¶
func (self *EthereumApi) Unregister(args string, reply *interface{}) error
func (*EthereumApi) WatchTx ¶
func (self *EthereumApi) WatchTx(args string, reply *interface{}) error
func (*EthereumApi) WhisperMessages ¶
func (p *EthereumApi) WhisperMessages(id int, reply *interface{}) error
func (*EthereumApi) WhisperPost ¶
func (p *EthereumApi) WhisperPost(args *WhisperMessageArgs, reply *interface{}) error
type FilterChangedArgs ¶
type FilterChangedArgs struct {
// contains filtered or unexported fields
}
type FilterOptions ¶
type GetBalanceArgs ¶
type GetBalanceArgs struct {
Address string
}
func (*GetBalanceArgs) UnmarshalJSON ¶
func (obj *GetBalanceArgs) UnmarshalJSON(b []byte) (err error)
type GetBlockArgs ¶
func (*GetBlockArgs) UnmarshalJSON ¶
func (obj *GetBlockArgs) UnmarshalJSON(b []byte) (err error)
type GetCodeAtArgs ¶
type GetCodeAtArgs struct {
Address string
}
func (*GetCodeAtArgs) UnmarshalJSON ¶
func (obj *GetCodeAtArgs) UnmarshalJSON(b []byte) (err error)
type GetStateArgs ¶
func (*GetStateArgs) UnmarshalJSON ¶
func (obj *GetStateArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageArgs ¶
type GetStorageArgs struct {
Address string
}
func (*GetStorageArgs) UnmarshalJSON ¶
func (obj *GetStorageArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageAtRes ¶
type GetTxCountArgs ¶
type GetTxCountArgs struct {
Address string `json:"address"`
}
func (*GetTxCountArgs) UnmarshalJSON ¶
func (obj *GetTxCountArgs) UnmarshalJSON(b []byte) (err error)
type JsonWrapper ¶
type JsonWrapper struct{}
func (JsonWrapper) ParseRequestBody ¶
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 ¶
type PushTxArgs ¶
type PushTxArgs struct {
Tx string `json:"tx"`
}
func (*PushTxArgs) UnmarshalJSON ¶
func (obj *PushTxArgs) UnmarshalJSON(b []byte) (err error)
type RpcErrorObject ¶
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"` }
func (*RpcRequest) ToBoolArgs ¶
func (req *RpcRequest) ToBoolArgs() (bool, error)
func (*RpcRequest) ToCompileArgs ¶
func (req *RpcRequest) ToCompileArgs() (string, error)
func (*RpcRequest) ToDbGetArgs ¶
func (req *RpcRequest) ToDbGetArgs() (*DbArgs, error)
func (*RpcRequest) ToDbPutArgs ¶
func (req *RpcRequest) ToDbPutArgs() (*DbArgs, error)
func (*RpcRequest) ToFilterArgs ¶
func (req *RpcRequest) ToFilterArgs() (*FilterOptions, error)
func (*RpcRequest) ToFilterChangedArgs ¶
func (req *RpcRequest) ToFilterChangedArgs() (int, error)
func (*RpcRequest) ToFilterStringArgs ¶
func (req *RpcRequest) ToFilterStringArgs() (string, error)
func (*RpcRequest) ToGetBalanceArgs ¶
func (req *RpcRequest) ToGetBalanceArgs() (*GetBalanceArgs, error)
func (*RpcRequest) ToGetBlockArgs ¶
func (req *RpcRequest) ToGetBlockArgs() (*GetBlockArgs, error)
func (*RpcRequest) ToGetCodeAtArgs ¶
func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error)
func (*RpcRequest) ToGetStateArgs ¶
func (req *RpcRequest) ToGetStateArgs() (*GetStateArgs, error)
func (*RpcRequest) ToGetTxCountArgs ¶
func (req *RpcRequest) ToGetTxCountArgs() (*GetTxCountArgs, error)
func (*RpcRequest) ToIdArgs ¶
func (req *RpcRequest) ToIdArgs() (int, error)
func (*RpcRequest) ToNewTxArgs ¶
func (req *RpcRequest) ToNewTxArgs() (*NewTxArgs, error)
func (*RpcRequest) ToPushTxArgs ¶
func (req *RpcRequest) ToPushTxArgs() (*PushTxArgs, error)
func (*RpcRequest) ToRegisterArgs ¶
func (req *RpcRequest) ToRegisterArgs() (string, error)
func (*RpcRequest) ToSha3Args ¶
func (req *RpcRequest) ToSha3Args() (*Sha3Args, error)
func (*RpcRequest) ToStorageAtArgs ¶
func (req *RpcRequest) ToStorageAtArgs() (*GetStorageArgs, error)
func (*RpcRequest) ToUninstallFilterArgs ¶
func (req *RpcRequest) ToUninstallFilterArgs() (int, error)
func (*RpcRequest) ToWatchTxArgs ¶
func (req *RpcRequest) ToWatchTxArgs() (string, error)
func (*RpcRequest) ToWhisperFilterArgs ¶
func (req *RpcRequest) ToWhisperFilterArgs() (*xeth.Options, error)
func (*RpcRequest) ToWhisperHasIdentityArgs ¶
func (req *RpcRequest) ToWhisperHasIdentityArgs() (string, error)
func (*RpcRequest) ToWhisperPostArgs ¶
func (req *RpcRequest) ToWhisperPostArgs() (*WhisperMessageArgs, error)
type RpcSuccessResponse ¶
type RpcSuccessResponse struct { ID interface{} `json:"id"` JsonRpc string `json:"jsonrpc"` Result interface{} `json:"result"` }
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.