Documentation
¶
Index ¶
- Variables
- func ComputeChainIDFromFields(fields [][]byte) [32]byte
- func ComputeChainIDFromStrings(fields []string) [32]byte
- func FactomClientFromConfig(conf *viper.Viper) *factom.Client
- type Pegnetd
- func (d *Pegnetd) ApplyFactoidBlock(ctx context.Context, tx *sql.Tx, dblock *factom.DBlock) error
- func (d *Pegnetd) ApplyGradedOPRBlock(tx *sql.Tx, gradedBlock grader.GradedBlock) error
- func (d *Pegnetd) ApplyTransactionBatchesInHolding(ctx context.Context, sqlTx *sql.Tx, currentHeight uint32) error
- func (d *Pegnetd) ApplyTransactionBlock(sqlTx *sql.Tx, eblock *factom.EBlock) error
- func (d *Pegnetd) DBlockSync(ctx context.Context)
- func (d *Pegnetd) GetCurrentSync() uint32
- func (d *Pegnetd) Grade(ctx context.Context, block *factom.EBlock) (grader.GradedBlock, error)
- func (d *Pegnetd) SyncBlock(ctx context.Context, tx *sql.Tx, height uint32) error
Constants ¶
This section is empty.
Variables ¶
var ( // BurnAddress is the mainnet burn address BurnAddress = "EC2BURNFCT2PEGNETooo1oooo1oooo1oooo1oooo1oooo19wthin" // BurnRCD is the rcd representation of the burn address BurnRCD = [32]byte{} )
var GradingV2Activation uint32 = 210330
var OPRChain = *factom.NewBytes32FromString("a642a8674f46696cc47fdb6b65f9c87b2a19c5ea8123b3d2f0c13b6f33a9d5ef")
var PEGPricingActivation uint32 = 214287
Estimated to be Oct 14 2019, 15:00:00 UTC
var PegnetActivation uint32 = 206421
var TransactionChain = *factom.NewBytes32FromString("cffce0f409ebba4ed236d49d89c70e4bd1f1367d86402a3363366683265a242d")
var TransactionConversionActivation uint32 = 213237
TransactionConversionActivation indicates when tx/conversions go live on mainnet. Target Activation Height is Oct 7, 2019 15 UTC
Functions ¶
func ComputeChainIDFromFields ¶
ComputeChainIDFromFields Takes the binary fields that define a chainID and hashes them together to create the ChainID expected by the APIs. These fields are treated as binary, but could be simple text, like: "Bob's" "Favorite" "Chain"
func ComputeChainIDFromStrings ¶
ComputeChainIDFromStrings Take a set of strings, and compute the chainID. If you have binary fields, you can call factom.ComputeChainIDFromFields directly.
Types ¶
type Pegnetd ¶
type Pegnetd struct {
FactomClient *factom.Client
Config *viper.Viper
Sync *pegnet.BlockSync
Pegnet *pegnet.Pegnet
}
func (*Pegnetd) ApplyFactoidBlock ¶
ApplyFactoidBlock applies the FCT burns that occurred within the given DBlock. If an error is returned, the sql.Tx should be rolled back by the caller.
func (*Pegnetd) ApplyGradedOPRBlock ¶
ApplyGradedOPRBlock pays out PEG to the winners of the given GradedBlock. If an error is returned, the sql.Tx should be rolled back by the caller.
func (*Pegnetd) ApplyTransactionBatchesInHolding ¶
func (d *Pegnetd) ApplyTransactionBatchesInHolding(ctx context.Context, sqlTx *sql.Tx, currentHeight uint32) error
ApplyTransactionBatchesInHolding attempts to apply the transaction batches from previous blocks that were put into holding because they contained conversions. If an error is returned, the sql.Tx should be rolled back by the caller.
func (*Pegnetd) ApplyTransactionBlock ¶
ApplyTransactionBlock puts conversion-containing transaction batches into holding, and applys the balance updates for all transaction batches able to be executed immediately. If an error is returned, the sql.Tx should be rolled back by the caller.
func (*Pegnetd) DBlockSync ¶
DBlockSync iterates through dblocks and syncs the various chains