definitions

package
v0.12.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2016 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

type Accounts interface {
	GenPrivAccount() (*account.PrivAccount, error)
	GenPrivAccountFromKey(privKey []byte) (*account.PrivAccount, error)
	Accounts([]*event.FilterData) (*types.AccountList, error)
	Account(address []byte) (*account.Account, error)
	Storage(address []byte) (*types.Storage, error)
	StorageAt(address, key []byte) (*types.StorageItem, error)
}

type ClientDo

type ClientDo struct {
	// Persistent flags not reflected in the configuration files
	// only set through command line flags or environment variables
	Debug   bool // ERIS_DB_DEBUG
	Verbose bool // ERIS_DB_VERBOSE

	// Following parameters are global flags for eris-client tx
	SignAddrFlag string
	NodeAddrFlag string
	PubkeyFlag   string
	AddrFlag     string
	ChainidFlag  string

	// signFlag      bool // TODO: remove; unsafe signing without eris-keys
	BroadcastFlag bool
	WaitFlag      bool

	// Following parameters are vary for different Transaction subcommands
	// some of these are strings rather than flags because the `core`
	// functions have a pure string interface so they work nicely from http
	AmtFlag      string
	NonceFlag    string
	NameFlag     string
	DataFlag     string
	DataFileFlag string
	ToFlag       string
	FeeFlag      string
	GasFlag      string
	UnbondtoFlag string
	HeightFlag   string
}

func NewClientDo

func NewClientDo() *ClientDo

type Do

type Do struct {
	// Persistent flags not reflected in the configuration files
	// only set through command line flags or environment variables
	Debug   bool // ERIS_DB_DEBUG
	Verbose bool // ERIS_DB_VERBOSE

	// Work directory is the root directory for Eris-DB to act in
	WorkDir string // ERIS_DB_WORKDIR
	// Data directory is defaulted to WorkDir + `/data`.
	// If Eris-CLI maps a data container, DataDir is intended to point
	// to that mapped data directory.
	DataDir string // ERIS_DB_DATADIR

	// Capital configuration options explicitly extracted from the Viper config
	ChainId string // has to be set to non-empty string,
	// uniquely identifying the chain.
	GenesisFile string
	// ChainType    string
	// CSV          string
	// AccountTypes []string
	// Zip          bool
	// Tarball      bool
	DisableRpc bool
	Config     *viper.Viper
}

func NewDo

func NewDo() *Do

func (*Do) InitialiseDataDirectory

func (d *Do) InitialiseDataDirectory() error

InitialiseDataDirectory will default to WorkDir/data if DataDir is empty

func (*Do) ReadConfig

func (d *Do) ReadConfig(directory string, name string, configType string) error

ReadConfig uses Viper to set the configuration file name, file format where Eris-DB currently only uses `toml`. The search directory is explicitly limited to a single location to minimise the chance of loading the wrong configuration file.

type NameReg

type NameReg interface {
	Entry(key string) (*core_types.NameRegEntry, error)
	Entries([]*event.FilterData) (*types.ResultListNames, error)
}

type Pipe

type Pipe interface {
	Accounts() Accounts
	Blockchain() blockchain_types.Blockchain
	Events() event.EventEmitter
	NameReg() NameReg
	Transactor() Transactor
	// Hash of Genesis state
	GenesisHash() []byte
	// NOTE: [ben] added to Pipe interface on 0.12 refactor
	GetApplication() manager_types.Application
	SetConsensusEngine(consensusEngine consensus_types.ConsensusEngine) error
	GetConsensusEngine() consensus_types.ConsensusEngine
	SetBlockchain(blockchain blockchain_types.Blockchain) error
	GetBlockchain() blockchain_types.Blockchain
	// Support for Tendermint RPC
	GetTendermintPipe() (TendermintPipe, error)
}

type TendermintPipe

type TendermintPipe interface {
	Pipe
	// Events
	// Subscribe attempts to subscribe the listener identified by listenerId to
	// the event named event. The Event result is written to rpcResponseWriter
	// which must be non-blocking
	Subscribe(event string,
		rpcResponseWriter func(result rpc_tm_types.ErisDBResult)) (*rpc_tm_types.ResultSubscribe, error)
	Unsubscribe(subscriptionId string) (*rpc_tm_types.ResultUnsubscribe, error)

	// Net
	Status() (*rpc_tm_types.ResultStatus, error)
	NetInfo() (*rpc_tm_types.ResultNetInfo, error)
	Genesis() (*rpc_tm_types.ResultGenesis, error)
	ChainId() (*rpc_tm_types.ResultChainId, error)

	// Accounts
	GetAccount(address []byte) (*rpc_tm_types.ResultGetAccount, error)
	ListAccounts() (*rpc_tm_types.ResultListAccounts, error)
	GetStorage(address, key []byte) (*rpc_tm_types.ResultGetStorage, error)
	DumpStorage(address []byte) (*rpc_tm_types.ResultDumpStorage, error)

	// Call
	Call(fromAddress, toAddress, data []byte) (*rpc_tm_types.ResultCall, error)
	CallCode(fromAddress, code, data []byte) (*rpc_tm_types.ResultCall, error)

	// TODO: [ben] deprecate as we should not allow unsafe behaviour
	// where a user is allowed to send a private key over the wire,
	// especially unencrypted.
	SignTransaction(tx txs.Tx,
		privAccounts []*account.PrivAccount) (*rpc_tm_types.ResultSignTx,
		error)

	// Name registry
	GetName(name string) (*rpc_tm_types.ResultGetName, error)
	ListNames() (*rpc_tm_types.ResultListNames, error)

	// Memory pool
	BroadcastTxAsync(transaction txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error)
	BroadcastTxSync(transaction txs.Tx) (*rpc_tm_types.ResultBroadcastTx, error)

	// Blockchain
	BlockchainInfo(minHeight, maxHeight, maxBlockLookback int) (*rpc_tm_types.ResultBlockchainInfo, error)
	ListUnconfirmedTxs(maxTxs int) (*rpc_tm_types.ResultListUnconfirmedTxs, error)
	GetBlock(height int) (*rpc_tm_types.ResultGetBlock, error)

	// Consensus
	ListValidators() (*rpc_tm_types.ResultListValidators, error)
	DumpConsensusState() (*rpc_tm_types.ResultDumpConsensusState, error)
}

type Transactor

type Transactor interface {
	Call(fromAddress, toAddress, data []byte) (*types.Call, error)
	CallCode(fromAddress, code, data []byte) (*types.Call, error)
	// Send(privKey, toAddress []byte, amount int64) (*types.Receipt, error)
	// SendAndHold(privKey, toAddress []byte, amount int64) (*types.Receipt, error)
	BroadcastTx(tx txs.Tx) (*txs.Receipt, error)
	Transact(privKey, address, data []byte, gasLimit,
		fee int64) (*txs.Receipt, error)
	TransactAndHold(privKey, address, data []byte, gasLimit,
		fee int64) (*txs.EventDataCall, error)
	Send(privKey, toAddress []byte, amount int64) (*txs.Receipt, error)
	SendAndHold(privKey, toAddress []byte, amount int64) (*txs.Receipt, error)
	TransactNameReg(privKey []byte, name, data string, amount,
		fee int64) (*txs.Receipt, error)
	SignTx(tx txs.Tx, privAccounts []*account.PrivAccount) (txs.Tx, error)
}

Jump to

Keyboard shortcuts

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