blockdb

package
v0.0.0-...-1b15b10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2020 ChainSafe Systems SPDX-License-Identifier: LGPL-3.0-only

Index

Constants

View Source
const PathPostfix = ".chainbridge/blockstore"

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockstore

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

Blockstore implements Blockstorer.

func NewBlockStoreDB

func NewBlockStoreDB(relayerAddress string, blockstorePath string, chainID utils.ChainId, freshStart bool, startBlock *big.Int) (*Blockstore, error)

func NewBlockstore

func NewBlockstore(path string, chain utils.ChainId, relayer string) (*Blockstore, error)

func (*Blockstore) StoreBlock

func (b *Blockstore) StoreBlock(block *big.Int) error

StoreBlock writes the block number to disk.

func (*Blockstore) TryLoadLatestBlock

func (b *Blockstore) TryLoadLatestBlock() (*big.Int, error)

TryLoadLatestBlock will attempt to load the latest block for the chain/relayer pair, returning 0 if not found. Passing an empty string for path will cause it to use the home directory.

Jump to

Keyboard shortcuts

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