Documentation ¶
Index ¶
- Constants
- Variables
- func Javascript(name string) string
- func Merge(apis ...shared.EthereumApi) shared.EthereumApi
- func NewAdminApi(xeth *xeth.XEth, ethereum *eth.Ethereum, codec codec.Codec) *adminApi
- func NewDbApi(xeth *xeth.XEth, ethereum *eth.Ethereum, coder codec.Codec) *dbApi
- 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
- func ParseApiString(apistr string, codec codec.Codec, xeth *xeth.XEth, eth *eth.Ethereum) ([]shared.EthereumApi, error)
- type AddPeerArgs
- type BlockFilterArgs
- type BlockNumArg
- type BlockNumIndexArgs
- type BlockRes
- type CallArgs
- type CompileArgs
- type DbArgs
- type DbHexArgs
- type DeleteAccountArgs
- type FilterIdArgs
- type FilterStringArgs
- 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 NewDataArgs
- type NewSigArgs
- type NewTxArgs
- type SetExtraArgs
- type SetSolcArgs
- type Sha3Args
- type SourceArgs
- type StartMinerArgs
- type StartRPCArgs
- type SubmitWorkArgs
- type TransactionRes
- type UncleRes
- type UnlockAccountArgs
- type VerbosityArgs
- type WaitForBlockArgs
- type WhisperFilterArgs
- type WhisperIdentityArgs
- type WhisperMessageArgs
Constants ¶
View Source
const (
AdminApiversion = "1.0"
)
View Source
const (
DbApiversion = "1.0"
)
View Source
const (
DebugApiVersion = "1.0"
)
View Source
const (
EthApiVersion = "1.0"
)
View Source
const (
MergedApiVersion = "1.0"
)
View Source
const (
MinerApiVersion = "1.0"
)
View Source
const (
NetApiVersion = "1.0"
)
View Source
const (
PersonalApiVersion = "1.0"
)
View Source
const (
ShhApiVersion = "1.0"
)
View Source
const (
TxPoolApiVersion = "1.0"
)
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, "admin_startRPC": (*adminApi).StartRPC, "admin_stopRPC": (*adminApi).StopRPC, } )
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", "startRPC", "stopRPC", }, "db": []string{ "getString", "putString", "getHex", "putHex", }, "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", "sendRawTransaction", "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 DbMapping = map[string]dbhandler{ "db_getString": (*dbApi).GetString, "db_putString": (*dbApi).PutString, "db_getHex": (*dbApi).GetHex, "db_putHex": (*dbApi).PutHex, } )
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 ( // 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 Merge ¶
func Merge(apis ...shared.EthereumApi) shared.EthereumApi
Merge multiple API's to a single API instance
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
func NewWeb3Api ¶
create a new web3 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 CompileArgs ¶
type CompileArgs struct {
Source string
}
func (*CompileArgs) UnmarshalJSON ¶
func (args *CompileArgs) UnmarshalJSON(b []byte) (err error)
type DbArgs ¶
func (*DbArgs) UnmarshalJSON ¶
type DbHexArgs ¶
func (*DbHexArgs) UnmarshalJSON ¶
type DeleteAccountArgs ¶
func (*DeleteAccountArgs) UnmarshalJSON ¶
func (args *DeleteAccountArgs) UnmarshalJSON(b []byte) (err 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 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 NewDataArgs ¶
type NewDataArgs struct {
Data string
}
func (*NewDataArgs) UnmarshalJSON ¶
func (args *NewDataArgs) 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 StartRPCArgs ¶
func (*StartRPCArgs) UnmarshalJSON ¶
func (args *StartRPCArgs) 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)
Click to show internal directories.
Click to hide internal directories.