github.com/TrueBlocks/trueblocks-core/src/apps/chifra@v0.0.0-20241022031540-b362680128f7/pkg/manifest/manifest.go (about)

     1  package manifest
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/base"
     7  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/configtypes"
     8  	"github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/types"
     9  )
    10  
    11  // Manifest is a data structure consisting of a list of chunk records (i.e. block ranges, Bloom
    12  // filter hashes, and chunk hashes) and the nessacary additional information needed to
    13  // reproduce the index from scratch using only the node as source of truth.
    14  type Manifest struct {
    15  	// The specification version used to build this instance of Unchained Index
    16  	Version string `json:"version"`
    17  
    18  	// The chain against which this index was created
    19  	Chain string `json:"chain"`
    20  
    21  	// An IPFS hash pointing to documentation describing the binary format of the files in the index
    22  	Specification base.IpfsHash `json:"specification"`
    23  
    24  	// An IPFS hash pointing to documentation describing the binary format of the files in the index
    25  	Config configtypes.ScrapeSettings `json:"config"`
    26  
    27  	// A list of pinned chunks (see types.ChunkRecord) detailing the location of all chunks in the index and associated bloom filters
    28  	Chunks []types.ChunkRecord `json:"chunks"`
    29  
    30  	// A map to make set membership easier
    31  	ChunkMap map[string]*types.ChunkRecord `json:"-"`
    32  }
    33  
    34  type Source int
    35  
    36  const (
    37  	None Source = 1 << iota
    38  	LocalCache
    39  	FromContract
    40  	TempContract
    41  )
    42  
    43  var ErrManifestNotFound = errors.New("could not find manifest.json or it was empty")