chiawallet

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMinerKeyNotExists = errors.New("miner key not exists")

Functions

func WriteKeystoreToFile

func WriteKeystoreToFile(store *Keystore, filename string, perm os.FileMode) error

Types

type KeyID

type KeyID [2 * chiapos.PublicKeyBytes]byte
var EmptyKeyID KeyID

func NewKeyID

func NewKeyID(farmerPub, poolPub *chiapos.G1Element) KeyID

func (KeyID) Cmp

func (id KeyID) Cmp(target KeyID) int

func (KeyID) FarmerPublicKeyBytes

func (id KeyID) FarmerPublicKeyBytes() []byte

func (KeyID) PoolPublicKeyBytes

func (id KeyID) PoolPublicKeyBytes() []byte

func (KeyID) String

func (id KeyID) String() string

type Keystore

type Keystore struct {
	// contains filtered or unexported fields
}

func NewEmptyKeystore

func NewEmptyKeystore() *Keystore

func NewKeystoreFromFile

func NewKeystoreFromFile(filename string) (*Keystore, error)

func (*Keystore) FromStorage

func (store *Keystore) FromStorage(storage *KeystoreStorage) error

func (*Keystore) GetAllMinerKeys

func (store *Keystore) GetAllMinerKeys() []*MinerKey

func (*Keystore) GetFarmerPrivateKey

func (store *Keystore) GetFarmerPrivateKey(pub *chiapos.G1Element) (*chiapos.PrivateKey, error)

func (*Keystore) GetMinerKey

func (store *Keystore) GetMinerKey(id KeyID) (*MinerKey, error)

func (*Keystore) GetMinerKeyByPoolPublicKey

func (store *Keystore) GetMinerKeyByPoolPublicKey(pub *chiapos.G1Element) (*MinerKey, error)

func (*Keystore) GetPoolPrivateKey

func (store *Keystore) GetPoolPrivateKey(pub *chiapos.G1Element) (*chiapos.PrivateKey, error)

func (*Keystore) SetMinerKey

func (store *Keystore) SetMinerKey(farmerPriv, poolPriv *chiapos.PrivateKey) (KeyID, error)

func (*Keystore) ToStorage

func (store *Keystore) ToStorage() *KeystoreStorage

type KeystoreStorage

type KeystoreStorage struct {
	Keys map[string]string `json:"keys"`
}

func (*KeystoreStorage) Bytes

func (store *KeystoreStorage) Bytes() ([]byte, error)

func (*KeystoreStorage) FromBytes

func (store *KeystoreStorage) FromBytes(data []byte) error

type MinerKey

type MinerKey struct {
	FarmerPrivateKey *chiapos.PrivateKey
	PoolPrivateKey   *chiapos.PrivateKey
	FarmerPublicKey  *chiapos.G1Element
	PoolPublicKey    *chiapos.G1Element
	// contains filtered or unexported fields
}

func (*MinerKey) Copy

func (m *MinerKey) Copy() *MinerKey

func (*MinerKey) Decode

func (m *MinerKey) Decode(data []byte) error

func (*MinerKey) Encode

func (m *MinerKey) Encode() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL