Documentation ¶
Index ¶
- func ByteCount(b uint64) string
- func Clean() []string
- func ConvertAddressToH160(addr [20]byte) *types_pb.H160
- func ConvertAddrsToH160(ps []types.Address) []*types_pb.H160
- func ConvertBytesToH2048(data []byte) *types_pb.H2048
- func ConvertBytesToH512(b []byte) *types_pb.H512
- func ConvertFromInterfacePrivKey(privkey crypto.PrivKey) (*ecdsa.PrivateKey, error)
- func ConvertH160ToPAddress(h160 *types_pb.H160) *types.Address
- func ConvertH160toAddress(h160 *types_pb.H160) [20]byte
- func ConvertH2048ToBloom(h2048 *types_pb.H2048) [256]byte
- func ConvertH256ToHash(h256 *types_pb.H256) [32]byte
- func ConvertH256ToUint256Int(h256 *types_pb.H256) *uint256.Int
- func ConvertH384ToPublicKey(h384 *types_pb.H384) [48]byte
- func ConvertH512ToBytes(h512 *types_pb.H512) []byte
- func ConvertH512ToHash(h512 *types_pb.H512) [64]byte
- func ConvertH768ToSignature(h768 *types_pb.H768) [96]byte
- func ConvertHashToH256(hash [32]byte) *types_pb.H256
- func ConvertHashToH512(hash [64]byte) *types_pb.H512
- func ConvertHashesToH256(hashes []types.Hash) []*types_pb.H256
- func ConvertPublicKeyToH384(p [48]byte) *types_pb.H384
- func ConvertPubsToH384(ps []types.PublicKey) []*types_pb.H384
- func ConvertSignatureToH768(p [96]byte) *types_pb.H768
- func ConvertToInterfacePrivkey(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error)
- func ConvertToInterfacePubkey(pubkey *ecdsa.PublicKey) (crypto.PubKey, error)
- func ConvertUint256IntToH256(i *uint256.Int) *types_pb.H256
- func Copy(b []byte) []byte
- func CreateForkDigest(currentBlockNr *uint256.Int, genesisValidatorsRoot types.Hash) ([4]byte, error)
- func EnsureEnoughSize(in []byte, size int) []byte
- func Exists(path string) bool
- func ExternalIP() (string, error)
- func ExternalIPv4() (string, error)
- func H160sToAddress(ps []*types_pb.H160) []types.Address
- func H256sToHashes(h256s []*types_pb.H256) []types.Hash
- func H384sToPubs(ps []*types_pb.H384) []types.PublicKey
- func Hash256toS(data []byte) string
- func HexPrefix(a, b []byte) ([]byte, int)
- func IPAddr() net.IP
- func Keccak256(data ...[]byte) []byte
- func Keccak256Hash(data ...[]byte) (h types.Hash)
- func MBToGB(b uint64) (float64, int)
- func MkdirAll(path string, perm os.FileMode) error
- func NewContext(ctx context.Context, s AppInfo) context.Context
- func PrivateToString(key crypto.PrivKey) (string, error)
- func PublicToString(key crypto.PubKey) (string, error)
- func RunEvery(ctx context.Context, period time.Duration, f func())
- func SortAddresses(ipAddrs []net.IP) []net.IP
- func SplitAndTrim(input string) (ret []string)
- func StringToPrivate(s string) (crypto.PrivKey, error)
- func StringToPublic(s string) (crypto.PubKey, error)
- func ToBytes20(x []byte) [20]byte
- func ToBytes32(x []byte) [32]byte
- func ToBytes4(x []byte) [4]byte
- func ToBytes48(x []byte) [48]byte
- func ToBytes64(x []byte) [64]byte
- func ToBytes96(x []byte) [96]byte
- func Uint256sToH256(u256s []uint256.Int) []*types_pb.H256
- type AppInfo
- type Lock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAddressToH160 ¶
func ConvertBytesToH2048 ¶
func ConvertBytesToH512 ¶
func ConvertFromInterfacePrivKey ¶
func ConvertFromInterfacePrivKey(privkey crypto.PrivKey) (*ecdsa.PrivateKey, error)
func ConvertH160toAddress ¶
func ConvertH2048ToBloom ¶
func ConvertH256ToHash ¶
func ConvertH384ToPublicKey ¶
func ConvertH512ToBytes ¶
func ConvertH512ToHash ¶
func ConvertH768ToSignature ¶
func ConvertHashToH256 ¶
func ConvertHashToH512 ¶
func ConvertPublicKeyToH384 ¶
func ConvertSignatureToH768 ¶
func ConvertToInterfacePrivkey ¶
func ConvertToInterfacePrivkey(privkey *ecdsa.PrivateKey) (crypto.PrivKey, error)
func CreateForkDigest ¶
func CreateForkDigest(currentBlockNr *uint256.Int, genesisValidatorsRoot types.Hash) ([4]byte, error)
CreateForkDigest creates a fork digest from a genesis time and genesis validators root, utilizing the current slot to determine the active fork version in the node.
func EnsureEnoughSize ¶
func ExternalIP ¶
ExternalIP returns the first IPv4/IPv6 available.
func ExternalIPv4 ¶
ExternalIPv4 returns the first IPv4 available.
func Hash256toS ¶
func Keccak256Hash ¶
Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.
func NewContext ¶
NewContext returns a new Context that carries value.
func RunEvery ¶
RunEvery runs the provided command periodically. It runs in a goroutine, and can be cancelled by finishing the supplied context.
func SortAddresses ¶
SortAddresses sorts a set of addresses in the order of ipv4 -> ipv6.
func SplitAndTrim ¶
SplitAndTrim splits input separated by a comma and trims excessive white space from the substrings.
func ToBytes20 ¶
ToBytes20 is a convenience method for converting a byte slice to a fix sized 20 byte array. This method will truncate the input if it is larger than 20 bytes.
func ToBytes32 ¶
ToBytes32 is a convenience method for converting a byte slice to a fix sized 32 byte array. This method will truncate the input if it is larger than 32 bytes.
func ToBytes4 ¶
ToBytes4 is a convenience method for converting a byte slice to a fix sized 4 byte array. This method will truncate the input if it is larger than 4 bytes.
func ToBytes48 ¶
ToBytes48 is a convenience method for converting a byte slice to a fix sized 48 byte array. This method will truncate the input if it is larger than 48 bytes.
func ToBytes64 ¶
ToBytes64 is a convenience method for converting a byte slice to a fix sized 64 byte array. This method will truncate the input if it is larger than 64 bytes.
Types ¶
type AppInfo ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
func NewMultilock ¶
NewMultilock creates a new multilock for the specified keys