package
0.0.1
Repository: https://github.com/libonomy/libonomy-p2p.git
Documentation: pkg.go.dev

# Functions

BigToAddress returns Address with byte values of b.
BlockIDs returns a slice of BlockIDs corresponding to the given blocks.
BlockIdsAsBytes serializes a slice of BlockIDs.
BytesAsTransaction deserializes a Transaction.
BytesToAddress returns Address with value b.
BytesToBlockIds deserializes a slice of BlockIDs.
BytesToHash sets b to hash.
BytesToInterface deserializes any type.
CalcBlockHash32Presorted returns the 32-byte sha256 sum of the block IDs, in the order given.
CalcBlocksHash12 returns the 12-byte sha256 sum of the block IDs, sorted in lexicographic order.
CalcBlocksHash32 returns the 32-byte sha256 sum of the block IDs, sorted in lexicographic order.
CalcHash12 returns the 12-byte prefix of the sha256 sum of the given byte slice.
CalcHash32 returns the 32-byte sha256 sum of the given data.
CalcMessageHash12 returns the 12-byte sha256 sum of the given msg suffixed with protocol.
HexToAddress returns Address with byte values of s.
HexToHash32 sets byte representation of s to hash.
InterfaceToBytes serializes any type.
NewDoubleCache returns a new DoubleCache.
NewExistingBlock returns a block in the given layer with the given arbitrary data.
NewExistingLayer returns a new layer with the given list of blocks without validation.
NewLayer returns a layer with no blocks.
SortBlockIDs sorts a list of BlockIDs in lexicographic order, in-place.
SortBlocks sorts a list of Blocks in lexicographic order of their IDs, in-place.
StringToAddress returns Address with byte values of s.

# Constants

AddressLength is the expected length of the address.
Hash32Length is 32, the expected length of the hash.

# Variables

Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
Common big integers often used.
EmptyTransactionID is a canonical empty TransactionID.

# Structs

Block includes all of a block's fields, including signature and a cache of the BlockID and MinerID.
BlockEligibilityProof includes the required values that, along with the miner's VRF public key, allow non-interactive block eligibility validation.
BlockHeader includes all of a block's fields, except the list of transaction IDs, activation transaction IDs and the signature.
DoubleCache is a structure for storing which keys have been encountered before.
InnerTransaction includes all of a transaction's fields, except the signature (origin and id aren't stored).
Layer contains a list of blocks and their corresponding LayerID.
MiniBlock includes all of a block's fields, except for the signature.
NodeID contains a miner's two public keys.
Reward is a virtual reward transaction, which the node keeps track of for the gRPC api.
Transaction contains all transaction fields, including the signature and cached origin address and transaction ID.
TryMutex is a simple sync.Mutex with the ability to try to Lock.

# Type aliases

Address represents the 20 byte address of an libonomy account.
BlockID is a 20-byte sha256 sum of the serialized block, used to identify it.
Hash12 represents the first 12 bytes of sha256, mostly used for internal caches.
Hash20 represents the 20-byte sha256 hash of arbitrary data.
Hash32 represents the 32-byte sha256 hash of arbitrary data.
LayerID is a uint64 representing a layer number.
StorageSize is a wrapper around a float value that supports user friendly formatting.
TransactionID is a 32-byte sha256 sum of the transaction, used as an identifier.