Documentation ¶
Overview ¶
archiver takes transactions and settings, collects them to blocks, calculates hash of blocks, creates archives, pushes hash to some blockchain(s), uploads archives to external storage
you can easily verify block hash by command: tar xf archive.tar -O --wildcards "*/settings" "*/txns" | sha256sum you can even get hasher command like this: `tar xf archive.tar -O --wildcards "*/metadata.json" | jq -r .HashType`sum and by the same way you can extract block hash: tar xf archiver.tar -O --wildcards "*/metadata.json" | jq -r .Hash
DB buckets
Txns : <block_hash>/<type>/<txn_id> -> <txn json> Index : <type>/<txn_id> -> <block_hash> Blocks : <block_hash> -> <block>
Index ¶
- Constants
- func Handler(a *Archiver) http.Handler
- type Archiver
- func (a *Archiver) Block(ctx context.Context, hash BlockHash) (*BlockMeta, error)
- func (a *Archiver) CheckSettings(ctx context.Context, tid pt.SettingsID) (*BlockMeta, error)
- func (a *Archiver) CheckTxn(ctx context.Context, tid pt.TxnID) (*BlockMeta, error)
- func (a *Archiver) LastBlock(ctx context.Context) (*BlockMeta, error)
- func (a *Archiver) Push(ctx context.Context, txns []pt.Txn) error
- func (a *Archiver) PushSettings(ctx context.Context, sett *pt.Settings) error
- func (a *Archiver) Rotate() error
- func (a *Archiver) SetMinio(c *MinioConfig) error
- func (a *Archiver) Start(d time.Duration) error
- type BlockHash
- type BlockMeta
- type HashType
- type MinioConfig
- type Status
Constants ¶
View Source
const ( TxnsBucket = "txns" BlocksBucket = "blocks" IndexBucket = "idx" TxnsDir = "txns" SettingsDir = "settings" LastBlock = "last" )
View Source
const (
HashSHA256 = "sha256"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Archiver ¶
type Archiver struct {
// contains filtered or unexported fields
}
func (*Archiver) CheckSettings ¶
func (*Archiver) PushSettings ¶
func (*Archiver) SetMinio ¶
func (a *Archiver) SetMinio(c *MinioConfig) error
type BlockHash ¶
var ZeroBlockHash BlockHash
func NewBlockHash ¶
func NewBlockHashFromString ¶
NewBlockHashFromString is not safe, it can be used only for tests or constants
func (BlockHash) MarshalJSON ¶
func (*BlockHash) UnmarshalJSON ¶
type MinioConfig ¶
Click to show internal directories.
Click to hide internal directories.