toolset

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 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"

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

	FlagToolOutputPath = "outputPath"

	FlagToolPrivateKey = "privateKey"
	FlagToolPublicKey  = "publicKey"

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

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

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

	FlagToolCoordinatorFixStateCooStateFilePath = "stateFilePath"

	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"
	ToolDatabaseSplit           = "db-split"
	ToolDatabaseVerify          = "db-verify"
	ToolCoordinatorFixStateFile = "coo-fix-state"
)
View Source
const (
	DefaultValueAPIJWTTokenSalt          = "HORNET"
	DefaultValueMainnetDatabasePath      = "mainnetdb"
	DefaultValueP2PDatabasePath          = "p2pstore"
	DefaultValueCoordinatorStateFilePath = "coordinator.state"
	DefaultValueDatabaseEngine           = database.EngineRocksDB
)

Variables

View Source
var (
	// 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 added in v1.2.2

func ShouldHandleTools() bool

ShouldHandleTools checks if tools were requested.

Types

type GetMessageFunc added in v1.2.2

type GetMessageFunc func(messageID hornet.MessageID) (*iotago.Message, error)

type ProxyStorage added in v1.2.2

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 added in v1.2.2

func NewProxyStorage(
	storeTarget *storage.Storage,
	milestoneManager *milestonemanager.MilestoneManager,
	getMessageFunc GetMessageFunc) (*ProxyStorage, error)

func (*ProxyStorage) CachedMessage added in v1.2.2

func (s *ProxyStorage) CachedMessage(messageID hornet.MessageID) (*storage.CachedMessage, error)

message +1

func (*ProxyStorage) CachedMessageMetadata added in v1.2.2

func (s *ProxyStorage) CachedMessageMetadata(messageID hornet.MessageID) (*storage.CachedMetadata, error)

meta +1

func (*ProxyStorage) Cleanup added in v1.2.2

func (s *ProxyStorage) Cleanup()

Cleanup shuts down, flushes and closes the proxy store.

func (*ProxyStorage) MergeStorages added in v1.2.2

func (s *ProxyStorage) MergeStorages() error

func (*ProxyStorage) SolidEntryPointsContain added in v1.2.2

func (s *ProxyStorage) SolidEntryPointsContain(messageID hornet.MessageID) (bool, error)

func (*ProxyStorage) SolidEntryPointsIndex added in v1.2.2

func (s *ProxyStorage) SolidEntryPointsIndex(messageID hornet.MessageID) (milestone.Index, bool, error)

func (*ProxyStorage) StoreChild added in v1.2.2

func (s *ProxyStorage) StoreChild(parentMessageID hornet.MessageID, childMessageID hornet.MessageID) *storage.CachedChild

func (*ProxyStorage) StoreIndexation added in v1.2.2

func (s *ProxyStorage) StoreIndexation(index []byte, messageID hornet.MessageID) *storage.CachedIndexation

func (*ProxyStorage) StoreMessageIfAbsent added in v1.2.2

func (s *ProxyStorage) StoreMessageIfAbsent(message *storage.Message) (cachedMsg *storage.CachedMessage, newlyAdded bool)

StoreMessageInterface

func (*ProxyStorage) StoreMilestoneIfAbsent added in v1.2.2

func (s *ProxyStorage) StoreMilestoneIfAbsent(index milestone.Index, messageID hornet.MessageID, timestamp time.Time) (*storage.CachedMilestone, bool)

type StoreMessageInterface added in v1.2.2

type StoreMessageInterface interface {
	StoreMessageIfAbsent(message *storage.Message) (cachedMsg *storage.CachedMessage, newlyAdded bool)
	StoreChild(parentMessageID hornet.MessageID, childMessageID hornet.MessageID) *storage.CachedChild
	StoreIndexation(index []byte, messageID hornet.MessageID) *storage.CachedIndexation
	StoreMilestoneIfAbsent(index milestone.Index, messageID hornet.MessageID, timestamp time.Time) (*storage.CachedMilestone, bool)
}

Jump to

Keyboard shortcuts

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