Versions in this module Expand all Collapse all v0 v0.1.0 Feb 28, 2019 Changes in this version + var ErrInvalidHash = errors.New("invalid hash string") + var ErrInvalidSign = errors.New("invalid sign string") + var HashNew = sha256.New + var SigningCurve = btcec.S256() + var ZeroHash Hash + var ZeroSign Sign + func VerifyTransferHash(sign Sign, transferHash Hash, publicKey *btcec.PublicKey) error + type AccID uint64 + func (id AccID) String() string + type BigChain interface + Fetch func(ctx context.Context, accID AccID, limit int) ([]Txn, *Settings, error) + type Chain interface + GetBalance func(accID AccID) int64 + GetLastHash func(accID AccID) Hash + GetLastNTxns func(accID AccID, n int) []Txn + GetLastTxn func(accID AccID) *Txn + ListUnspentTxns func(accID AccID) []Txn + PutTo func(accID AccID, txns []Txn) + Reset func(AccID) + type Hash [32]byte + func GetHash(h hash.Hash, txn *Txn) Hash + func GetHashDefault(txn *Txn) Hash + func GetHashFromString(s string) (Hash, error) + func GetSettingsHash(h hash.Hash, s *Settings) Hash + func GetSettingsHashDefault(s *Settings) Hash + func GetSettingsRequestHash(h hash.Hash, s *Settings) Hash + func GetSettingsRequestHashDefault(s *Settings) Hash + func GetTransferHash(h hash.Hash, t Transfer) Hash + func GetTransferHashDefault(t Transfer) Hash + func HashFromString(s string) Hash + func (th Hash) String() string + type ID uint64 + type Preloader interface + Preload func(context.Context, AccID) error + Reset func(context.Context, AccID) + type PublicKey []byte + func ParsePubKey(s string) (PublicKey, error) + func (k PublicKey) BTCECKey() (*btcec.PublicKey, error) + func (k PublicKey) String() string + type Pusher interface + Push func(ctx context.Context, txns []Txn) error + type Router interface + GetHostByKey func(key string) string + IsSelf func(node string) bool + Nodes func() []string + SetNodes func(nodes []string) + type Settings struct + Account AccID + DataHash Hash + Hash Hash + ID ID + PrevHash Hash + PublicKey PublicKey + Sign Sign + VerifyTransferSign bool + type SettingsChain interface + GetLastHash func(AccID) Hash + GetLastSettings func(AccID) *Settings + Put func(*Settings) + Reset func(AccID) + type SettingsID struct + func NewSettingsID(acc AccID, id ID) SettingsID + func (t SettingsID) String() string + type SettingsProcessor interface + GetLastSettings func(ctx context.Context, acc AccID) (*Settings, error) + ProcessSettings func(ctx context.Context, s *Settings) (SettingsResult, error) + type SettingsPusher interface + PushSettings func(ctx context.Context, sett *Settings) error + type SettingsResult struct + Hash Hash + SettingsID SettingsID + type Sign [72]byte + func GetSignFromString(s string) (Sign, error) + func SignFromString(s string) Sign + func SignTransfer(transferHash Hash, privKey *btcec.PrivateKey) (Sign, error) + func (s Sign) String() string + type Transfer struct + Batch []*TransferItem + PrevHash Hash + Sender AccID + SettingsID ID + Sign Sign + func NewSingleTransfer(sender, receiver AccID, amount int64) Transfer + func (t *Transfer) AddReceiver(receiver AccID, amount int64) + type TransferItem struct + Amount int64 + Receiver AccID + type TransferProcessor interface + GetBalance func(ctx context.Context, acc AccID) (int64, error) + GetPrevHash func(ctx context.Context, acc AccID) (Hash, error) + ProcessTransfer func(ctx context.Context, t Transfer) (TransferResult, error) + SetPreloader func(Preloader) + SetPusher func(Pusher) + SetSettingsChain func(SettingsChain) + type TransferResult struct + Hash Hash + SettingsId ID + TxnID TxnID + type Txn struct + Amount int64 + Balance int64 + Hash Hash + ID ID + PrevHash Hash + Receiver AccID + Sender AccID + SettingsID ID + Sign Sign + SpentBy ID + type TxnID struct + func NewTxnID(acc AccID, id ID) TxnID + func (t TxnID) String() string