geth

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: LGPL-3.0 Imports: 57 Imported by: 0

Documentation

Overview

geth is the official command-line client for Ethereum.

Index

Constants

This section is empty.

Variables

View Source
var (

	// The App that holds all commands and flags.
	App = utils.NewApp(gitCommit, gitDate, "the go-ethereum command line interface")
)
View Source
var AppHelpFlagGroups = []flagGroup{
	{
		Name: "ETHEREUM",
		Flags: []cli.Flag{
			configFileFlag,
			utils.DataDirFlag,
			utils.AncientFlag,
			utils.KeyStoreDirFlag,
			utils.NoUSBFlag,
			utils.SmartCardDaemonPathFlag,
			utils.NetworkIdFlag,
			utils.TestnetFlag,
			utils.RinkebyFlag,
			utils.GoerliFlag,
			utils.SyncModeFlag,
			utils.ExitWhenSyncedFlag,
			utils.GCModeFlag,
			utils.EthStatsURLFlag,
			utils.IdentityFlag,
			utils.LightKDFFlag,
			utils.WhitelistFlag,
		},
	},
	{
		Name: "LIGHT CLIENT",
		Flags: []cli.Flag{
			utils.LightServeFlag,
			utils.LightIngressFlag,
			utils.LightEgressFlag,
			utils.LightMaxPeersFlag,
			utils.UltraLightServersFlag,
			utils.UltraLightFractionFlag,
			utils.UltraLightOnlyAnnounceFlag,
		},
	},
	{
		Name: "DEVELOPER CHAIN",
		Flags: []cli.Flag{
			utils.DeveloperFlag,
			utils.DeveloperPeriodFlag,
		},
	},
	{
		Name: "ETHASH",
		Flags: []cli.Flag{
			utils.EthashCacheDirFlag,
			utils.EthashCachesInMemoryFlag,
			utils.EthashCachesOnDiskFlag,
			utils.EthashDatasetDirFlag,
			utils.EthashDatasetsInMemoryFlag,
			utils.EthashDatasetsOnDiskFlag,
		},
	},

	{
		Name: "TRANSACTION POOL",
		Flags: []cli.Flag{
			utils.TxPoolLocalsFlag,
			utils.TxPoolNoLocalsFlag,
			utils.TxPoolJournalFlag,
			utils.TxPoolRejournalFlag,
			utils.TxPoolPriceLimitFlag,
			utils.TxPoolPriceBumpFlag,
			utils.TxPoolAccountSlotsFlag,
			utils.TxPoolGlobalSlotsFlag,
			utils.TxPoolAccountQueueFlag,
			utils.TxPoolGlobalQueueFlag,
			utils.TxPoolLifetimeFlag,
		},
	},
	{
		Name: "PERFORMANCE TUNING",
		Flags: []cli.Flag{
			utils.CacheFlag,
			utils.CacheDatabaseFlag,
			utils.CacheTrieFlag,
			utils.CacheGCFlag,
			utils.CacheNoPrefetchFlag,
		},
	},
	{
		Name: "ACCOUNT",
		Flags: []cli.Flag{
			utils.UnlockedAccountFlag,
			utils.PasswordFileFlag,
			utils.ExternalSignerFlag,
			utils.InsecureUnlockAllowedFlag,
		},
	},
	{
		Name: "API AND CONSOLE",
		Flags: []cli.Flag{
			utils.IPCDisabledFlag,
			utils.IPCPathFlag,
			utils.RPCEnabledFlag,
			utils.RPCListenAddrFlag,
			utils.RPCPortFlag,
			utils.RPCApiFlag,
			utils.RPCGlobalGasCap,
			utils.RPCCORSDomainFlag,
			utils.RPCVirtualHostsFlag,
			utils.WSEnabledFlag,
			utils.WSListenAddrFlag,
			utils.WSPortFlag,
			utils.WSApiFlag,
			utils.WSAllowedOriginsFlag,
			utils.GraphQLEnabledFlag,
			utils.GraphQLListenAddrFlag,
			utils.GraphQLPortFlag,
			utils.GraphQLCORSDomainFlag,
			utils.GraphQLVirtualHostsFlag,
			utils.JSpathFlag,
			utils.ExecFlag,
			utils.PreloadJSFlag,
		},
	},
	{
		Name: "NETWORKING",
		Flags: []cli.Flag{
			utils.BootnodesFlag,
			utils.BootnodesV4Flag,
			utils.BootnodesV5Flag,
			utils.ListenPortFlag,
			utils.MaxPeersFlag,
			utils.MaxPendingPeersFlag,
			utils.NATFlag,
			utils.NoDiscoverFlag,
			utils.DiscoveryV5Flag,
			utils.NetrestrictFlag,
			utils.NodeKeyFileFlag,
			utils.NodeKeyHexFlag,
		},
	},
	{
		Name: "MINER",
		Flags: []cli.Flag{
			utils.MiningEnabledFlag,
			utils.MinerThreadsFlag,
			utils.MinerNotifyFlag,
			utils.MinerGasPriceFlag,
			utils.MinerGasTargetFlag,
			utils.MinerGasLimitFlag,
			utils.MinerEtherbaseFlag,
			utils.MinerExtraDataFlag,
			utils.MinerRecommitIntervalFlag,
			utils.MinerNoVerfiyFlag,
		},
	},
	{
		Name: "GAS PRICE ORACLE",
		Flags: []cli.Flag{
			utils.GpoBlocksFlag,
			utils.GpoPercentileFlag,
		},
	},
	{
		Name: "VIRTUAL MACHINE",
		Flags: []cli.Flag{
			utils.VMEnableDebugFlag,
			utils.EVMInterpreterFlag,
			utils.EWASMInterpreterFlag,
		},
	},
	{
		Name: "LOGGING AND DEBUGGING",
		Flags: append([]cli.Flag{
			utils.FakePoWFlag,
			utils.NoCompactionFlag,
		}, debug.Flags...),
	},
	{
		Name:  "METRICS AND STATS",
		Flags: metricsFlags,
	},
	{
		Name:  "WHISPER (EXPERIMENTAL)",
		Flags: whisperFlags,
	},
	{
		Name: "DEPRECATED",
		Flags: []cli.Flag{
			utils.LightLegacyServFlag,
			utils.LightLegacyPeersFlag,
			utils.MinerLegacyThreadsFlag,
			utils.MinerLegacyGasTargetFlag,
			utils.MinerLegacyGasPriceFlag,
			utils.MinerLegacyEtherbaseFlag,
			utils.MinerLegacyExtraDataFlag,
		},
	},
	{
		Name: "MISC",
	},
}

AppHelpFlagGroups is the application flags, grouped by functionality.

View Source
var AppHelpTemplate = `` /* 685-byte string literal not displayed */

AppHelpTemplate is the test template for the default, global app help topic.

Functions

func RPCMarshalBlock

func RPCMarshalBlock(b *types.Block, inclTx bool, fullTx bool) (map[string]interface{}, error)

RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are returned. When fullTx is true the returned block contains full transaction details, otherwise it will only contain transaction hashes.

Types

type AccountRangeResult

type AccountRangeResult struct {
	AddressMap map[common.Hash]common.Address `json:"addressMap"`
	NextKey    common.Hash                    `json:"nextKey"`
}

type CPAPrecompiledLinear

type CPAPrecompiledLinear struct {
	Base uint64 `json:"base"`
	Word uint64 `json:"word"`
}

type CPAccountPrecompiled

type CPAccountPrecompiled struct {
	Name          string                `json:"name"`
	StartingBlock math.HexOrDecimal64   `json:"startingBlock"`
	Linear        *CPAPrecompiledLinear `json:"linear"`
}

type CParamsAccount

type CParamsAccount struct {
	Balance     *math.HexOrDecimal256 `json:"balance"`
	Precompiled *CPAccountPrecompiled `json:"precompiled"`
	Code        hexutil.Bytes         `json:"code"`
	Storage     map[string]string     `json:"storage"`
	Nonce       *math.HexOrDecimal64  `json:"nonce"`
}

type CParamsGenesis

type CParamsGenesis struct {
	Nonce      math.HexOrDecimal64   `json:"nonce"`
	Difficulty *math.HexOrDecimal256 `json:"difficulty"`
	MixHash    *math.HexOrDecimal256 `json:"mixHash"`
	Author     common.Address        `json:"author"`
	Timestamp  math.HexOrDecimal64   `json:"timestamp"`
	ParentHash common.Hash           `json:"parentHash"`
	ExtraData  hexutil.Bytes         `json:"extraData"`
	GasLimit   math.HexOrDecimal64   `json:"gasLimit"`
}

type CParamsParams

type CParamsParams struct {
	AccountStartNonce          math.HexOrDecimal64   `json:"accountStartNonce"`
	HomesteadForkBlock         *math.HexOrDecimal64  `json:"homesteadForkBlock"`
	EIP150ForkBlock            *math.HexOrDecimal64  `json:"EIP150ForkBlock"`
	EIP158ForkBlock            *math.HexOrDecimal64  `json:"EIP158ForkBlock"`
	DaoHardforkBlock           *math.HexOrDecimal64  `json:"daoHardforkBlock"`
	ByzantiumForkBlock         *math.HexOrDecimal64  `json:"byzantiumForkBlock"`
	ConstantinopleForkBlock    *math.HexOrDecimal64  `json:"constantinopleForkBlock"`
	ConstantinopleFixForkBlock *math.HexOrDecimal64  `json:"constantinopleFixForkBlock"`
	ChainID                    *math.HexOrDecimal256 `json:"chainID"`
	MaximumExtraDataSize       math.HexOrDecimal64   `json:"maximumExtraDataSize"`
	TieBreakingGas             bool                  `json:"tieBreakingGas"`
	MinGasLimit                math.HexOrDecimal64   `json:"minGasLimit"`
	MaxGasLimit                math.HexOrDecimal64   `json:"maxGasLimit"`
	GasLimitBoundDivisor       math.HexOrDecimal64   `json:"gasLimitBoundDivisor"`
	MinimumDifficulty          math.HexOrDecimal256  `json:"minimumDifficulty"`
	DifficultyBoundDivisor     math.HexOrDecimal256  `json:"difficultyBoundDivisor"`
	DurationLimit              math.HexOrDecimal256  `json:"durationLimit"`
	BlockReward                math.HexOrDecimal256  `json:"blockReward"`
	NetworkID                  math.HexOrDecimal256  `json:"networkID"`
}

type ChainParams

type ChainParams struct {
	SealEngine string                            `json:"sealEngine"`
	Params     CParamsParams                     `json:"params"`
	Genesis    CParamsGenesis                    `json:"genesis"`
	Accounts   map[common.Address]CParamsAccount `json:"accounts"`
}

type NoRewardEngine

type NoRewardEngine struct {
	// contains filtered or unexported fields
}

func (*NoRewardEngine) APIs

func (e *NoRewardEngine) APIs(chain consensus.ChainReader) []rpc.API

func (*NoRewardEngine) Author

func (e *NoRewardEngine) Author(header *types.Header) (common.Address, error)

func (*NoRewardEngine) CalcDifficulty

func (e *NoRewardEngine) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

func (*NoRewardEngine) Close

func (e *NoRewardEngine) Close() error

func (*NoRewardEngine) Finalize

func (e *NoRewardEngine) Finalize(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB, txs []*types.Transaction,
	uncles []*types.Header)

func (*NoRewardEngine) FinalizeAndAssemble

func (e *NoRewardEngine) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB, txs []*types.Transaction,
	uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error)

func (*NoRewardEngine) Prepare

func (e *NoRewardEngine) Prepare(chain consensus.ChainReader, header *types.Header) error

func (*NoRewardEngine) Seal

func (e *NoRewardEngine) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

func (*NoRewardEngine) SealHash

func (e *NoRewardEngine) SealHash(header *types.Header) common.Hash

func (*NoRewardEngine) VerifyHeader

func (e *NoRewardEngine) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

func (*NoRewardEngine) VerifyHeaders

func (e *NoRewardEngine) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

func (*NoRewardEngine) VerifySeal

func (e *NoRewardEngine) VerifySeal(chain consensus.ChainReader, header *types.Header) error

func (*NoRewardEngine) VerifyUncles

func (e *NoRewardEngine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

type RPCTransaction

type RPCTransaction struct {
	BlockHash        common.Hash     `json:"blockHash"`
	BlockNumber      *hexutil.Big    `json:"blockNumber"`
	From             common.Address  `json:"from"`
	Gas              hexutil.Uint64  `json:"gas"`
	GasPrice         *hexutil.Big    `json:"gasPrice"`
	Hash             common.Hash     `json:"hash"`
	Input            hexutil.Bytes   `json:"input"`
	Nonce            hexutil.Uint64  `json:"nonce"`
	To               *common.Address `json:"to"`
	TransactionIndex hexutil.Uint    `json:"transactionIndex"`
	Value            *hexutil.Big    `json:"value"`
	V                *hexutil.Big    `json:"v"`
	R                *hexutil.Big    `json:"r"`
	S                *hexutil.Big    `json:"s"`
}

RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction

type RetestWeb3API

type RetestWeb3API interface {
	ClientVersion(ctx context.Context) (string, error)
}

type RetestethAPI

type RetestethAPI struct {
	// contains filtered or unexported fields
}

func (*RetestethAPI) AccountRange

func (api *RetestethAPI) AccountRange(ctx context.Context,
	blockHashOrNumber *math.HexOrDecimal256, txIndex uint64,
	addressHash *math.HexOrDecimal256, maxResults uint64,
) (AccountRangeResult, error)

func (*RetestethAPI) BlockNumber

func (api *RetestethAPI) BlockNumber(ctx context.Context) (uint64, error)

func (*RetestethAPI) ClientVersion

func (api *RetestethAPI) ClientVersion(ctx context.Context) (string, error)

func (*RetestethAPI) GetBalance

func (api *RetestethAPI) GetBalance(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (*math.HexOrDecimal256, error)

func (*RetestethAPI) GetBlockByNumber

func (api *RetestethAPI) GetBlockByNumber(ctx context.Context, blockNr math.HexOrDecimal64, fullTx bool) (map[string]interface{}, error)

func (*RetestethAPI) GetCode

func (api *RetestethAPI) GetCode(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (hexutil.Bytes, error)

func (*RetestethAPI) GetLogHash

func (api *RetestethAPI) GetLogHash(ctx context.Context, txHash common.Hash) (common.Hash, error)

func (*RetestethAPI) GetTransactionCount

func (api *RetestethAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (uint64, error)

func (*RetestethAPI) ImportRawBlock

func (api *RetestethAPI) ImportRawBlock(ctx context.Context, rawBlock hexutil.Bytes) (common.Hash, error)

func (*RetestethAPI) MineBlocks

func (api *RetestethAPI) MineBlocks(ctx context.Context, number uint64) (bool, error)

func (*RetestethAPI) ModifyTimestamp

func (api *RetestethAPI) ModifyTimestamp(ctx context.Context, interval uint64) (bool, error)

func (*RetestethAPI) RewindToBlock

func (api *RetestethAPI) RewindToBlock(ctx context.Context, newHead uint64) (bool, error)

func (*RetestethAPI) SendRawTransaction

func (api *RetestethAPI) SendRawTransaction(ctx context.Context, rawTx hexutil.Bytes) (common.Hash, error)

func (*RetestethAPI) SetChainParams

func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainParams) (bool, error)

func (*RetestethAPI) StorageRangeAt

func (api *RetestethAPI) StorageRangeAt(ctx context.Context,
	blockHashOrNumber *math.HexOrDecimal256, txIndex uint64,
	address common.Address,
	begin *math.HexOrDecimal256, maxResults uint64,
) (StorageRangeResult, error)

type RetestethDebugAPI

type RetestethDebugAPI interface {
	AccountRange(ctx context.Context,
		blockHashOrNumber *math.HexOrDecimal256, txIndex uint64,
		addressHash *math.HexOrDecimal256, maxResults uint64,
	) (AccountRangeResult, error)
	StorageRangeAt(ctx context.Context,
		blockHashOrNumber *math.HexOrDecimal256, txIndex uint64,
		address common.Address,
		begin *math.HexOrDecimal256, maxResults uint64,
	) (StorageRangeResult, error)
}

type RetestethEthAPI

type RetestethEthAPI interface {
	SendRawTransaction(ctx context.Context, rawTx hexutil.Bytes) (common.Hash, error)
	BlockNumber(ctx context.Context) (uint64, error)
	GetBlockByNumber(ctx context.Context, blockNr math.HexOrDecimal64, fullTx bool) (map[string]interface{}, error)
	GetBalance(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (*math.HexOrDecimal256, error)
	GetCode(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (hexutil.Bytes, error)
	GetTransactionCount(ctx context.Context, address common.Address, blockNr math.HexOrDecimal64) (uint64, error)
}

type RetestethTestAPI

type RetestethTestAPI interface {
	SetChainParams(ctx context.Context, chainParams ChainParams) (bool, error)
	MineBlocks(ctx context.Context, number uint64) (bool, error)
	ModifyTimestamp(ctx context.Context, interval uint64) (bool, error)
	ImportRawBlock(ctx context.Context, rawBlock hexutil.Bytes) (common.Hash, error)
	RewindToBlock(ctx context.Context, number uint64) (bool, error)
	GetLogHash(ctx context.Context, txHash common.Hash) (common.Hash, error)
}

type SRItem

type SRItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type StorageRangeResult

type StorageRangeResult struct {
	Complete bool                   `json:"complete"`
	Storage  map[common.Hash]SRItem `json:"storage"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL