bios

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AN = eos.AN

AN is a shortcut to create an AccountName

View Source
var PN = eos.PN

PN is a shortcut to create a PermissionName

Functions

func AccountToNodeID added in v0.7.3

func AccountToNodeID(acct eos.AccountName) int64

func ChunkifyActions added in v0.8.9

func ChunkifyActions(actions []*eos.Action) (out [][]*eos.Action)

func Retry added in v0.8.9

func Retry(attempts int, sleep time.Duration, callback func() error) (err error)

func ScanLinesUntilBlank

func ScanLinesUntilBlank() (out string, err error)

func ScanSingleLine

func ScanSingleLine() (out string, err error)

Types

type ActionMap added in v0.6.9

type ActionMap map[string]*eos.Action

type BIOS

type BIOS struct {
	Log       *Logger
	CachePath string

	TargetNetAPI       *eos.API
	Snapshot           Snapshot
	BootSequenceFile   string
	BootSequence       *BootSeq
	WriteActions       bool
	HackVotingAccounts bool
	ReuseGenesis       bool

	Genesis *GenesisJSON

	EphemeralPrivateKey *ecc.PrivateKey
	EphemeralPublicKey  ecc.PublicKey
}

func NewBIOS

func NewBIOS(logger *Logger, cachePath string, targetAPI *eos.API) *BIOS

func (*BIOS) Boot added in v1.1.0

func (b *BIOS) Boot() error

func (*BIOS) DispatchBootNode

func (b *BIOS) DispatchBootNode(genesisJSON, publicKey, privateKey string) error

func (*BIOS) DownloadReferences added in v1.1.0

func (b *BIOS) DownloadReferences() error

func (*BIOS) DownloadURL added in v1.1.0

func (b *BIOS) DownloadURL(ref string, hash string) error

func (*BIOS) FileNameFromCache added in v1.1.0

func (b *BIOS) FileNameFromCache(ref string) string

func (*BIOS) GenerateEphemeralPrivKey

func (b *BIOS) GenerateEphemeralPrivKey() (*ecc.PrivateKey, error)

func (*BIOS) GenerateGenesisJSON

func (b *BIOS) GenerateGenesisJSON(pubKey string) string

func (*BIOS) GetContentsCacheRef

func (b *BIOS) GetContentsCacheRef(filename string) (string, error)

func (*BIOS) LoadGenesisFromFile added in v1.0.3

func (b *BIOS) LoadGenesisFromFile(pubkey string) (string, error)

func (*BIOS) ReadFromCache added in v1.1.0

func (b *BIOS) ReadFromCache(ref string) ([]byte, error)

func (*BIOS) ReaderFromCache added in v1.1.0

func (b *BIOS) ReaderFromCache(ref string) (io.ReadCloser, error)

func (*BIOS) RunChainValidation added in v0.7.9

func (b *BIOS) RunChainValidation() (bool, error)

type BootSeq added in v1.1.0

type BootSeq struct {
	Keys         map[string]string `json:"keys"`
	Contents     []*ContentRef     `json:"contents"`
	BootSequence []*OperationType  `json:"boot_sequence"`
}

func ReadBootSeq added in v1.1.0

func ReadBootSeq(filename string) (out *BootSeq, err error)

type ContentRef added in v1.1.0

type ContentRef struct {
	Name string `json:"name"`
	URL  string `json:"url"`
	Hash string `json:"hash"`
}

type GenesisJSON

type GenesisJSON struct {
	InitialTimestamp string `json:"initial_timestamp"`
	InitialKey       string `json:"initial_key"`
}

TODO: update with latest GenesisJSON with the basic parameters...

type Logger added in v0.6.9

type Logger struct {
	OutputFile   io.Writer
	OutputScreen io.Writer
	Debug        bool
}

func NewLogger added in v0.6.9

func NewLogger() *Logger

func (*Logger) Debugf added in v0.6.9

func (l *Logger) Debugf(format string, args ...interface{})

func (*Logger) Debugln added in v0.6.9

func (l *Logger) Debugln(args ...interface{})

func (*Logger) Printf added in v0.6.9

func (l *Logger) Printf(format string, args ...interface{})

func (*Logger) Println added in v0.6.9

func (l *Logger) Println(args ...interface{})

type OpCreateToken

type OpCreateToken struct {
	Account eos.AccountName `json:"account"`
	Amount  eos.Asset       `json:"amount"`
}

func (*OpCreateToken) Actions

func (op *OpCreateToken) Actions(b *BIOS) (out []*eos.Action, err error)

type OpCreateVoters added in v0.8.9

type OpCreateVoters struct {
	Creator eos.AccountName
	Pubkey  string
	Count   int
}

func (*OpCreateVoters) Actions added in v0.8.9

func (op *OpCreateVoters) Actions(b *BIOS) (out []*eos.Action, err error)

type OpInjectUnregdSnapshot added in v0.8.0

type OpInjectUnregdSnapshot struct {
	TestnetTruncateSnapshot int `json:"TESTNET_TRUNCATE_SNAPSHOT"`
}

func (*OpInjectUnregdSnapshot) Actions added in v0.8.0

func (op *OpInjectUnregdSnapshot) Actions(b *BIOS) (out []*eos.Action, err error)

type OpIssueToken

type OpIssueToken struct {
	Account eos.AccountName
	Amount  eos.Asset
	Memo    string
}

func (*OpIssueToken) Actions

func (op *OpIssueToken) Actions(b *BIOS) (out []*eos.Action, err error)

type OpNewAccount

type OpNewAccount struct {
	Creator    eos.AccountName
	NewAccount eos.AccountName `json:"new_account"`
	Pubkey     string
}

func (*OpNewAccount) Actions

func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error)

type OpResignAccounts added in v0.9.0

type OpResignAccounts struct {
	Accounts            []eos.AccountName
	TestnetKeepAccounts bool `json:"TESTNET_KEEP_ACCOUNTS"`
}

func (*OpResignAccounts) Actions added in v0.9.0

func (op *OpResignAccounts) Actions(b *BIOS) (out []*eos.Action, err error)

type OpSetCode

type OpSetCode struct {
	Account         eos.AccountName
	ContractNameRef string `json:"contract_name_ref"`
}

func (*OpSetCode) Actions

func (op *OpSetCode) Actions(b *BIOS) (out []*eos.Action, err error)

type OpSetPriv

type OpSetPriv struct {
	Account eos.AccountName
}

func (*OpSetPriv) Actions

func (op *OpSetPriv) Actions(b *BIOS) (out []*eos.Action, err error)

type OpSetProds

type OpSetProds struct {
}

func (*OpSetProds) Actions

func (op *OpSetProds) Actions(b *BIOS) (out []*eos.Action, err error)

type OpSetRAM added in v0.7.1

type OpSetRAM struct {
	MaxRAMSize uint64 `json:"max_ram_size"`
}

func (*OpSetRAM) Actions added in v0.7.1

func (op *OpSetRAM) Actions(b *BIOS) (out []*eos.Action, err error)

type OpSnapshotCreateAccounts added in v0.8.0

type OpSnapshotCreateAccounts struct {
	BuyRAMBytes             uint64 `json:"buy_ram_bytes"`
	TestnetTruncateSnapshot int    `json:"TESTNET_TRUNCATE_SNAPSHOT"`
}

func (*OpSnapshotCreateAccounts) Actions added in v0.8.0

func (op *OpSnapshotCreateAccounts) Actions(b *BIOS) (out []*eos.Action, err error)

type Operation

type Operation interface {
	Actions(b *BIOS) ([]*eos.Action, error)
}

type OperationType

type OperationType struct {
	Op    string
	Label string
	Data  Operation
}

func (*OperationType) UnmarshalJSON

func (o *OperationType) UnmarshalJSON(data []byte) error

type Snapshot

type Snapshot []SnapshotLine

func NewSnapshot

func NewSnapshot(content []byte) (out Snapshot, err error)

type SnapshotLine

type SnapshotLine struct {
	EthereumAddress string
	EOSPublicKey    ecc.PublicKey
	Balance         eos.Asset
	AccountName     string
}

type UnregdSnapshot added in v0.8.0

type UnregdSnapshot []UnregdSnapshotLine

func NewUnregdSnapshot added in v0.8.0

func NewUnregdSnapshot(content []byte) (out UnregdSnapshot, err error)

type UnregdSnapshotLine added in v0.8.0

type UnregdSnapshotLine struct {
	EthereumAddress string
	AccountName     string
	Balance         eos.Asset
}

type ValidationError added in v0.7.9

type ValidationError struct {
	Err               error
	BlockNumber       int
	Action            *eos.Action
	RawAction         []byte
	Index             int
	ActionHexData     string
	PackedTransaction *eos.PackedTransaction
}

func (ValidationError) Error added in v0.7.9

func (e ValidationError) Error() string

type ValidationErrors added in v0.7.9

type ValidationErrors struct {
	Errors []error
}

func (ValidationErrors) Error added in v0.7.9

func (v ValidationErrors) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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