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, eth *eth.Ethereum, 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 GetContractInfoArgs
- type GetDataArgs
- type GetStorageArgs
- type GetStorageAtArgs
- type GetTxCountArgs
- type HashArgs
- type HashIndexArgs
- type HttpGetArgs
- type ImportExportChainArgs
- type LogRes
- type MakeDAGArgs
- type MergedApi
- type MetricsArgs
- type NewAccountArgs
- type NewDataArgs
- type NewSigArgs
- type NewTxArgs
- type ReceiptRes
- type RegisterArgs
- type RegisterUrlArgs
- type ResendArgs
- type SaveInfoArgs
- type SetEtherbaseArgs
- type SetExtraArgs
- type SetGlobalRegistrarArgs
- type SetHashRegArgs
- type SetSolcArgs
- type SetUrlHintArgs
- type Sha3Args
- type SleepArgs
- type SleepBlocksArgs
- 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, "admin_setGlobalRegistrar": (*adminApi).SetGlobalRegistrar, "admin_setHashReg": (*adminApi).SetHashReg, "admin_setUrlHint": (*adminApi).SetUrlHint, "admin_saveInfo": (*adminApi).SaveInfo, "admin_register": (*adminApi).Register, "admin_registerUrl": (*adminApi).RegisterUrl, "admin_startNatSpec": (*adminApi).StartNatSpec, "admin_stopNatSpec": (*adminApi).StopNatSpec, "admin_getContractInfo": (*adminApi).GetContractInfo, "admin_httpGet": (*adminApi).HttpGet, "admin_sleepBlocks": (*adminApi).SleepBlocks, "admin_sleep": (*adminApi).Sleep, } )
View Source
var ( // Mapping between the different methods each api supports AutoCompletion = map[string][]string{ "admin": []string{ "addPeer", "chainSyncStatus", "datadir", "exportChain", "getContractInfo", "importChain", "nodeInfo", "peers", "register", "registerUrl", "setSolc", "sleepBlocks", "startNatSpec", "startRPC", "stopNatSpec", "stopRPC", "verbosity", }, "db": []string{ "getString", "putString", "getHex", "putHex", }, "debug": []string{ "dumpBlock", "getBlockRlp", "metrics", "printBlock", "processBlock", "seedHash", "setHead", }, "eth": []string{ "accounts", "blockNumber", "call", "contract", "coinbase", "compile.lll", "compile.serpent", "compile.solidity", "contract", "defaultAccount", "defaultBlock", "estimateGas", "filter", "getBalance", "getBlock", "getBlockTransactionCount", "getBlockUncleCount", "getCode", "getCompilers", "gasPrice", "getStorageAt", "getTransaction", "getTransactionCount", "getTransactionFromBlock", "getTransactionReceipt", "getUncle", "hashrate", "mining", "namereg", "pendingTransactions", "resend", "sendRawTransaction", "sendTransaction", "sign", }, "miner": []string{ "hashrate", "makeDAG", "setEtherbase", "setExtra", "setGasPrice", "startAutoDAG", "start", "stopAutoDAG", "stop", }, "net": []string{ "peerCount", "listening", }, "personal": []string{ "listAccounts", "newAccount", "deleteAccount", "unlockAccount", }, "shh": []string{ "post", "newIdentify", "hasIdentity", "newGroup", "addToGroup", "filter", }, "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, "debug_metrics": (*debugApi).Metrics, } )
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_setEtherbase": (*minerApi).SetEtherbase, "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 ¶ added in v0.9.32
type CompileArgs struct {
Source string
}
func (*CompileArgs) UnmarshalJSON ¶ added in v0.9.32
func (args *CompileArgs) UnmarshalJSON(b []byte) (err error)
type DbArgs ¶ added in v0.9.32
func (*DbArgs) UnmarshalJSON ¶ added in v0.9.32
type DbHexArgs ¶ added in v0.9.32
func (*DbHexArgs) UnmarshalJSON ¶ added in v0.9.32
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 ¶ added in v0.9.32
type FilterStringArgs struct {
Word string
}
func (*FilterStringArgs) UnmarshalJSON ¶ added in v0.9.32
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 GetContractInfoArgs ¶ added in v0.9.36
type GetContractInfoArgs struct {
Contract string
}
func (*GetContractInfoArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *GetContractInfoArgs) 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 HttpGetArgs ¶ added in v0.9.36
func (*HttpGetArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *HttpGetArgs) 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 MetricsArgs ¶ added in v0.9.36
type MetricsArgs struct {
Raw bool
}
func (*MetricsArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *MetricsArgs) UnmarshalJSON(b []byte) (err error)
type NewAccountArgs ¶
type NewAccountArgs struct {
Passphrase string
}
func (*NewAccountArgs) UnmarshalJSON ¶
func (args *NewAccountArgs) UnmarshalJSON(b []byte) (err error)
type NewDataArgs ¶ added in v0.9.32
type NewDataArgs struct {
Data string
}
func (*NewDataArgs) UnmarshalJSON ¶ added in v0.9.32
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 ReceiptRes ¶ added in v0.9.36
type ReceiptRes struct { TransactionHash *hexdata `json:"transactionHash"` TransactionIndex *hexnum `json:"transactionIndex"` BlockNumber *hexnum `json:"blockNumber"` BlockHash *hexdata `json:"blockHash"` CumulativeGasUsed *hexnum `json:"cumulativeGasUsed"` GasUsed *hexnum `json:"gasUsed"` ContractAddress *hexdata `json:"contractAddress"` Logs *[]interface{} `json:"logs"` }
func NewReceiptRes ¶ added in v0.9.36
func NewReceiptRes(rec *types.Receipt) *ReceiptRes
type RegisterArgs ¶ added in v0.9.36
func (*RegisterArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *RegisterArgs) UnmarshalJSON(b []byte) (err error)
type RegisterUrlArgs ¶ added in v0.9.36
func (*RegisterUrlArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *RegisterUrlArgs) UnmarshalJSON(b []byte) (err error)
type ResendArgs ¶ added in v0.9.36
func (*ResendArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *ResendArgs) UnmarshalJSON(b []byte) (err error)
type SaveInfoArgs ¶ added in v0.9.36
type SaveInfoArgs struct { ContractInfo compiler.ContractInfo Filename string }
func (*SaveInfoArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SaveInfoArgs) UnmarshalJSON(b []byte) (err error)
type SetEtherbaseArgs ¶ added in v0.9.36
func (*SetEtherbaseArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SetEtherbaseArgs) UnmarshalJSON(b []byte) (err error)
type SetExtraArgs ¶
type SetExtraArgs struct {
Data string
}
func (*SetExtraArgs) UnmarshalJSON ¶
func (args *SetExtraArgs) UnmarshalJSON(b []byte) (err error)
type SetGlobalRegistrarArgs ¶ added in v0.9.36
func (*SetGlobalRegistrarArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SetGlobalRegistrarArgs) UnmarshalJSON(b []byte) (err error)
type SetHashRegArgs ¶ added in v0.9.36
func (*SetHashRegArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SetHashRegArgs) UnmarshalJSON(b []byte) (err error)
type SetSolcArgs ¶
type SetSolcArgs struct {
Path string
}
func (*SetSolcArgs) UnmarshalJSON ¶
func (args *SetSolcArgs) UnmarshalJSON(b []byte) (err error)
type SetUrlHintArgs ¶ added in v0.9.36
func (*SetUrlHintArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SetUrlHintArgs) UnmarshalJSON(b []byte) (err error)
type Sha3Args ¶
type Sha3Args struct {
Data string
}
func (*Sha3Args) UnmarshalJSON ¶ added in v0.9.32
type SleepArgs ¶ added in v0.9.36
type SleepArgs struct {
S int
}
func (*SleepArgs) UnmarshalJSON ¶ added in v0.9.36
type SleepBlocksArgs ¶ added in v0.9.36
func (*SleepBlocksArgs) UnmarshalJSON ¶ added in v0.9.36
func (args *SleepBlocksArgs) 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 ¶ added in v0.9.32
func (*StartRPCArgs) UnmarshalJSON ¶ added in v0.9.32
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.