Documentation ¶
Index ¶
- func CreateDB(ctx *node.Context, config *UranusConfig, name string) (db.Database, error)
- type APIBackend
- func (api *APIBackend) Accounts() (wallet.Accounts, error)
- func (api *APIBackend) AddPeer(url string) error
- func (api *APIBackend) BlockByHash(ctx context.Context, blockHash utils.Hash) (*types.Block, error)
- func (api *APIBackend) BlockByHeight(ctx context.Context, height rpcapi.BlockHeight) (*types.Block, error)
- func (api *APIBackend) BlockChain() *core.BlockChain
- func (api *APIBackend) CurrentBlock() *types.Block
- func (api *APIBackend) Delete(address utils.Address, passphrase string) error
- func (api *APIBackend) ExportRawKey(addr utils.Address, passphrase string) (string, error)
- func (api *APIBackend) GetBFTConfirmedBlockNumber() (*big.Int, error)
- func (api *APIBackend) GetConfirmedBlockNumber() (*big.Int, error)
- func (api *APIBackend) GetEVM(ctx context.Context, from utils.Address, tx *types.Transaction, ...) (*vm.EVM, func() error, error)
- func (api *APIBackend) GetLogs(ctx context.Context, blockHash utils.Hash) ([][]*types.Log, error)
- func (api *APIBackend) GetPoolNonce(ctx context.Context, addr utils.Address) (uint64, error)
- func (api *APIBackend) GetPoolTransaction(txHash utils.Hash) *types.Transaction
- func (api *APIBackend) GetPoolTransactions() (types.Transactions, error)
- func (api *APIBackend) GetReceipt(ctx context.Context, txHash utils.Hash) (*types.Receipt, error)
- func (api *APIBackend) GetReceipts(ctx context.Context, blockHash utils.Hash) (types.Receipts, error)
- func (api *APIBackend) GetTd(blockHash utils.Hash) *big.Int
- func (api *APIBackend) GetTransaction(txHash utils.Hash) *types.StorageTx
- func (api *APIBackend) ImportRawKey(privkey string, passphrase string) (utils.Address, error)
- func (api *APIBackend) NewAccount(passphrase string) (wallet.Account, error)
- func (api *APIBackend) NodeInfo() (*p2p.NodeInfo, error)
- func (api *APIBackend) Peers() ([]*p2p.PeerInfo, error)
- func (api *APIBackend) RemovePeer(url string) error
- func (api *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
- func (api *APIBackend) SetCoinbase(address utils.Address) error
- func (api *APIBackend) SignTx(addr utils.Address, tx *types.Transaction, passphrase string) (*types.Transaction, error)
- func (api *APIBackend) Start(threads int32) error
- func (api *APIBackend) Stop() error
- func (api *APIBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (api *APIBackend) TxPoolContent() (map[utils.Address]types.Transactions, map[utils.Address]types.Transactions)
- func (api *APIBackend) TxPoolStats() (pending int, queued int)
- func (api *APIBackend) Update(address utils.Address, passphrase, newPassphrase string) error
- type MinerBakend
- func (m *MinerBakend) Actions() []*types.Action
- func (m *MinerBakend) Config() *params.ChainConfig
- func (m *MinerBakend) CurrentBlock() *types.Block
- func (m *MinerBakend) ExecActions(statedb *state.StateDB, actions []*types.Action)
- func (m *MinerBakend) ExecTransaction(author *utils.Address, dposcontext *types.DposContext, gp *utils.GasPool, ...) ([]byte, *types.Receipt, uint64, error)
- func (m *MinerBakend) GetBlockByHash(hash utils.Hash) *types.Block
- func (m *MinerBakend) GetBlockByHeight(height uint64) *types.Block
- func (m *MinerBakend) GetCurrentInfo() (*types.Block, *state.StateDB, error)
- func (m *MinerBakend) GetHeader(hash utils.Hash) *types.BlockHeader
- func (m *MinerBakend) Pending() (map[utils.Address]types.Transactions, error)
- func (m *MinerBakend) PostEvent(event interface{})
- func (m *MinerBakend) SubscribeChainBlockEvent(ch chan<- feed.BlockAndLogsEvent) feed.Subscription
- func (m *MinerBakend) SubscribeNewTxsEvent(ch chan<- feed.NewTxsEvent) feed.Subscription
- func (m *MinerBakend) WriteBlockWithState(block *types.Block, receipts types.Receipts, state *state.StateDB) (bool, error)
- type Uranus
- type UranusConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIBackend ¶
type APIBackend struct {
// contains filtered or unexported fields
}
APIBackend implements node all apis.
func (*APIBackend) Accounts ¶
func (api *APIBackend) Accounts() (wallet.Accounts, error)
Accounts list all wallet accounts.
func (*APIBackend) AddPeer ¶
func (api *APIBackend) AddPeer(url string) error
func (*APIBackend) BlockByHash ¶
BlockByHash returns Block by block hash.
func (*APIBackend) BlockByHeight ¶
func (api *APIBackend) BlockByHeight(ctx context.Context, height rpcapi.BlockHeight) (*types.Block, error)
BlockByHeight returns block by block height.
func (*APIBackend) BlockChain ¶
func (api *APIBackend) BlockChain() *core.BlockChain
BlockChain return core blockchian.
func (*APIBackend) CurrentBlock ¶
func (api *APIBackend) CurrentBlock() *types.Block
CurrentBlock returns blockchain current block.
func (*APIBackend) Delete ¶
func (api *APIBackend) Delete(address utils.Address, passphrase string) error
Delete removes the speciified account
func (*APIBackend) ExportRawKey ¶
ExportRawKey return key hex.
func (*APIBackend) GetBFTConfirmedBlockNumber ¶
func (api *APIBackend) GetBFTConfirmedBlockNumber() (*big.Int, error)
func (*APIBackend) GetConfirmedBlockNumber ¶
func (api *APIBackend) GetConfirmedBlockNumber() (*big.Int, error)
func (*APIBackend) GetPoolNonce ¶
GetPoolNonce get txpool nonce by address.
func (*APIBackend) GetPoolTransaction ¶
func (api *APIBackend) GetPoolTransaction(txHash utils.Hash) *types.Transaction
GetPoolTransaction get tansaction by hash from txpool.
func (*APIBackend) GetPoolTransactions ¶
func (api *APIBackend) GetPoolTransactions() (types.Transactions, error)
GetPoolTransactions get txpool pending transactions.
func (*APIBackend) GetReceipt ¶
GetReceipt returns receipte by tx hash.
func (*APIBackend) GetReceipts ¶
func (api *APIBackend) GetReceipts(ctx context.Context, blockHash utils.Hash) (types.Receipts, error)
GetReceipts returns receipte by block hash.
func (*APIBackend) GetTd ¶
func (api *APIBackend) GetTd(blockHash utils.Hash) *big.Int
GetTd get total difficulty by block hash.
func (*APIBackend) GetTransaction ¶
func (api *APIBackend) GetTransaction(txHash utils.Hash) *types.StorageTx
GetTransaction get tansaction by hash from chain db.
func (*APIBackend) ImportRawKey ¶
ImportRawKey import raw key intfo wallet.
func (*APIBackend) NewAccount ¶
func (api *APIBackend) NewAccount(passphrase string) (wallet.Account, error)
NewAccount creates a new account
func (*APIBackend) RemovePeer ¶
func (api *APIBackend) RemovePeer(url string) error
func (*APIBackend) SendTx ¶
func (api *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
SendTx send signed transaction to txpool.
func (*APIBackend) SetCoinbase ¶
func (api *APIBackend) SetCoinbase(address utils.Address) error
func (*APIBackend) SignTx ¶
func (api *APIBackend) SignTx(addr utils.Address, tx *types.Transaction, passphrase string) (*types.Transaction, error)
SignTx sign the specified transaction
func (*APIBackend) Start ¶
func (api *APIBackend) Start(threads int32) error
func (*APIBackend) Stop ¶
func (api *APIBackend) Stop() error
func (*APIBackend) SuggestGasPrice ¶
SuggestGasPrice suggest gas price
func (*APIBackend) TxPoolContent ¶
func (api *APIBackend) TxPoolContent() (map[utils.Address]types.Transactions, map[utils.Address]types.Transactions)
TxPoolContent get transaction pool content.
func (*APIBackend) TxPoolStats ¶
func (api *APIBackend) TxPoolStats() (pending int, queued int)
TxPoolStats get transaction pool stats.
type MinerBakend ¶
type MinerBakend struct {
// contains filtered or unexported fields
}
func (*MinerBakend) Actions ¶
func (m *MinerBakend) Actions() []*types.Action
func (*MinerBakend) Config ¶
func (m *MinerBakend) Config() *params.ChainConfig
func (*MinerBakend) CurrentBlock ¶
func (m *MinerBakend) CurrentBlock() *types.Block
func (*MinerBakend) ExecActions ¶
func (m *MinerBakend) ExecActions(statedb *state.StateDB, actions []*types.Action)
func (*MinerBakend) ExecTransaction ¶
func (m *MinerBakend) ExecTransaction(author *utils.Address, dposcontext *types.DposContext, gp *utils.GasPool, statedb *state.StateDB, header *types.BlockHeader, tx *types.Transaction, usedGas *uint64, cfg vm.Config) ([]byte, *types.Receipt, uint64, error)
ExecTransaction exectue transaction return receipt
func (*MinerBakend) GetBlockByHash ¶
func (m *MinerBakend) GetBlockByHash(hash utils.Hash) *types.Block
func (*MinerBakend) GetBlockByHeight ¶
func (m *MinerBakend) GetBlockByHeight(height uint64) *types.Block
func (*MinerBakend) GetCurrentInfo ¶
GetCurrentInfo get blockchain current info
func (*MinerBakend) GetHeader ¶
func (m *MinerBakend) GetHeader(hash utils.Hash) *types.BlockHeader
GetHeader retrieves a header from the database by hash,
func (*MinerBakend) Pending ¶
func (m *MinerBakend) Pending() (map[utils.Address]types.Transactions, error)
Pending returns txpool pending transactions
func (*MinerBakend) PostEvent ¶
func (m *MinerBakend) PostEvent(event interface{})
func (*MinerBakend) SubscribeChainBlockEvent ¶
func (m *MinerBakend) SubscribeChainBlockEvent(ch chan<- feed.BlockAndLogsEvent) feed.Subscription
func (*MinerBakend) SubscribeNewTxsEvent ¶
func (m *MinerBakend) SubscribeNewTxsEvent(ch chan<- feed.NewTxsEvent) feed.Subscription
type Uranus ¶
type Uranus struct {
// contains filtered or unexported fields
}
Uranus implements the service.
func New ¶
func New(ctx *node.Context, config *UranusConfig) (*Uranus, error)
New creates a new Uranus object
func (*Uranus) BlockChain ¶
func (u *Uranus) BlockChain() *core.BlockChain
BlockChain returns blcokchain.
type UranusConfig ¶
type UranusConfig struct { // If nil, the default genesis block is used. Genesis *ledger.Genesis DBHandles int DBCache int TrieCache int TrieTimeout time.Duration StartMiner bool `mapstructure:"miner-start"` // Ledger config LedgerConfig *ledger.Config // Transaction pool options TxPoolConfig *txpool.Config // miner config MinerConfig *miner.Config }
UranusConfig uranus config
func (UranusConfig) String ¶
func (c UranusConfig) String() string