core

package
v0.0.0-...-19c2005 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NetStrToId = map[string]uint32{
	"LivePublic": 175,
	"TestNet":    199,
	"Local":      0,
}
View Source
var Networks = map[uint32]string{
	175:  "LivePublic",
	177:  "LivePrivate",
	199:  "Testnet",
	0:    "Local",
	999:  "SubLayer",
	9999: "Fork",
}
View Source
var Version version.SemVer

Functions

func NetworkIdResolver

func NetworkIdResolver(id uint32) string

Types

type Address

type Address interface {
	GenerateNew() *Address
	String() string
	QBX() string
	QBT() string
	Keys() *p2p.Keys
	Decode() *address
	Encode() []byte
	Check(a *Address) bool
	FromAccount(accId string) *Address
	Derive() *Address
}

type Chain

type Chain interface {
	Name() string
	Genesis() GenesisBlock
	Params() map[string]any
	BootNodes() []string
}

type ChainGetter

type ChainGetter interface {
	Import(chain string) (pb.Blockchain, error)
	ImportFromChainId(chainId string) (pb.Blockchain, error)
	ImportFromFilePath(filepath string) (pb.Blockchain, error)
	ImportFromDatabase(db *badger.DB) (pb.Blockchain, error)
}

type ChainImporter

type ChainImporter struct {
	ChainGetter
}

type Consensus

type Consensus interface {
}

type DNAProofing

type DNAProofing interface {
	GetOperator() *pod.DnaOperator
}

type EncodingUtils

type EncodingUtils interface {
	GetEncoder() common.Encoder
	ToUint256()
}

type Fork

type Fork uint64

type Forks

type Forks interface {
	Get(name string) *any
	At(block string) *any
	New(n uint64) *Fork
	Enabled() []uint64
	AutoEnableAt(blockNum uint64) error
}

type GenesisBlock

type GenesisBlock interface {
	Config() *any
	Nonce() [8]byte
	Timestamp() timestamppb.Timestamp
	Pb() *pb.Block
	Raw() []byte
	DNAProof() string
	Hash() any
	Hex() string
	String() string
	Coinbase() string
	Metadata() map[string]any
}

type Params

type Params interface {
	Forks() *Forks
	ChainId() int
	VM() map[string]any
}

type Uint256Util

type Uint256Util interface {
	FromBytes([]byte) *uint256.Int
	FromFloat64(f float64) *uint256.Int
	FromInt64(i int64) *uint256.Int
	FromString(s string) *uint256.Int
	GetAddressFromType(from string, data []byte) string
	SafeMath(operation string, subject map[string]any, result *uint256.Int) error
}

type Wallet

type Wallet interface {
	Address() *Address
	Lock() bool
	Unlock(key []byte) bool
	Backup() (string, error)
	Restore(backupKey []byte, address string, mnemonic string) (bool, error)
	Withdraw()
	SendTX(from Address, to Address, amt uint256.Int) (txId string, success bool, err error)
	Synchronize()
	Balance() *uint256.Int
}

Directories

Path Synopsis
tx

Jump to

Keyboard shortcuts

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