Documentation ¶
Overview ¶
Package common defines a set of commonly used helper methods and data types.
Package common defines a set of commonly used helper methods and data types.
Index ¶
Constants ¶
View Source
const ( // HashLength is the standardized length of a hash HashLength = 32 // AddressLength is the standardized length of an address AddressLength = 20 )
Variables ¶
View Source
var ( // DataDir is the global data directory definition. DataDir = getDataDir() // ConfigDir is the global configuration directory definition. ConfigDir = filepath.FromSlash(fmt.Sprintf("%s/config", DataDir)) // DbDir is the global database directory definition. DbDir = filepath.FromSlash(fmt.Sprintf("%s/db", DataDir)) // PeerIdentityDir is the global p2p identity definition. PeerIdentityDir = filepath.FromSlash(fmt.Sprintf("%s/p2p", DataDir)) )
Functions ¶
func CreateDirIfDoesNotExit ¶
CreateDirIfDoesNotExit creates a given directory if it does not already exist.
Types ¶
type Address ¶
type Address [AddressLength]byte
Address represents a 20 byte, hex-encoded ECDSA public key.
func NewAddress ¶
NewAddress formats a given byte array to an address.
Click to show internal directories.
Click to hide internal directories.