Documentation ¶
Index ¶
- Constants
- Variables
- func HandleTools()
- func ShouldHandleTools() bool
- func TransactionIDFromIndex(index int64) iotago.TransactionID
- type AddressWithBalance
- type CoordinatorState
- type GenesisAddresses
- type GetBlockFunc
- type ProxyStorage
- func (s *ProxyStorage) CachedBlock(blockID iotago.BlockID) (*storage.CachedBlock, error)
- func (s *ProxyStorage) CachedBlockMetadata(blockID iotago.BlockID) (*storage.CachedMetadata, error)
- func (s *ProxyStorage) Cleanup()
- func (s *ProxyStorage) MergeStorages() error
- func (s *ProxyStorage) SolidEntryPointsContain(blockID iotago.BlockID) (bool, error)
- func (s *ProxyStorage) SolidEntryPointsIndex(blockID iotago.BlockID) (iotago.MilestoneIndex, bool, error)
- func (s *ProxyStorage) StoreBlockIfAbsent(block *storage.Block) (cachedBlock *storage.CachedBlock, newlyAdded bool)
- func (s *ProxyStorage) StoreChild(parentBlockID iotago.BlockID, childBlockID iotago.BlockID) *storage.CachedChild
- func (s *ProxyStorage) StoreMilestoneIfAbsent(milestone *iotago.Milestone) (*storage.CachedMilestone, bool)
- type StoreBlockInterface
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 ShouldHandleTools ¶
func ShouldHandleTools() bool
ShouldHandleTools checks if tools were requested.
func TransactionIDFromIndex ¶
func TransactionIDFromIndex(index int64) iotago.TransactionID
Types ¶
type AddressWithBalance ¶
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 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) }
Source Files ¶
- benchmark.go
- benchmark_cpu.go
- benchmark_io.go
- database.go
- database_hash.go
- database_health.go
- database_merge.go
- database_migration.go
- database_snapshot.go
- database_verify.go
- ed25519.go
- jwt.go
- network_bootstrap.go
- node_info.go
- p2p_identity_extract.go
- p2p_identity_gen.go
- pwd_hash.go
- snap_gen.go
- snap_hash.go
- snap_info.go
- snap_merge.go
- toolset.go
Click to show internal directories.
Click to hide internal directories.