Documentation
¶
Index ¶
- Constants
- Variables
- func FindOutputFeeAndaddressByTxHash(transactionHash string) (*big.Int, ethCommon.Address, *big.Int)
- func GetUnTransactionNum(db DatabaseReader, Prefix string) uint64
- func IteratorUnTransaction(from ethCommon.Address)
- func ResetConfigWithReflect(params *config.Params, spvConfig *spv.Config)
- func SendTransaction(from ethCommon.Address, elaTx string, fee *big.Int)
- func SpvDbInit(spvdataDir string)
- func UpTransactionIndex(elaTx string)
- type Config
- type Configuration
- type DatabaseReader
- type PreferParams
- type Service
Constants ¶
View Source
const ( DefaultConfigFilename = "./spvconfig.json" Foundation = "Foundation" CRCAddress = "CRCAddress" GenesisBlock = "GenesisBlock" PowLimit = "PowLimit" )
View Source
const ( //Unprocessed refill transaction index prefix UnTransaction string = "UnT-" //Cross-chain recharge unprocessed transaction index UnTransactionIndex = "UnTI" //Cross-chain recharge unprocessed transaction seek UnTransactionSeek = "UnTS" )
View Source
const LogPath = "./logs-spv/"
Variables ¶
View Source
var ( SpvService *Service MinedBlockSub *event.TypeMuxSubscription Signers map[ethCommon.Address]struct{} // Set of authorized signers at this moment )
Functions ¶
func FindOutputFeeAndaddressByTxHash ¶
func FindOutputFeeAndaddressByTxHash(transactionHash string) (*big.Int, ethCommon.Address, *big.Int)
FindOutputFeeAndaddressByTxHash Finds the eth recharge address, recharge amount, and transaction fee based on the main chain hash.
func GetUnTransactionNum ¶
func GetUnTransactionNum(db DatabaseReader, Prefix string) uint64
func IteratorUnTransaction ¶
IteratorUnTransaction iterates before mining and processes existing spv refill transactions
func ResetConfigWithReflect ¶ added in v0.0.2
func SendTransaction ¶
SendTransaction sends a reload transaction to txpool
func UpTransactionIndex ¶
func UpTransactionIndex(elaTx string)
UpTransactionIndex records spv-aware refill transaction index
Types ¶
type Configuration ¶
type Configuration struct {
// Exegesis in file Elastos.ELA/common/config/params.go
Magic uint32 `json:"Magic"`
DefaultPort uint16 `json:"DefaultPort"`
DNSSeeds []string `json:"DNSSeeds"`
ListenAddrs []string `json:"ListenAddrs"`
Foundation string `json:"Foundation"`
CRCAddress string `json:"CRCAddress"`
PowLimit *big.Int `json:"PowLimit"`
PowLimitBits uint32 `json:"PowLimitBits"`
TargetTimespan time.Duration `json:"TargetTimespan"`
TargetTimePerBlock time.Duration `json:"TargetTimePerBlock"`
AdjustmentFactor int64 `json:"AdjustmentFactor"`
RewardPerBlock common.Fixed64 `json:"RewardPerBlock"`
CoinbaseMaturity uint32 `json:"CoinbaseMaturity"`
DisableTxFilters bool `json:"DisableTxFilters"`
MinTransactionFee common.Fixed64 `json:"MinTransactionFee"`
MinCrossChainTxFee common.Fixed64 `json:"MinCrossChainTxFee"`
OriginArbiters []string `json:"OriginArbiters"`
CheckAddressHeight uint32 `json:"CheckAddressHeight"`
VoteStartHeight uint32 `json:"VoteStartHeight"`
CRCOnlyDPOSHeight uint32 `json:"CRCOnlyDPOSHeight"`
PublicDPOSHeight uint32 `json:"PublicDPOSHeight"`
CRCArbiters []string `json:"CRCArbiters"`
DPoSMagic uint32 `json:"DPoSMagic"`
DPoSDefaultPort uint16 `json:"DPoSDefaultPort"`
PreConnectOffset uint32 `json:"PreConnectOffset"`
GeneralArbiters int `json:"GeneralArbiters"`
CandidateArbiters int `json:"CandidateArbiters"`
ToleranceDuration time.Duration `json:"ToleranceDuration"`
MaxInactiveRounds uint32 `json:"MaxInactiveRounds"`
InactivePenalty common.Fixed64 `json:"InactivePenalty"`
EmergencyInactivePenalty common.Fixed64 `json:"EmergencyInactivePenalty"`
MaxLogsSize int64 `json:"MaxLogsSize"`
MaxPerLogSize int64 `json:"MaxPerLogSize"`
SpvPrintLevel uint32 `json:"SpvPrintLevel"`
PermanentPeers []string `json:"PermanentPeers"`
}
type DatabaseReader ¶
DatabaseReader wraps the Get method of a backing data store.
type PreferParams ¶ added in v0.0.2
type PreferParams struct {
Config Configuration `json:"Configuration"`
}
var PreferConfig PreferParams
type Service ¶
type Service struct {
spv.SPVService
}
func NewService ¶
Spv service initialization
func (*Service) GetDatabase ¶
func (s *Service) GetDatabase() *ethdb.LDBDatabase
func (*Service) VerifyTransaction ¶
func (s *Service) VerifyTransaction(tx *types.Transaction) error
Click to show internal directories.
Click to hide internal directories.