Documentation ¶
Index ¶
- Variables
- func AbsolutePath(Datadir string, filename string) string
- func FileExist(filePath string) bool
- func LoadJSON(file string, val interface{}) error
- func MakeName(name, version string) string
- func MsgpHash(x interface{}) (h types.Hash, err error)
- func PrintDepricationWarning(str string)
- func Report(extra ...interface{})
- type ChainStateReader
- type PrettyDuration
- type Serializer
- type StorageSize
- type Subscription
- type SyncProgress
- type UnSerializer
Constants ¶
This section is empty.
Variables ¶
var ( Big1 = big.NewInt(1) Big2 = big.NewInt(2) Big3 = big.NewInt(3) Big27 = big.NewInt(27) Big35 = big.NewInt(35) Big0 = big.NewInt(0) Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) Big257 = big.NewInt(257) )
Common big integers often used
Functions ¶
func AbsolutePath ¶
func MakeName ¶
MakeName creates a node name that follows the bchain convention for such names. It adds the operation system name and Go runtime version the name.
func PrintDepricationWarning ¶
func PrintDepricationWarning(str string)
PrintDepricationWarning prinst the given string in a box using fmt.Println.
Types ¶
type ChainStateReader ¶
type ChainStateReader interface { BalanceAt(ctx context.Context, account types.Address, blockNumber *big.Int) (*big.Int, error) StorageAt(ctx context.Context, account types.Address, key types.Hash, blockNumber *big.Int) ([]byte, error) CodeAt(ctx context.Context, account types.Address, blockNumber *big.Int) ([]byte, error) NonceAt(ctx context.Context, account types.Address, blockNumber *big.Int) (uint64, error) }
ChainStateReader wraps access to the state trie of the canonical blockchain. Note that implementations of the interface may be unable to return state values for old blocks. In many cases, using CallContract can be preferable to reading raw contract storage.
type PrettyDuration ¶
PrettyDuration is a pretty printed version of a time.Duration value that cuts the unnecessary precision off from the formatted textual representation.
func (PrettyDuration) String ¶
func (d PrettyDuration) String() string
String implements the Stringer interface, allowing pretty printing of duration values rounded to three decimals.
type Serializer ¶
type StorageSize ¶
type StorageSize float64
StorageSize is a wrapper around a float value that supports user friendly formatting.
func (StorageSize) String ¶
func (s StorageSize) String() string
String implements the stringer interface.
func (StorageSize) TerminalString ¶
func (s StorageSize) TerminalString() string
TerminalString implements log.TerminalStringer, formatting a string for console output during logging.
type Subscription ¶
type Subscription interface { // Unsubscribe cancels the sending of events to the data channel // and closes the error channel. Unsubscribe() // Err returns the subscription error channel. The error channel receives // a value if there is an issue with the subscription (e.g. the network connection // delivering the events has been closed). Only one value will ever be sent. // The error channel is closed by Unsubscribe. Err() <-chan error }
type SyncProgress ¶
type SyncProgress struct { StartingBlock uint64 // Block number where sync began CurrentBlock uint64 // Current block number where sync is at HighestBlock uint64 // Highest alleged block number in the chain PulledStates uint64 // Number of state trie entries already downloaded KnownStates uint64 // Total number of state trie entries known about }
SyncProgress gives progress indications when the node is synchronising with the Bchain network.
type UnSerializer ¶
type UnSerializer interface {
UnSerialize(stream interface{}) error
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package bitutil implements fast bitwise operations.
|
Package bitutil implements fast bitwise operations. |
Package math provides integer math utilities.
|
Package math provides integer math utilities. |
package mclock is a wrapper for a monotonic clock source
|
package mclock is a wrapper for a monotonic clock source |