Documentation ¶
Index ¶
- Variables
- func ComputeChainIDFromFields(fields [][]byte) [32]byte
- func ComputeChainIDFromStrings(fields []string) [32]byte
- func FactomClientFromConfig(conf *viper.Viper) *factom.Client
- func SetAllActivations(act uint32)
- 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, timestamp time.Time) 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 ( OPRChain = *factom.NewBytes32FromString("a642a8674f46696cc47fdb6b65f9c87b2a19c5ea8123b3d2f0c13b6f33a9d5ef") TransactionChain = *factom.NewBytes32FromString("cffce0f409ebba4ed236d49d89c70e4bd1f1367d86402a3363366683265a242d") PegnetActivation uint32 = 206421 GradingV2Activation uint32 = 210330 // TransactionConversionActivation indicates when tx/conversions go live on mainnet. // Target Activation Height is Oct 7, 2019 15 UTC TransactionConversionActivation uint32 = 213237 // This is when PEG is priced by the market cap equation // Estimated to be Oct 14 2019, 15:00:00 UTC PEGPricingActivation uint32 = 214287 // OneWaypFCTConversions makes pFCT a 1 way conversion. This means pFCT->pXXX, // but no asset can go into pFCT. AKA pXXX -/> pFCT. // The only way to aquire pFCT is to burn FCT. The burn command will remain. // Estimated to be Nov 25, 2019 17:47:00 UTC OneWaypFCTConversions uint32 = 220346 // Once this is activated, a maximum amount of PEG of 5,000 can be // converted per block. At a future height, a dynamic bank should be used. // Estimated to be Dec 9, 2019, 17:00 UTC PegnetConversionLimitActivation uint32 = 222270 // This is when PEG price is determined by the exchange price // Estimated to be Dec 9, 2019, 17:00 UTC PEGFreeFloatingPriceActivation uint32 = 222270 )
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.
func SetAllActivations ¶
func SetAllActivations(act uint32)
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 ¶
func (d *Pegnetd) ApplyGradedOPRBlock(tx *sql.Tx, gradedBlock grader.GradedBlock, timestamp time.Time) error
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