Documentation ¶
Index ¶
- func AddAssetEntry(mstate *MinerState)
- func AddOpr(mstate *MinerState, nonce []byte)
- func CreateOPRChain(mstate *MinerState)
- func CreatePegNetChain(mstate *MinerState)
- func FundWallet(m *MinerState) (err error)
- func GetFirstNonce() []byte
- func GradeLastBlock(mstate *MinerState, opr *oprecord.OraclePriceRecord, dbht int64, miner *Mine)
- func InitNetwork(mstate *MinerState, minerNumber int, opr *oprecord.OraclePriceRecord)
- func NewEntry(chainID string, extIDs [][]byte, content []byte) *factom.Entry
- func NewEntryStr(chainID string, extIDs []string, content string) *factom.Entry
- type FactomEvent
- type FactomdMonitor
- type Mine
- type MinerState
- func (m *MinerState) GetCoinbasePNTAddress() string
- func (m *MinerState) GetECAddress() string
- func (m *MinerState) GetFCTAddress() string
- func (m *MinerState) GetIdentityChainID() string
- func (m *MinerState) GetOraclePriceRecordChain() string
- func (m *MinerState) GetOraclePriceRecordExtIDs() []string
- func (m *MinerState) GetProtocolChain() string
- func (m *MinerState) GetProtocolChainExtIDs() []string
- func (m *MinerState) LoadConfig()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAssetEntry ¶
func AddAssetEntry(mstate *MinerState)
The Pegged Network has a defining chain. This function builds and returns the expected defining chain for the network.
func AddOpr ¶
func AddOpr(mstate *MinerState, nonce []byte)
The Pegged Network has a defining chain. This function builds and returns the expected defining chain for the network.
func CreateOPRChain ¶
func CreateOPRChain(mstate *MinerState)
The Pegged Network has a defining chain. This function builds and returns the expected defining chain for the network.
func CreatePegNetChain ¶
func CreatePegNetChain(mstate *MinerState)
The Pegged Network has a defining chain. This function builds and returns the expected defining chain for the network.
func FundWallet ¶
func FundWallet(m *MinerState) (err error)
FundWallet() This is just a debugging function. These addresses work when run against a LOCAL network simulation.
func GetFirstNonce ¶
func GetFirstNonce() []byte
Create a nonce of eight bytes of zeros followed by 24 bytes of random values
func GradeLastBlock ¶
func GradeLastBlock(mstate *MinerState, opr *oprecord.OraclePriceRecord, dbht int64, miner *Mine)
func InitNetwork ¶
func InitNetwork(mstate *MinerState, minerNumber int, opr *oprecord.OraclePriceRecord)
Types ¶
type FactomEvent ¶
type FactomdMonitor ¶
type FactomdMonitor struct {
// contains filtered or unexported fields
}
FactomdMonitor Running multiple Monitors is problematic and should be avoided if possible
func (*FactomdMonitor) GetBlockTime ¶
func (f *FactomdMonitor) GetBlockTime() int64
GetBlockTime Returns the blocktime in seconds. All blocks are divided into 10 "minute" sections. But if the blocktime is not 600 seconds, then a minute = the blocktime/10
func (*FactomdMonitor) GetHighestSavedDBlock ¶
func (f *FactomdMonitor) GetHighestSavedDBlock() int64
Returns the highest saved block
func (*FactomdMonitor) Start ¶
func (f *FactomdMonitor) Start() chan int
func (*FactomdMonitor) Stop ¶
func (f *FactomdMonitor) Stop()
type Mine ¶
type Mine struct { MinerNum int // When running many miners, the number of the miner that is this one. Dbht int32 // Height that we are mining at Response chan int // Returns 0 when the MinerNumber stops Control chan int // sending any int to the Mine will stop mining OPR []byte // The oracle Record that we were mining OprHash []byte // The hash of the oracle record BestDifficulty uint64 // Highest Difference Found BestNonce []byte // The Nonce that produced the bestDifference BestHash []byte // The best hash we found (to check the Best Difficulty against) Hashcnt int // Count of hash rounds performed. HashFunction hashFunction // The Hash function we will be using to mine // contains filtered or unexported fields }
func (*Mine) Events ¶
func (m *Mine) Events(event chan FactomEvent)
type MinerState ¶
type MinerState struct { MinerNumber int // If running multiple miners, this is the number Monitor *FactomdMonitor // The facility that tracks what blocks we are processing ConfigDir string // Must end with a / OPR oprecord.OraclePriceRecord // The price record we mine against Config *config.Config // Configuration file with data for mining and Oracle data }
func (*MinerState) GetCoinbasePNTAddress ¶
func (m *MinerState) GetCoinbasePNTAddress() string
func (*MinerState) GetECAddress ¶
func (m *MinerState) GetECAddress() string
func (*MinerState) GetFCTAddress ¶
func (m *MinerState) GetFCTAddress() string
func (*MinerState) GetIdentityChainID ¶
func (m *MinerState) GetIdentityChainID() string
GetIdentityChainID Returns a pointer to a string for the chainID. Takes the raw chain if specified, but if not, returns the chainID computed from the fields. If no chainID is specified in the config file, a nil is returned.
func (*MinerState) GetOraclePriceRecordChain ¶
func (m *MinerState) GetOraclePriceRecordChain() string
GetOraclePriceRecordChain Returns the chainID for all the Oracle Price Records. Note that this ID is the same as the ProtocolChain + the field "OPR"
func (*MinerState) GetOraclePriceRecordExtIDs ¶
func (m *MinerState) GetOraclePriceRecordExtIDs() []string
func (*MinerState) GetProtocolChain ¶
func (m *MinerState) GetProtocolChain() string
GetProtocolChain Get the chain for the protocol. Versions of the protocol (when updates are deployed) will be recorded in this chain.
func (*MinerState) GetProtocolChainExtIDs ¶
func (m *MinerState) GetProtocolChainExtIDs() []string
func (*MinerState) LoadConfig ¶
func (m *MinerState) LoadConfig()