toolset

package
v2.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagToolDatabaseEngine       = "databaseEngine"
	FlagToolDatabaseEngineSource = "sourceDatabaseEngine"
	FlagToolDatabaseEngineTarget = "targetDatabaseEngine"

	FlagToolConfigFilePath = "configFile"

	FlagToolDatabasePath       = "databasePath"
	FlagToolDatabasePathSource = "sourceDatabasePath"
	FlagToolDatabasePathTarget = "targetDatabasePath"

	FlagToolProtocolParametersPath = "protocolParametersPath"
	FlagToolCoordinatorStatePath   = "cooStatePath"
	FlagToolGenesisAddressesPath   = "genesisAddressesPath"
	FlagToolGenesisAddresses       = "genesisAddresses"

	FlagToolSnapshotPath       = "snapshotPath"
	FlagToolSnapshotPathFull   = "fullSnapshotPath"
	FlagToolSnapshotPathDelta  = "deltaSnapshotPath"
	FlagToolSnapshotPathTarget = "targetSnapshotPath"
	FlagToolSnapshotGlobal     = "global"

	FlagToolOutputPath = "outputPath"

	FlagToolPrivateKey = "privateKey"
	FlagToolPublicKey  = "publicKey"

	FlagToolHRP       = "hrp"
	FlagToolBIP32Path = "bip32Path"
	FlagToolMnemonic  = "mnemonic"
	FlagToolPassword  = "password"
	FlagToolSalt      = "salt"

	FlagToolNodeURL = "nodeURL"

	FlagToolOutputJSON            = "json"
	FlagToolDescriptionOutputJSON = "format output as JSON"

	FlagToolBenchmarkCount    = "count"
	FlagToolBenchmarkSize     = "size"
	FlagToolBenchmarkThreads  = "threads"
	FlagToolBenchmarkDuration = "duration"

	FlagToolSnapGenMintAddress        = "mintAddress"
	FlagToolSnapGenTreasuryAllocation = "treasuryAllocation"

	FlagToolDatabaseTargetIndex = "targetIndex"
)
View Source
const (
	ToolPwdHash                = "pwd-hash"
	ToolP2PIdentityGen         = "p2pidentity-gen"
	ToolP2PExtractIdentity     = "p2pidentity-extract"
	ToolEd25519Key             = "ed25519-key"
	ToolEd25519Addr            = "ed25519-addr"
	ToolJWTApi                 = "jwt-api"
	ToolSnapGen                = "snap-gen"
	ToolSnapMerge              = "snap-merge"
	ToolSnapInfo               = "snap-info"
	ToolSnapHash               = "snap-hash"
	ToolBenchmarkIO            = "bench-io"
	ToolBenchmarkCPU           = "bench-cpu"
	ToolDatabaseLedgerHash     = "db-hash"
	ToolDatabaseHealth         = "db-health"
	ToolDatabaseMerge          = "db-merge"
	ToolDatabaseMigration      = "db-migration"
	ToolDatabaseSnapshot       = "db-snapshot"
	ToolDatabaseVerify         = "db-verify"
	ToolBootstrapPrivateTangle = "bootstrap-private-tangle"
	ToolNodeInfo               = "node-info"
)
View Source
const (
	DefaultValueAPIJWTTokenSalt     = "HORNET"
	DefaultValueMainnetDatabasePath = "mainnetdb"
	DefaultValueP2PDatabasePath     = "p2pstore"
	DefaultValueDatabaseEngine      = database.EngineRocksDB
)

Variables

View Source
var (
	// ErrCritical is returned when a critical error stops the execution of a task.
	ErrCritical = errors.New("critical error")
)
View Source
var (
	// ErrNoNewTangleData is returned when there is no new data in the source database.
	ErrNoNewTangleData = errors.New("no new tangle history available")
)

Functions

func HandleTools

func HandleTools()

HandleTools handles available tools.

func ShouldHandleTools

func ShouldHandleTools() bool

ShouldHandleTools checks if tools were requested.

func TransactionIDFromIndex

func TransactionIDFromIndex(index int64) iotago.TransactionID

Types

type AddressWithBalance

type AddressWithBalance struct {
	Address iotago.Address
	Balance uint64
}

type CoordinatorState

type CoordinatorState struct {
	LatestMilestoneIndex   iotago.MilestoneIndex `json:"latestMilestoneIndex"`
	LatestMilestoneBlockID string                `json:"latestMilestoneBlockId"`
	LatestMilestoneID      string                `json:"latestMilestoneId"`
	LatestMilestoneTime    int64                 `json:"latestMilestoneTime"`
}

CoordinatorState is the JSON representation of a coordinator state.

type GenesisAddresses

type GenesisAddresses struct {
	Balances []*AddressWithBalance
}

func (*GenesisAddresses) MarshalJSON

func (g *GenesisAddresses) MarshalJSON() ([]byte, error)

func (*GenesisAddresses) Sort

func (g *GenesisAddresses) Sort()

Sort sorts the addresses based on the address and balance in case they are equal.

func (*GenesisAddresses) TotalBalance

func (g *GenesisAddresses) TotalBalance() uint64

TotalBalance calculates the total balance of all genesis addresses.

func (*GenesisAddresses) UnmarshalJSON

func (g *GenesisAddresses) UnmarshalJSON(bytes []byte) error

type GetBlockFunc

type GetBlockFunc func(blockID iotago.BlockID) (*iotago.Block, error)

type ProxyStorage

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

ProxyStorage is used to temporarily store changes to an intermediate storage, which then can be merged with the target store in a single commit.

func NewProxyStorage

func NewProxyStorage(
	protoParams *iotago.ProtocolParameters,
	storeTarget *storage.Storage,
	milestoneManager *milestonemanager.MilestoneManager,
	getBlockFunc GetBlockFunc) (*ProxyStorage, error)

func (*ProxyStorage) CachedBlock

func (s *ProxyStorage) CachedBlock(blockID iotago.BlockID) (*storage.CachedBlock, error)

CachedBlock returns a cached block object. block +1.

func (*ProxyStorage) CachedBlockMetadata

func (s *ProxyStorage) CachedBlockMetadata(blockID iotago.BlockID) (*storage.CachedMetadata, error)

CachedBlockMetadata returns a cached block metadata object. meta +1.

func (*ProxyStorage) Cleanup

func (s *ProxyStorage) Cleanup()

Cleanup shuts down, flushes and closes the proxy store.

func (*ProxyStorage) MergeStorages

func (s *ProxyStorage) MergeStorages() error

func (*ProxyStorage) SolidEntryPointsContain

func (s *ProxyStorage) SolidEntryPointsContain(blockID iotago.BlockID) (bool, error)

func (*ProxyStorage) SolidEntryPointsIndex

func (s *ProxyStorage) SolidEntryPointsIndex(blockID iotago.BlockID) (iotago.MilestoneIndex, bool, error)

func (*ProxyStorage) StoreBlockIfAbsent

func (s *ProxyStorage) StoreBlockIfAbsent(block *storage.Block) (cachedBlock *storage.CachedBlock, newlyAdded bool)

func (*ProxyStorage) StoreChild

func (s *ProxyStorage) StoreChild(parentBlockID iotago.BlockID, childBlockID iotago.BlockID) *storage.CachedChild

func (*ProxyStorage) StoreMilestoneIfAbsent

func (s *ProxyStorage) StoreMilestoneIfAbsent(milestone *iotago.Milestone) (*storage.CachedMilestone, bool)

type StoreBlockInterface

type StoreBlockInterface interface {
	StoreBlockIfAbsent(block *storage.Block) (cachedBlock *storage.CachedBlock, newlyAdded bool)
	StoreChild(parentBlockID iotago.BlockID, childBlockID iotago.BlockID) *storage.CachedChild
	StoreMilestoneIfAbsent(milestonePayload *iotago.Milestone) (*storage.CachedMilestone, bool)
}

Jump to

Keyboard shortcuts

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