toolset

package
v2.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 62 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"

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

	FlagToolOutputPath = "outputPath"

	FlagToolPrivateKey = "privateKey"
	FlagToolPublicKey  = "publicKey"

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

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

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

	FlagToolSnapGenMintAddress        = "mintAddress"
	FlagToolSnapGenTreasuryAllocation = "treasuryAllocation"

	FlagToolDatabaseTargetIndex            = "targetIndex"
	FlagToolDatabaseMergeNodeURL           = "nodeURL"
	FlagToolDatabaseMergeChronicle         = "chronicleMode"
	FlagToolDatabaseMergeChronicleKeyspace = "chronicleKeySpace"
)
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"
)
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.

Types

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 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, blockID iotago.BlockID) (*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, blockID iotago.BlockID) (*storage.CachedMilestone, bool)
}

Jump to

Keyboard shortcuts

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