Documentation ¶
Overview ¶
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
Index ¶
- Variables
- func ReadTransaction(bc *chain.BlockChain, hash common.Hash) (*types.Transaction, common.Hash)
- type AdminAPI
- func (api *AdminAPI) AddBlack(url string) (bool, error)
- func (api *AdminAPI) AddPeer(url string) (bool, error)
- func (api *AdminAPI) AddTrustedPeer(url string) (bool, error)
- func (api *AdminAPI) GenerateMiningKey(address common.Address) keys.MiningPubkey
- func (api *AdminAPI) IsPacking() bool
- func (api *AdminAPI) Mining() bool
- func (api *AdminAPI) RemoveBlack(url string) (bool, error)
- func (api *AdminAPI) RemovePeer(url string) (bool, error)
- func (api *AdminAPI) RemoveTrustedPeer(url string) (bool, error)
- func (api *AdminAPI) StartMining() error
- func (api *AdminAPI) StartPacking(packerIndex uint32)
- func (api *AdminAPI) StopMining()
- func (api *AdminAPI) StopPacking()
- type BlockChainAPI
- func (s *BlockChainAPI) BlockHeight() hexutil.Uint64
- func (s *BlockChainAPI) Genesis() *types.Block
- func (s *BlockChainAPI) GetAncestorBlocks(fullHash common.Hash, num uint32) types.Blocks
- func (s *BlockChainAPI) GetBackwardBlocks(fullHash common.Hash, num uint32) types.Blocks
- func (s *BlockChainAPI) GetBalance(ctx context.Context, address common.Address, blockHashStr string) (*hexutil.Big, error)
- func (s *BlockChainAPI) GetBlock(hash common.Hash) *types.Block
- func (s *BlockChainAPI) GetBlockByHeight(height hexutil.Uint64) *types.Block
- func (s *BlockChainAPI) GetCode(ctx context.Context, address common.Address, blockHashStr string) (hexutil.Bytes, error)
- func (s *BlockChainAPI) GetContractOwner(ctx context.Context, contractAddress common.Address) (common.Address, error)
- func (s *BlockChainAPI) GetDescendantBlocks(fullHash common.Hash, num uint32) types.Blocks
- func (s *BlockChainAPI) GetNearbyBlocks(fullHash common.Hash, num uint32) types.Blocks
- func (s *BlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, table string, key hexutil.Bytes, ...) (hexutil.Bytes, error)
- func (s *BlockChainAPI) GetTransferBlackList(ctx context.Context, blockHashStr string) (string, error)
- func (s *BlockChainAPI) GetTransferWhiteList(ctx context.Context, blockHashStr string) (string, error)
- func (s *BlockChainAPI) HeadBlock() *types.Block
- func (s *BlockChainAPI) SubNewBlock(ctx context.Context) (*rpcserver.Subscription, error)
- type CallResult
- type FilterAPI
- type FilterCriteria
- type FractalAPI
- type NetAPI
- func (s *NetAPI) Listening() bool
- func (s *NetAPI) NodeInfo() (*p2p.NodeInfo, error)
- func (s *NetAPI) PeerCount() (hexutil.Uint, error)
- func (s *NetAPI) PeerEvents(ctx context.Context) (*rpcserver.Subscription, error)
- func (s *NetAPI) Peers() ([]*p2p.PeerInfo, error)
- func (s *NetAPI) Version() string
- type PackerAPI
- type RPCTransaction
- type SendTxArgs
- type StatusResult
- type SynchronizerAPI
- type SynchronizerTestAPI
- func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFixPointFinish(time int) string
- func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFixPointPreBlock(time int) string
- func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFullfillLongList(time int) string
- func (s *SynchronizerTestAPI) ChangeLongTimeOutOfIntevalList(time int) string
- func (s *SynchronizerTestAPI) ChangeLongTimeOutOfLongList(time int) string
- func (s *SynchronizerTestAPI) ChangeShortTimeOutOfShortLists(time int) string
- func (s *SynchronizerTestAPI) ChangeShortTimeOutOfSyncVeryHigh(time int) string
- type TxPoolAPI
- func (s *TxPoolAPI) Call(args SendTxArgs) (CallResult, error)
- func (s *TxPoolAPI) Content() map[string]map[string]map[string]*RPCTransaction
- func (s *TxPoolAPI) EncodeAction(abi hexutil.Bytes, action string, args string) hexutil.Bytes
- func (s *TxPoolAPI) GasPrice() *hexutil.Big
- func (s *TxPoolAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
- func (s *TxPoolAPI) GetTransactionByHash(ctx context.Context, hash common.Hash) *RPCTransaction
- func (s *TxPoolAPI) GetTransactionNonce(ctx context.Context, address common.Address) *hexutil.Uint64
- func (s *TxPoolAPI) Inspect() map[string]map[string]map[string]string
- func (s *TxPoolAPI) PendingTransactions() types.Transactions
- func (s *TxPoolAPI) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
- func (s *TxPoolAPI) SendRawTransactionPeriodically(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
- func (s *TxPoolAPI) Status() map[string]hexutil.Uint
Constants ¶
This section is empty.
Variables ¶
var (
ErrBatchPackNotEnabled = errors.New("batch pack not enabled")
)
var ErrNodeStopped = errors.New("node not started")
Functions ¶
func ReadTransaction ¶
func ReadTransaction(bc *chain.BlockChain, hash common.Hash) (*types.Transaction, common.Hash)
ReadTransaction retrieves a specific transaction from the database, along with its added positional metadata.
Types ¶
type AdminAPI ¶
type AdminAPI struct {
// contains filtered or unexported fields
}
AdminAPI is the collection of administrative API methods.
func NewAdminAPI ¶
NewAdminAPI creates a new AdminAPI.
func (*AdminAPI) AddPeer ¶
AddPeer requests connecting to a remote node, and also maintaining the new connection at all times, even reconnecting if it is lost.
func (*AdminAPI) AddTrustedPeer ¶
AddTrustedPeer allows a remote node to always connect, even if slots are full
func (*AdminAPI) GenerateMiningKey ¶
func (api *AdminAPI) GenerateMiningKey(address common.Address) keys.MiningPubkey
func (*AdminAPI) RemovePeer ¶
RemovePeer disconnects from a remote node if the connection exists
func (*AdminAPI) RemoveTrustedPeer ¶
RemoveTrustedPeer removes a remote node from the trusted peer set, but it does not disconnect it automatically.
func (*AdminAPI) StartPacking ¶
func (*AdminAPI) StopPacking ¶
func (api *AdminAPI) StopPacking()
type BlockChainAPI ¶
type BlockChainAPI struct {
// contains filtered or unexported fields
}
BlockChainAPI provides an API to access the Fractal blockchain. It offers only methods that operate on public data that is freely available to anyone.
func NewBlockChainAPI ¶
func NewBlockChainAPI(ftl fractal) *BlockChainAPI
NewBlockChainAPI creates a new Fractal blockchain API.
func (*BlockChainAPI) BlockHeight ¶
func (s *BlockChainAPI) BlockHeight() hexutil.Uint64
BlockHeight returns the block heigth of the chain head.
func (*BlockChainAPI) Genesis ¶
func (s *BlockChainAPI) Genesis() *types.Block
Genesis returns the first block in the chain.
func (*BlockChainAPI) GetAncestorBlocks ¶
func (*BlockChainAPI) GetBackwardBlocks ¶
func (*BlockChainAPI) GetBalance ¶
func (s *BlockChainAPI) GetBalance(ctx context.Context, address common.Address, blockHashStr string) (*hexutil.Big, error)
GetBalance returns the amount of nFra for the given address in the state of the given block
func (*BlockChainAPI) GetBlock ¶
func (s *BlockChainAPI) GetBlock(hash common.Hash) *types.Block
GetBlock returns the block with the hash.
func (*BlockChainAPI) GetBlockByHeight ¶
func (s *BlockChainAPI) GetBlockByHeight(height hexutil.Uint64) *types.Block
func (*BlockChainAPI) GetContractOwner ¶
func (*BlockChainAPI) GetDescendantBlocks ¶
func (*BlockChainAPI) GetNearbyBlocks ¶
func (*BlockChainAPI) GetStorageAt ¶
func (*BlockChainAPI) GetTransferBlackList ¶
func (*BlockChainAPI) GetTransferWhiteList ¶
func (*BlockChainAPI) HeadBlock ¶
func (s *BlockChainAPI) HeadBlock() *types.Block
HeadBlock returns the head block in the chain.
func (*BlockChainAPI) SubNewBlock ¶
func (s *BlockChainAPI) SubNewBlock(ctx context.Context) (*rpcserver.Subscription, error)
SubNewBlock provides information when new block arrived
type FilterAPI ¶
type FilterAPI struct {
// contains filtered or unexported fields
}
func NewFilterAPI ¶
func NewFilterAPI(ftl fractal) *FilterAPI
type FilterCriteria ¶
type FilterCriteria struct { BlockHash *common.Hash // used by ftl_getLogs, return logs only from block with this hash FromBlockHeight *big.Int // beginning of the queried range, nil means genesis block ToBlockHeight *big.Int // end of the range, nil means latest block Addresses []common.Address // restricts matches to events created by specific contracts // The Topic list restricts matches to particular event topics. Each event has a list // of topics. Topics matches a prefix of that list. An empty element slice matches any // topic. Non-empty elements represent an alternative that matches any of the // contained topics. // // Examples: // {} or nil matches any topic list // {{A}} matches topic A in first position // {{}, {B}} matches any topic in first position, B in second position // {{A}, {B}} matches topic A in first position, B in second position // {{A, B}}, {C, D}} matches topic (A OR B) in first position, (C OR D) in second position Topics [][]common.Hash }
type FractalAPI ¶
type FractalAPI struct {
// contains filtered or unexported fields
}
FractalAPI provides an API to access Fractal related information. It offers only methods that operate on public data that is freely available to anyone.
func NewFractalAPI ¶
func NewFractalAPI(ftl fractal) *FractalAPI
NewFractalAPI creates a new Fractal protocol API.
func (*FractalAPI) ChainId ¶
func (s *FractalAPI) ChainId() hexutil.Uint64
func (*FractalAPI) Coinbase ¶
func (s *FractalAPI) Coinbase() common.Address
Coinbase is the address that mining rewards will be send to
func (*FractalAPI) ProtocolVersion ¶
func (s *FractalAPI) ProtocolVersion() hexutil.Uint
ProtocolVersion returns the current Fractal protocol version this node supports
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI offers network related RPC methods
func (*NetAPI) Listening ¶
Listening returns an indication if the node is listening for network connections.
func (*NetAPI) NodeInfo ¶
NodeInfo retrieves all the information we know about the host node at the protocol granularity.
func (*NetAPI) PeerEvents ¶
PeerEvents creates an RPC subscription which receives peer events from the node's p2p.Server
type PackerAPI ¶
type PackerAPI struct {
// contains filtered or unexported fields
}
func NewPackerAPI ¶
func NewPackerAPI(chain *chain.BlockChain, packer packer.Packer) *PackerAPI
func (*PackerAPI) GetTxPackageByHash ¶
func (*PackerAPI) SendRawTransaction ¶
type RPCTransaction ¶
type RPCTransaction struct { From common.Address `json:"from"` Hash common.Hash `json:"hash"` Nonce hexutil.Uint64 `json:"nonce"` To *common.Address `json:"to"` Value *hexutil.Big `json:"value"` Price *hexutil.Big `json:"gasPrice"` GasLimit hexutil.Uint64 `json:"gas"` Payload hexutil.Bytes `json:"input"` Broadcast bool `json:"broadcast"` V *hexutil.Big `json:"v"` R *hexutil.Big `json:"r"` S *hexutil.Big `json:"s"` BlockHash common.Hash `json:"blockHash"` Receipt *types.Receipt `json:"receipt"` }
RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction
type SendTxArgs ¶
type SendTxArgs struct { From common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` Value *hexutil.Big `json:"value"` Nonce *hexutil.Uint64 `json:"nonce"` // We accept "data" and "input" for backwards-compatibility reasons. "input" is the // newer name and should be preferred by clients. Data *hexutil.Bytes `json:"data"` }
type StatusResult ¶
type SynchronizerAPI ¶
type SynchronizerAPI struct {
// contains filtered or unexported fields
}
func NewSynchronizerAPI ¶
func NewSynchronizerAPI(ftl fractal) *SynchronizerAPI
func (*SynchronizerAPI) Status ¶
func (s *SynchronizerAPI) Status() StatusResult
type SynchronizerTestAPI ¶
type SynchronizerTestAPI struct {
// contains filtered or unexported fields
}
SynchronizerTestAPI provides an API to change config of sync
func NewSynchronizerTestAPI ¶
func NewSynchronizerTestAPI(ftl fractal) *SynchronizerTestAPI
NewSynchronizerTestAPI creates a new SynchonizerTestAPI.
func (*SynchronizerTestAPI) ChangeLongTimeOutOfFixPointFinish ¶
func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFixPointFinish(time int) string
func (*SynchronizerTestAPI) ChangeLongTimeOutOfFixPointPreBlock ¶
func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFixPointPreBlock(time int) string
func (*SynchronizerTestAPI) ChangeLongTimeOutOfFullfillLongList ¶
func (s *SynchronizerTestAPI) ChangeLongTimeOutOfFullfillLongList(time int) string
func (*SynchronizerTestAPI) ChangeLongTimeOutOfIntevalList ¶
func (s *SynchronizerTestAPI) ChangeLongTimeOutOfIntevalList(time int) string
func (*SynchronizerTestAPI) ChangeLongTimeOutOfLongList ¶
func (s *SynchronizerTestAPI) ChangeLongTimeOutOfLongList(time int) string
func (*SynchronizerTestAPI) ChangeShortTimeOutOfShortLists ¶
func (s *SynchronizerTestAPI) ChangeShortTimeOutOfShortLists(time int) string
func (*SynchronizerTestAPI) ChangeShortTimeOutOfSyncVeryHigh ¶
func (s *SynchronizerTestAPI) ChangeShortTimeOutOfSyncVeryHigh(time int) string
type TxPoolAPI ¶
type TxPoolAPI struct {
// contains filtered or unexported fields
}
TxPoolAPI offers and API for the transaction pool. It only operates on data that is non confidential.
func NewTxPoolAPI ¶
NewTxPoolAPI creates a new tx pool service that gives information about the transaction pool.
func (*TxPoolAPI) Call ¶
func (s *TxPoolAPI) Call(args SendTxArgs) (CallResult, error)
func (*TxPoolAPI) Content ¶
func (s *TxPoolAPI) Content() map[string]map[string]map[string]*RPCTransaction
Content returns the transactions contained within the transaction pool.
func (*TxPoolAPI) EncodeAction ¶
func (*TxPoolAPI) GetBlockTransactionCountByHash ¶
func (s *TxPoolAPI) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) *hexutil.Uint
GetBlockTransactionCountByHash returns the number of transactions in the block with the given hash.
func (*TxPoolAPI) GetTransactionByHash ¶
GetTransactionByHash returns the transaction for the given hash
func (*TxPoolAPI) GetTransactionNonce ¶
func (*TxPoolAPI) Inspect ¶
Inspect retrieves the content of the transaction pool and flattens it into an easily inspectable list.
func (*TxPoolAPI) PendingTransactions ¶
func (s *TxPoolAPI) PendingTransactions() types.Transactions