picfightcoin

package module
v0.0.0-...-0ab5c80 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: ISC Imports: 8 Imported by: 5

README

picfightcoin

PicFight coin blockchain consensus implemented in Go

Build Status

Documentation

Index

Constants

View Source
const NetworkAddressPrefix = "J"
View Source
const PROJECT_PREMINE_ADDRESS_STRING = "JsKFRL5ivSH7CnYaTtaBT4M9fZG878g49Fg"
View Source
const PROJECT_PREMINE_POS_ADDRESS_STRING = "JsRjbYZ448FxZQ5kQAc15NcwUQ1oqYydVEG"
View Source
const PicfightCoinWire uint32 = 0xd9b488ff

PicfightCoinWire represents the picfight coin network.

Variables

View Source
var (
	// Address encoding magics
	PubKeyAddrID     = [2]byte{0x1b, 0x2d} // starts with Jk
	PubKeyHashAddrID = [2]byte{0x0a, 0x0f} // starts with Js
	PKHEdwardsAddrID = [2]byte{0x09, 0xef} // starts with Je
	PKHSchnorrAddrID = [2]byte{0x09, 0xd1} // starts with JS
	ScriptHashAddrID = [2]byte{0x09, 0xea} // starts with Jc
	PrivateKeyID     = [2]byte{0x22, 0xce} // starts with Pj
)
View Source
var PremineTotal = calcPremineTotal()

Functions

func EstimateDecredSupply

func EstimateDecredSupply(params *DecredSubsidyParams, height int64, BlockOneSubsidy int64) int64

func EstimateSupplyWithCache

func EstimateSupplyWithCache(cache map[int64]*int64, height int64, CalcBlockSubsidy func(height int64) int64) int64

func GenesisBlockPowBits

func GenesisBlockPowBits() uint32

func GenesisBlockTimestamp

func GenesisBlockTimestamp() time.Time

func MinStakeDifficulty

func MinStakeDifficulty() int64

func NetworkPoWLimit

func NetworkPoWLimit() *difficulty.Difficulty

NetworkPoWLimit is proof-of-work limit parameter.

func OrganizationPkScript

func OrganizationPkScript() []byte

Organization related parameters Organization address is ?

func Premine

func Premine() map[string]coin.Amount

Types

type BlockByBlockSupplyEstimator

type BlockByBlockSupplyEstimator struct {
	SubsidyCalculator SubsidyCalculator
	// contains filtered or unexported fields
}

func (*BlockByBlockSupplyEstimator) Estimate

func (c *BlockByBlockSupplyEstimator) Estimate(height int64) int64

type DecredSubsidyParams

type DecredSubsidyParams struct {

	// BaseSubsidy is the starting subsidy amount for mined blocks.
	BaseSubsidy int64

	// Subsidy reduction multiplier.
	MulSubsidy int64

	// Subsidy reduction divisor.
	DivSubsidy int64

	// SubsidyReductionInterval is the reduction interval in blocks.
	SubsidyReductionInterval int64
}

type PicfightCoinSubsidyCalculator

type PicfightCoinSubsidyCalculator struct {
	// contains filtered or unexported fields
}

func (*PicfightCoinSubsidyCalculator) BlockTaxProportion

func (c *PicfightCoinSubsidyCalculator) BlockTaxProportion() uint16

func (*PicfightCoinSubsidyCalculator) CalcBlockSubsidy

func (c *PicfightCoinSubsidyCalculator) CalcBlockSubsidy(height int64) int64

func (*PicfightCoinSubsidyCalculator) CalcBlockTaxSubsidy

func (c *PicfightCoinSubsidyCalculator) CalcBlockTaxSubsidy(height int64, voters uint16) int64

func (*PicfightCoinSubsidyCalculator) CalcBlockWorkSubsidy

func (c *PicfightCoinSubsidyCalculator) CalcBlockWorkSubsidy(height int64, voters uint16) int64

func (*PicfightCoinSubsidyCalculator) CalcStakeVoteSubsidy

func (c *PicfightCoinSubsidyCalculator) CalcStakeVoteSubsidy(height int64) int64

func (*PicfightCoinSubsidyCalculator) EstimateSupply

func (c *PicfightCoinSubsidyCalculator) EstimateSupply(height int64) int64

func (*PicfightCoinSubsidyCalculator) ExpectedTotalNetworkSubsidy

func (c *PicfightCoinSubsidyCalculator) ExpectedTotalNetworkSubsidy() coin.Amount

func (*PicfightCoinSubsidyCalculator) FirstGeneratingBlockIndex

func (c *PicfightCoinSubsidyCalculator) FirstGeneratingBlockIndex() int64

func (*PicfightCoinSubsidyCalculator) NumberOfGeneratingBlocks

func (c *PicfightCoinSubsidyCalculator) NumberOfGeneratingBlocks() int64

func (*PicfightCoinSubsidyCalculator) PreminedCoins

func (c *PicfightCoinSubsidyCalculator) PreminedCoins() coin.Amount

func (*PicfightCoinSubsidyCalculator) SetEngine

func (c *PicfightCoinSubsidyCalculator) SetEngine(engine bignum.BigNumEngine)

func (*PicfightCoinSubsidyCalculator) StakeRewardProportion

func (c *PicfightCoinSubsidyCalculator) StakeRewardProportion() uint16

func (*PicfightCoinSubsidyCalculator) StakeValidationHeight

func (c *PicfightCoinSubsidyCalculator) StakeValidationHeight() int64

func (*PicfightCoinSubsidyCalculator) SubsidyReductionInterval

func (c *PicfightCoinSubsidyCalculator) SubsidyReductionInterval() int64

func (*PicfightCoinSubsidyCalculator) TicketsPerBlock

func (c *PicfightCoinSubsidyCalculator) TicketsPerBlock() uint16

func (*PicfightCoinSubsidyCalculator) WorkRewardProportion

func (c *PicfightCoinSubsidyCalculator) WorkRewardProportion() uint16

type SubsidyCalculator

type SubsidyCalculator interface {
	ExpectedTotalNetworkSubsidy() coin.Amount
	NumberOfGeneratingBlocks() int64
	PreminedCoins() coin.Amount
	FirstGeneratingBlockIndex() int64
	CalcBlockWorkSubsidy(height int64, voters uint16) int64
	CalcStakeVoteSubsidy(height int64) int64
	CalcBlockTaxSubsidy(height int64, voters uint16) int64
	CalcBlockSubsidy(height int64) int64
	TicketsPerBlock() uint16
	SetEngine(engine bignum.BigNumEngine)
	EstimateSupply(height int64) int64
	WorkRewardProportion() uint16
	StakeRewardProportion() uint16
	BlockTaxProportion() uint16
	StakeValidationHeight() int64
}

func DecredMainNetSubsidy

func DecredMainNetSubsidy() SubsidyCalculator

func PicFightCoinSubsidy

func PicFightCoinSubsidy() SubsidyCalculator

Jump to

Keyboard shortcuts

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