manager

package
v0.0.0-...-ac1e388 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: GPL-3.0 Imports: 51 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2020 The poly network Authors * This file is part of The poly network library. * * The poly network is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The poly network is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with The poly network . If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	FEE_NOCHECK = iota
	FEE_HASPAY
	FEE_NOTPAY
)
View Source
const (
	ChanLen = 0
)

Variables

View Source
var SpanIdCacheSynced uint64 = 0
View Source
var SpanMu sync.Mutex
View Source
var SpanPrefixKey = []byte{0x36} // prefix key to store span
View Source
var Sprint uint64 = 64
View Source
var StartFirst = true
View Source
var StartSpan uint64 = 0

Functions

func GetSpanKey

func GetSpanKey(id uint64) []byte

GetSpanKey appends prefix to start block

Types

type BridgeTransaction

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

func (*BridgeTransaction) Deserialization

func (this *BridgeTransaction) Deserialization(source *common.ZeroCopySource) error

func (*BridgeTransaction) Serialization

func (this *BridgeTransaction) Serialization(sink *common.ZeroCopySink)

type BridgeTransactionAndHash

type BridgeTransactionAndHash struct {
	BridgeTransaction *BridgeTransaction
	Hash              string
}

type CrossTransfer

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

func (*CrossTransfer) Deserialization

func (this *CrossTransfer) Deserialization(source *common.ZeroCopySource) error

func (*CrossTransfer) Serialization

func (this *CrossTransfer) Serialization(sink *common.ZeroCopySink)

type EthSender

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

func (*EthSender) Balance

func (this *EthSender) Balance() (*big.Int, error)

type EthTxInfo

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

type EthereumManager

type EthereumManager struct {
	TendermintClient *TendermintClient

	LastSpanId  uint64
	LastSpanId2 uint64
	// contains filtered or unexported fields
}

func NewEthereumManager

func NewEthereumManager(servconfig *config.ServiceConfig, startheight uint64, startforceheight uint64, ontsdk *sdkp.PolySdk, client *ethclient.Client,
	boltDB *db.BoltDB,
	tendermintRPCURL string,
	cdc *codec.Codec,
	tclientHttp *rpcclient.HTTP) (*EthereumManager, error)

func (*EthereumManager) CheckDeposit

func (this *EthereumManager) CheckDeposit()

func (*EthereumManager) MonitorChain

func (this *EthereumManager) MonitorChain()

func (*EthereumManager) MonitorDeposit

func (this *EthereumManager) MonitorDeposit()

func (*EthereumManager) SyncEventToPoly

func (this *EthereumManager) SyncEventToPoly() error

func (*EthereumManager) SyncHeaderToPoly

func (this *EthereumManager) SyncHeaderToPoly() error

type PolyManager

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

func NewPolyManager

func NewPolyManager(servCfg *config.ServiceConfig,
	startblockHeight uint32,
	polySdk *sdk.PolySdk,
	ethereumsdk *ethclient.Client,
	boltDB *db.BoltDB,
	nofeemode bool) (polyManager *PolyManager, err error)

func (*PolyManager) IsEpoch

func (this *PolyManager) IsEpoch(hdr *polytypes.Header) (bool, []byte, error)

func (*PolyManager) MonitorChain

func (this *PolyManager) MonitorChain()

func (*PolyManager) MonitorDeposit

func (this *PolyManager) MonitorDeposit()

func (*PolyManager) Stop

func (this *PolyManager) Stop()

type SpanStartEnd

type SpanStartEnd struct {
	ID       uint64
	StartEnd *StartEnd
}

type StartEnd

type StartEnd struct {
	Start uint64
	End   uint64
}

type TendermintClient

type TendermintClient struct {
	RPCHttp *rpcclient.HTTP
	Codec   *codec.Codec
	// contains filtered or unexported fields
}

func NewTendermintClient

func NewTendermintClient(addr string, db *db.BoltDB, cdc *codec.Codec, tclient *rpcclient.HTTP) (*TendermintClient, error)

func (*TendermintClient) GetCosmosHdr

func (this *TendermintClient) GetCosmosHdr(h int64) (*types.CosmosHeader, error)

func (*TendermintClient) GetLatestHeight

func (this *TendermintClient) GetLatestHeight() (int64, error)

func (*TendermintClient) GetLatestSpan

func (this *TendermintClient) GetLatestSpan(block int64) (*hmTypes.Span, error)

func (*TendermintClient) GetSpanIdByBor

func (this *TendermintClient) GetSpanIdByBor(bor uint64) (uint64, error)

func (*TendermintClient) GetSpanRes

func (this *TendermintClient) GetSpanRes(id uint64, heimHeight int64) (*abcitypes.ResponseQuery, *hmTypes.Span, error)

block: 0 = latest

func (*TendermintClient) MonitorSpanHisRoutine

func (this *TendermintClient) MonitorSpanHisRoutine(start uint64)

func (*TendermintClient) MonitorSpanLatestRoutine

func (this *TendermintClient) MonitorSpanLatestRoutine(seconds uint64)

Jump to

Keyboard shortcuts

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