Documentation ¶
Index ¶
- Constants
- func InitIPFSBlockService(ipfsPath string) (blockservice.BlockService, error)
- func NewDB() (*sqlx.DB, error)
- func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte) (string, error)
- func RawdataToCid(codec uint64, rawdata []byte, multiHash uint64) (cid.Cid, error)
- func ResetTestDB(db *sqlx.DB) error
- type Config
- type Validator
- func (v *Validator) Close() error
- func (v *Validator) GetCacheStats() groupcache.Stats
- func (v *Validator) ValidateStateTrie(stateRoot common.Hash) error
- func (v *Validator) ValidateStorageTrie(address common.Address, storageRoot common.Hash) error
- func (v *Validator) ValidateTrie(stateRoot common.Hash) error
Constants ¶
const ( DATABASE_NAME = "DATABASE_NAME" DATABASE_HOSTNAME = "DATABASE_HOSTNAME" DATABASE_PORT = "DATABASE_PORT" DATABASE_USER = "DATABASE_USER" DATABASE_PASSWORD = "DATABASE_PASSWORD" )
Env variables
Variables ¶
This section is empty.
Functions ¶
func InitIPFSBlockService ¶
InitIPFSBlockService is used to configure and return a BlockService using an ipfs repo path (e.g. ~/.ipfs)
func PublishRaw ¶
PublishRaw derives a cid from raw bytes and provided codec and multihash type, and writes it to the db tx
func RawdataToCid ¶
RawdataToCid takes the desired codec, multihash type, and a slice of bytes and returns the proper cid of the object.
func ResetTestDB ¶
ResetTestDB drops all rows in the test db public.blocks table
Types ¶
type Config ¶
func (*Config) ConnString ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is used for validating Ethereum state and storage tries on PG-IPFS
func NewIPFSValidator ¶
func NewIPFSValidator(bs blockservice.BlockService) *Validator
NewIPFSValidator returns a new trie validator ontop of an IPFS blockservice
func NewPGIPFSValidator ¶
NewPGIPFSValidator returns a new trie validator ontop of a connection pool for an IPFS backing Postgres database
func NewValidator ¶
func NewValidator(kvs ethdb.KeyValueStore, database ethdb.Database) *Validator
NewValidator returns a new trie validator Validating the completeness of a modified merkle patricia tries requires traversing the entire trie and verifying that every node is present, this is an expensive operation
func (*Validator) Close ¶ added in v0.0.2
Close implements io.Closer it deregisters the groupcache name
func (*Validator) GetCacheStats ¶
func (v *Validator) GetCacheStats() groupcache.Stats
func (*Validator) ValidateStateTrie ¶
ValidateStateTrie returns an error if the state trie for the provided state root cannot be confirmed as complete This does not consider child storage tries
func (*Validator) ValidateStorageTrie ¶
ValidateStorageTrie returns an error if the storage trie for the provided storage root and contract address cannot be confirmed as complete