Documentation ¶
Index ¶
- Constants
- Variables
- func Javascript(name string) string
- func NewAdminApi(xeth *xeth.XEth, ethereum *eth.Ethereum, coder codec.Codec) *adminApi
- func NewDebugApi(xeth *xeth.XEth, ethereum *eth.Ethereum, coder codec.Codec) *debugApi
- func NewEthApi(xeth *xeth.XEth, codec codec.Codec) *ethApi
- func NewHashesRes(hs []common.Hash) []string
- func NewMinerApi(ethereum *eth.Ethereum, coder codec.Codec) *minerApi
- func NewNetApi(xeth *xeth.XEth, eth *eth.Ethereum, coder codec.Codec) *netApi
- func NewPersonalApi(xeth *xeth.XEth, eth *eth.Ethereum, coder codec.Codec) *personalApi
- func NewShhApi(xeth *xeth.XEth, eth *eth.Ethereum, coder codec.Codec) *shhApi
- func NewTxPoolApi(xeth *xeth.XEth, eth *eth.Ethereum, coder codec.Codec) *txPoolApi
- func NewWeb3Api(xeth *xeth.XEth, coder codec.Codec) *web3Api
- type AddPeerArgs
- type BlockFilterArgs
- type BlockNumArg
- type BlockNumIndexArgs
- type BlockRes
- type CallArgs
- type DeleteAccountArgs
- type EthereumApi
- type FilterIdArgs
- type GasPriceArgs
- type GetBalanceArgs
- type GetBlockByHashArgs
- type GetBlockByNumberArgs
- type GetDataArgs
- type GetStorageArgs
- type GetStorageAtArgs
- type GetTxCountArgs
- type HashArgs
- type HashIndexArgs
- type ImportExportChainArgs
- type LogRes
- type MakeDAGArgs
- type MergedApi
- type NewAccountArgs
- type NewSigArgs
- type NewTxArgs
- type SetExtraArgs
- type SetSolcArgs
- type Sha3Args
- type SourceArgs
- type StartMinerArgs
- type SubmitWorkArgs
- type TransactionRes
- type UncleRes
- type UnlockAccountArgs
- type VerbosityArgs
- type WaitForBlockArgs
- type WhisperFilterArgs
- type WhisperIdentityArgs
- type WhisperMessageArgs
Constants ¶
View Source
const ( AdminApiName = "admin" EthApiName = "eth" DebugApiName = "debug" MergedApiName = "merged" MinerApiName = "miner" NetApiName = "net" ShhApiName = "shh" TxPoolApiName = "txpool" PersonalApiName = "personal" Web3ApiName = "web3" )
View Source
const (
AdminApiversion = "1.0"
)
View Source
const Admin_JS = `` /* 1717-byte string literal not displayed */
View Source
const (
DebugApiVersion = "1.0"
)
View Source
const Debug_JS = `` /* 1387-byte string literal not displayed */
View Source
const (
EthApiVersion = "1.0"
)
View Source
const (
MergedApiVersion = "1.0"
)
View Source
const (
MinerApiVersion = "1.0"
)
View Source
const Miner_JS = `` /* 1677-byte string literal not displayed */
View Source
const (
NetApiVersion = "1.0"
)
View Source
const Net_JS = `` /* 1028-byte string literal not displayed */
View Source
const (
PersonalApiVersion = "1.0"
)
View Source
const Personal_JS = `` /* 769-byte string literal not displayed */
View Source
const (
ShhApiVersion = "1.0"
)
View Source
const Shh_JS = `` /* 636-byte string literal not displayed */
View Source
const (
TxPoolApiVersion = "1.0"
)
View Source
const TxPool_JS = `` /* 209-byte string literal not displayed */
View Source
const (
Web3ApiVersion = "1.0"
)
Variables ¶
View Source
var ( // mapping between methods and handlers AdminMapping = map[string]adminhandler{ "admin_addPeer": (*adminApi).AddPeer, "admin_peers": (*adminApi).Peers, "admin_nodeInfo": (*adminApi).NodeInfo, "admin_exportChain": (*adminApi).ExportChain, "admin_importChain": (*adminApi).ImportChain, "admin_verbosity": (*adminApi).Verbosity, "admin_chainSyncStatus": (*adminApi).ChainSyncStatus, "admin_setSolc": (*adminApi).SetSolc, "admin_datadir": (*adminApi).DataDir, } )
View Source
var ( // Mapping between the different methods each api supports AutoCompletion = map[string][]string{ "admin": []string{ "addPeer", "peers", "nodeInfo", "exportChain", "importChain", "verbosity", "chainSyncStatus", "setSolc", "datadir", }, "debug": []string{ "dumpBlock", "getBlockRlp", "printBlock", "processBlock", "seedHash", "setHead", }, "eth": []string{ "accounts", "blockNumber", "getBalance", "protocolVersion", "coinbase", "mining", "gasPrice", "getStorage", "storageAt", "getStorageAt", "getTransactionCount", "getBlockTransactionCountByHash", "getBlockTransactionCountByNumber", "getUncleCountByBlockHash", "getUncleCountByBlockNumber", "getData", "getCode", "sign", "sendTransaction", "transact", "estimateGas", "call", "flush", "getBlockByHash", "getBlockByNumber", "getTransactionByHash", "getTransactionByBlockHashAndIndex", "getUncleByBlockHashAndIndex", "getUncleByBlockNumberAndIndex", "getCompilers", "compileSolidity", "newFilter", "newBlockFilter", "newPendingTransactionFilter", "uninstallFilter", "getFilterChanges", "getFilterLogs", "getLogs", "hashrate", "getWork", "submitWork", }, "miner": []string{ "hashrate", "makeDAG", "setExtra", "setGasPrice", "startAutoDAG", "start", "stopAutoDAG", "stop", }, "net": []string{ "peerCount", "listening", }, "personal": []string{ "listAccounts", "newAccount", "deleteAccount", "unlockAccount", }, "shh": []string{ "version", "post", "hasIdentity", "newIdentity", "newFilter", "uninstallFilter", "getFilterChanges", }, "txpool": []string{ "status", }, "web3": []string{ "sha3", "version", "fromWei", "toWei", "toHex", "toAscii", "fromAscii", "toBigNumber", "isAddress", }, } )
View Source
var ( // mapping between methods and handlers DebugMapping = map[string]debughandler{ "debug_dumpBlock": (*debugApi).DumpBlock, "debug_getBlockRlp": (*debugApi).GetBlockRlp, "debug_printBlock": (*debugApi).PrintBlock, "debug_processBlock": (*debugApi).ProcessBlock, "debug_seedHash": (*debugApi).SeedHash, "debug_setHead": (*debugApi).SetHead, } )
View Source
var ( // List with all API's which are offered over the IPC interface by default DefaultIpcApis = strings.Join([]string{ AdminApiName, EthApiName, DebugApiName, MinerApiName, NetApiName, ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName, }, ",") )
View Source
var ( // mapping between methods and handlers MinerMapping = map[string]minerhandler{ "miner_hashrate": (*minerApi).Hashrate, "miner_makeDAG": (*minerApi).MakeDAG, "miner_setExtra": (*minerApi).SetExtra, "miner_setGasPrice": (*minerApi).SetGasPrice, "miner_startAutoDAG": (*minerApi).StartAutoDAG, "miner_start": (*minerApi).StartMiner, "miner_stopAutoDAG": (*minerApi).StopAutoDAG, "miner_stop": (*minerApi).StopMiner, } )
View Source
var ( // mapping between methods and handlers Web3Mapping = map[string]web3handler{ "web3_sha3": (*web3Api).Sha3, "web3_clientVersion": (*web3Api).ClientVersion, } )
Functions ¶
func Javascript ¶
func NewAdminApi ¶
create a new admin api instance
func NewDebugApi ¶
create a new debug api instance
func NewHashesRes ¶
func NewMinerApi ¶
create a new miner api instance
func NewPersonalApi ¶
create a new net api instance
func NewTxPoolApi ¶
create a new txpool api instance
Types ¶
type AddPeerArgs ¶
type AddPeerArgs struct {
Url string
}
func (*AddPeerArgs) UnmarshalJSON ¶
func (args *AddPeerArgs) UnmarshalJSON(b []byte) (err error)
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 ¶
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 (*BlockRes) MarshalJSON ¶
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 ¶
type DeleteAccountArgs ¶
func (*DeleteAccountArgs) UnmarshalJSON ¶
func (args *DeleteAccountArgs) UnmarshalJSON(b []byte) (err error)
type EthereumApi ¶
type EthereumApi interface { // API identifier Name() string // API version ApiVersion() string // Execute the given request and returns the response or an error Execute(*shared.Request) (interface{}, error) // List of supported RCP methods this API provides Methods() []string }
Ethereum RPC API interface
func Merge ¶
func Merge(apis ...EthereumApi) EthereumApi
Merge multiple API's to a single API instance
type FilterIdArgs ¶
type FilterIdArgs struct {
Id int
}
func (*FilterIdArgs) UnmarshalJSON ¶
func (args *FilterIdArgs) UnmarshalJSON(b []byte) (err error)
type GasPriceArgs ¶
type GasPriceArgs struct {
Price string
}
func (*GasPriceArgs) UnmarshalJSON ¶
func (args *GasPriceArgs) UnmarshalJSON(b []byte) (err error)
type GetBalanceArgs ¶
func (*GetBalanceArgs) UnmarshalJSON ¶
func (args *GetBalanceArgs) UnmarshalJSON(b []byte) (err error)
type GetBlockByHashArgs ¶
func (*GetBlockByHashArgs) UnmarshalJSON ¶
func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error)
type GetBlockByNumberArgs ¶
func (*GetBlockByNumberArgs) UnmarshalJSON ¶
func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error)
type GetDataArgs ¶
func (*GetDataArgs) UnmarshalJSON ¶
func (args *GetDataArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageArgs ¶
func (*GetStorageArgs) UnmarshalJSON ¶
func (args *GetStorageArgs) UnmarshalJSON(b []byte) (err error)
type GetStorageAtArgs ¶
func (*GetStorageAtArgs) UnmarshalJSON ¶
func (args *GetStorageAtArgs) UnmarshalJSON(b []byte) (err error)
type GetTxCountArgs ¶
func (*GetTxCountArgs) UnmarshalJSON ¶
func (args *GetTxCountArgs) UnmarshalJSON(b []byte) (err error)
type HashIndexArgs ¶
func (*HashIndexArgs) UnmarshalJSON ¶
func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error)
type ImportExportChainArgs ¶
type ImportExportChainArgs struct {
Filename string
}
func (*ImportExportChainArgs) UnmarshalJSON ¶
func (args *ImportExportChainArgs) UnmarshalJSON(b []byte) (err error)
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 NewLogsRes ¶
type MakeDAGArgs ¶
type MakeDAGArgs struct {
BlockNumber int64
}
func (*MakeDAGArgs) UnmarshalJSON ¶
func (args *MakeDAGArgs) UnmarshalJSON(b []byte) (err error)
type MergedApi ¶
type MergedApi struct {
// contains filtered or unexported fields
}
combines multiple API's
func (*MergedApi) ApiVersion ¶
type NewAccountArgs ¶
type NewAccountArgs struct {
Passphrase string
}
func (*NewAccountArgs) UnmarshalJSON ¶
func (args *NewAccountArgs) UnmarshalJSON(b []byte) (err error)
type NewSigArgs ¶
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 ¶
type SetExtraArgs ¶
type SetExtraArgs struct {
Data string
}
func (*SetExtraArgs) UnmarshalJSON ¶
func (args *SetExtraArgs) UnmarshalJSON(b []byte) (err error)
type SetSolcArgs ¶
type SetSolcArgs struct {
Path string
}
func (*SetSolcArgs) UnmarshalJSON ¶
func (args *SetSolcArgs) UnmarshalJSON(b []byte) (err error)
type SourceArgs ¶
type SourceArgs struct {
Source string
}
func (*SourceArgs) UnmarshalJSON ¶
func (args *SourceArgs) UnmarshalJSON(b []byte) (err error)
type StartMinerArgs ¶
type StartMinerArgs struct {
Threads int
}
func (*StartMinerArgs) UnmarshalJSON ¶
func (args *StartMinerArgs) UnmarshalJSON(b []byte) (err error)
type SubmitWorkArgs ¶
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 ¶
type UnlockAccountArgs ¶
func (*UnlockAccountArgs) UnmarshalJSON ¶
func (args *UnlockAccountArgs) UnmarshalJSON(b []byte) (err error)
type VerbosityArgs ¶
type VerbosityArgs struct {
Level int
}
func (*VerbosityArgs) UnmarshalJSON ¶
func (args *VerbosityArgs) UnmarshalJSON(b []byte) (err error)
type WaitForBlockArgs ¶
func (*WaitForBlockArgs) UnmarshalJSON ¶
func (args *WaitForBlockArgs) UnmarshalJSON(b []byte) (err error)
type WhisperFilterArgs ¶
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)
Source Files ¶
- admin.go
- admin_args.go
- admin_js.go
- api.go
- debug.go
- debug_args.go
- debug_js.go
- eth.go
- eth_args.go
- eth_js.go
- mergedapi.go
- mergedapi_js.go
- miner.go
- miner_args.go
- miner_js.go
- net.go
- net_js.go
- parsing.go
- personal.go
- personal_args.go
- personal_js.go
- shh.go
- shh_args.go
- ssh_js.go
- txpool.go
- txpool_js.go
- utils.go
- web3.go
- web3_args.go
Click to show internal directories.
Click to hide internal directories.