Documentation ¶
Overview ¶
Package geth implements the wrapper around to go-ethereum client
Index ¶
Constants ¶
const ( NodeName = "Geth/EtherAPIs" // Client name to advertise on the Ethereum network NodeVersion = "0.0.1" // Client version to advertise on the Ethereum network NodePort = 30303 // Listener port of the Ethereum P2P network NodeMaxPeers = 25 // Maximum number of peers connections to accept )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a Go wrapper around the JSON RPC API exposed by a Geth node.
In theory implements:
- https://github.com/ethereum/wiki/wiki/JSON-RPC
- https://github.com/ethereum/go-ethereum/wiki/Go-ethereum-management-API's
In practice it implements the bare essentials needed for this hackathon :D
func (*API) BlockNumber ¶
BlockNumber retrieves the current head number of the blockchain.
func (*API) GetBlockTime ¶
GetBlockTime retrieves the block of the given number from the canonical chain.
func (*API) Syncing ¶
func (api *API) Syncing() (*SyncStatus, error)
Syncing returns the current sync status of the node, or nil if the node is not currently synchronizing with the network.
type EthereumNetwork ¶
type EthereumNetwork int
EthereumNetwork is the variant of the Ethereum network to join.
const ( MainNet EthereumNetwork = 0 // Frontier live network TestNet = 2 // Morden test network )
type Geth ¶
type Geth struct {
// contains filtered or unexported fields
}
Geth is a wrapper around the Ethereum Go client.
func New ¶
func New(datadir string, network EthereumNetwork) (*Geth, error)
New creates a Ethereum client, pre-configured to one of the supported networks.
func (*Geth) Attach ¶
Attach connects to the running node's IPC exposed APIs, and returns an Go API interface.
func (*Geth) Keystore ¶
Keystore is a quick hack to expose the internal Ethereum keystore. We should
remove this after the API interface is implemented, but until then it makes
things simpler.
func (*Geth) Stack ¶
Stack is a quick hack to expose the internal Ethereum node implementation. We should probably remove this after the API interface is implemented, but until then it makes things simpler.
type SyncStatus ¶
SyncStatus is the current state the network sync is in.