@tevm/voltaire / primitives/SyncStatus
primitives/SyncStatus
Type Aliases
SyncProgress
SyncProgress = object
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:7
Active sync progress information
Properties
currentBlock
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:9readonlycurrentBlock:BlockNumberType
highestBlock
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:10readonlyhighestBlock:BlockNumberType
knownStates?
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:12readonlyoptionalknownStates:Type
pulledStates?
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:11readonlyoptionalpulledStates:Type
startingBlock
Defined in: src/primitives/SyncStatus/SyncStatusType.ts:8readonlystartingBlock:BlockNumberType
SyncStatusType
SyncStatusType =Defined in: src/primitives/SyncStatus/SyncStatusType.ts:34 Sync status from eth_syncing false = not syncing (node is fully synced) object = actively syncing with progress informationfalse|SyncProgress
Example
Variables
SyncStatus
Defined in: src/primitives/SyncStatus/index.ts:44constSyncStatus:object
Type Declaration
from()
from: (Create SyncStatus from RPC responsevalue) =>SyncStatusType=_from
Parameters
value
RPC sync statusboolean | { currentBlock: string | number | bigint; highestBlock: string | number | bigint; knownStates?: string | number | bigint; pulledStates?: string | number | bigint; startingBlock: string | number | bigint; }
Returns
SyncStatusType
SyncStatus
Example
getProgress()
getProgress: (status) =>number
Parameters
status
true | SyncStatusType | { currentBlock: bigint; highestBlock: bigint; startingBlock: bigint; }
Returns
number
isSyncing()
isSyncing: (status) =>boolean
Parameters
status
true | SyncStatusType | { currentBlock: bigint; highestBlock: bigint; startingBlock: bigint; }
Returns
boolean
Functions
_getProgress()
_getProgress(Defined in: src/primitives/SyncStatus/getProgress.js:14 Calculate sync progress as percentagestatus):number
Parameters
status
SyncStatusType
Sync status
Returns
number
Progress percentage (0-100), or 100 if not syncing
Throws
If status is syncing but has invalid block numbersExample
_isSyncing()
_isSyncing(Defined in: src/primitives/SyncStatus/isSyncing.js:16 Check if node is actively syncingstatus):boolean
Parameters
status
SyncStatusType
Sync status
Returns
boolean
True if syncing
Example
from()
from(Defined in: src/primitives/SyncStatus/from.js:17 Create SyncStatus from RPC responsevalue):SyncStatusType
Parameters
value
RPC sync statusboolean | { currentBlock: string | number | bigint; highestBlock: string | number | bigint; knownStates?: string | number | bigint; pulledStates?: string | number | bigint; startingBlock: string | number | bigint; }
Returns
SyncStatusType
SyncStatus
Example
getProgress()
getProgress(Defined in: src/primitives/SyncStatus/index.ts:27status):number
Parameters
status
true | SyncStatusType | { currentBlock: bigint; highestBlock: bigint; startingBlock: bigint; }
Returns
number
isSyncing()
isSyncing(Defined in: src/primitives/SyncStatus/index.ts:14status):boolean
Parameters
status
true | SyncStatusType | { currentBlock: bigint; highestBlock: bigint; startingBlock: bigint; }
Returns
boolean
