Documentation ¶
Index ¶
- Variables
- func CheckPrefix(network NetworkType, name string) bool
- func ComputeChainIDFromFields(fields [][]byte) []byte
- func ComputeChainIDFromStrings(fields []string) []byte
- func ConvertPegTAddrToRaw(network NetworkType, adr string) (prefix string, rawAdr []byte, err error)
- func ConvertRawAddrToPegT(network NetworkType, prefix string, adr [32]byte) (string, error)
- func PegTAdrIsValid(network NetworkType, adr string) error
- func PullValue(line string, howMany int) string
- func RandomByteSliceOfLen(sliceLen int) []byte
- type FactomdMonitor
- type NetworkType
Constants ¶
This section is empty.
Variables ¶
var PegAssetNames = []string{
"pPNT",
"pUSD",
"pEUR",
"pJPY",
"pGBP",
"pCAD",
"pCHF",
"pINR",
"pSGD",
"pCNY",
"pHKD",
"pXAU",
"pXAG",
"pXPD",
"pXPT",
"pXBT",
"pETH",
"pLTC",
"pXBC",
"pFCT",
}
var TestPegAssetNames = []string{
"tPNT",
"tUSD",
"tEUR",
"tJPY",
"tGBP",
"tCAD",
"tCHF",
"tINR",
"tSGD",
"tCNY",
"tHKD",
"tXAU",
"tXAG",
"tXPD",
"tXPT",
"tXBT",
"tETH",
"tLTC",
"tXBC",
"tFCT",
}
Functions ¶
func CheckPrefix ¶
func CheckPrefix(network NetworkType, name string) bool
CheckPrefix() Check the prefix for either network type.
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 ConvertPegTAddrToRaw ¶
func ConvertPegTAddrToRaw(network NetworkType, adr string) (prefix string, rawAdr []byte, err error)
ConvertPegTAddrToRaw() Convert a human/wallet address to the raw underlying address. Verifies the checksum and the validity of the prefix. Returns the prefix, the raw address, and error.
func ConvertRawAddrToPegT ¶
func ConvertRawAddrToPegT(network NetworkType, prefix string, adr [32]byte) (string, error)
ConvertRawAddrToPegT() Converts a raw RCD1 address into a wallet friendly address that can be used to convert assets, check balances, and send tokens. While the underlying private key can be used to hold Factoids or any token in the PegNet, users need addresses that create a barrier to mistakes that can lead to sending the wrong tokens to the wrong addresses
func PegTAdrIsValid ¶
func PegTAdrIsValid(network NetworkType, adr string) error
PegTAdrIsValid() Check that the given human/wallet PegNet address is valid.
func RandomByteSliceOfLen ¶
RandomByteSliceOfLen() Returns a random set of bytes of a given length
Types ¶
type FactomdMonitor ¶
type FactomdMonitor struct {
// contains filtered or unexported fields
}
FactomdMonitor Running multiple Monitors is problematic and should be avoided if possible
func (*FactomdMonitor) GetAlert ¶
func (f *FactomdMonitor) GetAlert() chan common.FDStatus
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()
func (*FactomdMonitor) Stop ¶
func (f *FactomdMonitor) Stop()