processing

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlockLock = sync.Mutex{}

BlockLock is used to lock block processing to a single parent thread.

View Source
var MaxFailures int

MaxFailures tells Chainquery how many failures a transaction can have before we rollback the block and try to process it it again. This is to stop an indefinite loop. Since transactions can be dependant on one another they can fail if not processed in the right order. We allow parallel processing by putting transactions into a queue, and if they fail to process, for example if its dependant transaction has not been processed yet, then we allow to go back into the queue x times ( MaxFailures ).

Functions

func GetValueAsJSON added in v1.7.0

func GetValueAsJSON(helper claim.ClaimHelper) (string, error)

GetValueAsJSON returns the JSON string of the structure of claim metadata.

func ProcessTx

func ProcessTx(jsonTx *lbrycrd.TxRawResult, blockTime uint64, blockHeight uint64) error

ProcessTx processes an individual transaction from a block.

func RunBlockProcessing

func RunBlockProcessing(height uint64) uint64

RunBlockProcessing runs the processing of a block at a specific height. While any height can be passed in it is important to note that if the previous block is not processed it will panic to prevent corruption because blocks must be processed in order.

Types

type Claim added in v1.7.0

type Claim struct {
	ClaimType string  `json:"claimType"`
	Stream    *Stream `json:"stream"`
}

Claim holds the current Claim structure

type Metadata added in v1.7.0

type Metadata struct {
	Author      string `json:"author"`
	Title       string `json:"title"`
	Description string `json:"description"`
	NSFW        bool   `json:"nsfw"`
}

Metadata holds information that is used via the table column it is assigned for backwards compatibility.

type Source added in v1.7.0

type Source struct {
	ContentType string `json:"contentType"`
}

Source holds the media type of the claim

type Stream added in v1.7.0

type Stream struct {
	Metadata *Metadata `json:"metadata"`
	Source   *Source   `json:"source"`
}

Stream holds the metadata and source

type Value added in v1.7.0

type Value struct {
	Claim *Claim `json:"Claim"`
}

Value holds the current structure for metadata as json that is ensures a major versions backwards compatibility.

Jump to

Keyboard shortcuts

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