Documentation
¶
Index ¶
- Constants
- Variables
- func AddrIsArbiter(address ethCommon.Address) int8
- func AddrIsArbiterWithElaHeight(address ethCommon.Address, elaHeight uint32) int8
- func FindOutputFeeAndaddressByTxHash(transactionHash string) (*big.Int, ethCommon.Address, *big.Int)
- func GetCurrentElaHeight() uint32
- func GetCurrentProducers() [][]byte
- func GetElaChainHeight() uint32
- func GetProducersByHeight(height uint32) [][]byte
- func GetUnTransactionNum(db DatabaseReader, Prefix string) uint64
- func IteratorUnTransaction(from ethCommon.Address)
- func SendTransaction(from ethCommon.Address, elaTx string, fee *big.Int)
- func SpvDbInit(spvdataDir string)
- func UntilGetElaChainHeight() uint32
- func UpTransactionIndex(elaTx string)
- type ChainParams
- type Config
- type ConfigFile
- type Configuration
- type DatabaseReader
- type PowConfiguration
- type Service
Constants ¶
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 (
DefaultConfigFilename = "./config.json"
)
View Source
const LogPath = "./logs-spv/"
Variables ¶
View Source
var ( Parameters configParams Version string )
View Source
var ( SpvService *Service MinedBlockSub *event.TypeMuxSubscription Signers map[ethCommon.Address]struct{} // Set of authorized signers at this moment )
Functions ¶
func AddrIsArbiter ¶
Determine whether an address is an arbiter
func AddrIsArbiterWithElaHeight ¶
Determine whether an address is an arbiter
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 GetCurrentElaHeight ¶
func GetCurrentElaHeight() uint32
func GetCurrentProducers ¶
func GetCurrentProducers() [][]byte
func GetProducersByHeight ¶
func GetUnTransactionNum ¶
func GetUnTransactionNum(db DatabaseReader, Prefix string) uint64
func IteratorUnTransaction ¶
IteratorUnTransaction iterates before mining and processes existing spv refill transactions
func SendTransaction ¶
SendTransaction sends a reload transaction to txpool
func UpTransactionIndex ¶
func UpTransactionIndex(elaTx string)
UpTransactionIndex records spv-aware refill transaction index
Types ¶
type ChainParams ¶
type ConfigFile ¶
type ConfigFile struct {
ConfigFile Configuration `json:"Configuration"`
}
type Configuration ¶
type Configuration struct {
Magic uint32 `json:"Magic"`
SpvMagic uint32 `json:"SpvMagic"`
Version int `json:"Version"`
SeedList []string `json:"SeedList"`
SpvSeedList []string `json:"SpvSeedList"`
SpvMinOutbound int `json:"SpvMinOutbound"`
SpvMaxConnections int `json:"SpvMaxConnections"`
SpvPrintLevel int `json:"SpvPrintLevel"`
ExchangeRate float64 `json:"ExchangeRate"`
MinCrossChainTxFee int `json:"MinCrossChainTxFee"`
HttpRestPort int `json:"HttpRestPort"`
RestCertPath string `json:"RestCertPath"`
RestKeyPath string `json:"RestKeyPath"`
HttpInfoPort uint16 `json:"HttpInfoPort"`
HttpInfoStart bool `json:"HttpInfoStart"`
OpenService bool `json:"OpenService"`
HttpWsPort int `json:"HttpWsPort"`
WsHeartbeatInterval time.Duration `json:"WsHeartbeatInterval"`
HttpJsonPort int `json:"HttpJsonPort"`
OauthServerUrl string `json:"OauthServerUrl"`
NoticeServerUrl string `json:"NoticeServerUrl"`
NodePort uint16 `json:"NodePort"`
WebSocketPort int `json:"WebSocketPort"`
PrintLevel int `json:"PrintLevel"`
IsTLS bool `json:"IsTLS"`
CertPath string `json:"CertPath"`
KeyPath string `json:"KeyPath"`
CAPath string `json:"CAPath"`
MultiCoreNum uint `json:"MultiCoreNum"`
MaxLogsSize int64 `json:"MaxLogsSize"`
MaxPerLogSize int64 `json:"MaxPerLogSize"`
MaxTxInBlock int `json:"MaxTransactionInBlock"`
MaxBlockSize int `json:"MaxBlockSize"`
PowConfiguration PowConfiguration `json:"PowConfiguration"`
FoundationAddress string `json:"FoundationAddress"`
MainChainFoundationAddress string `json:"MainChainFoundationAddress"`
}
type DatabaseReader ¶
DatabaseReader wraps the Get method of a backing data store.
type PowConfiguration ¶
type PowConfiguration struct {
PayToAddr string `json:"PayToAddr"`
MiningServerIP string `josn:"MiningServerIP"`
MiningServerPort int `josn:"MiningServerPort"`
MiningSelfPort int `josn:"MiningSelfPort"`
TestNet bool `json:"testnet"`
AutoMining bool `json:"AutoMining"`
MinerInfo string `json:"MinerInfo"`
MinTxFee int `json:"MinTxFee"`
ActiveNet string `json:"ActiveNet"`
}
type Service ¶
type Service struct {
spv.DPOSSPVService
}
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.