manager

package
v0.0.0-...-c6caad8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: GPL-3.0 Imports: 43 Imported by: 0

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/>.

Index

Constants

View Source
const (
	ChanLen = 64
)

Variables

This section is empty.

Functions

func ConvertAddr

func ConvertAddr(base58Addr string) sccm.Address

func DeserializeKeepers

func DeserializeKeepers(raw []byte) []polycm.Address

func RawMultiSigsToList

func RawMultiSigsToList(sigData []byte) ([][]byte, error)

func RecoverSignersFromMultiSigs

func RecoverSignersFromMultiSigs(hash sccm.Hash, sigs [][]byte) ([]sccm.Address, error)

func VerifyPolyHeader

func VerifyPolyHeader(hdr *polytyps.Header, peers *ont.ConsensusPeers) error

func VerifySig

func VerifySig(hash sccm.Hash, multiSigData []byte, keepers []sccm.Address, m int) error

Types

type BookKeepersChangedEvent

type BookKeepersChangedEvent struct {
	RawPeers []byte `json:"raw_peers"`
}

type CrossTransfer

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

func (*CrossTransfer) Deserialization

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

func (*CrossTransfer) Serialization

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

type GenesisInitEvent

type GenesisInitEvent struct {
	Height    uint32 `json:"height"`
	RawHeader []byte `json:"raw_header"`
}

type PolyManager

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

func NewPolyManager

func NewPolyManager(
	srvCfg *config.ServiceConfig,
	polyForceStartBlockHeight uint32,
	polySDK *sdk.PolySdk,
	quorumSDK *sccli.Client,
	boltDB *db.BoltDB,
) (*PolyManager, error)

func (*PolyManager) MonitorChain

func (m *PolyManager) MonitorChain()

func (*PolyManager) Stop

func (m *PolyManager) Stop()

type QuorumManager

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

QuorumManager quorum->poly: 1. record quorum height in poly 2. fetch quorum header and proof and send to poly chain 3. The synchronization process is often batch processing, rather than block-by-block synchronization or submitting events, etc., so two slices are required to record the header and crossTx. 4. To ensure that each block is not dropped, we need a currentHeight mark stored in the headerSync contract of the relay chain to record which block is currently processed. 5. A cross chain manager is required to obtain cross-chain events from the solidity contract on the quorum chain

func NewQuorumManager

func NewQuorumManager(
	cfg *config.ServiceConfig,
	startHeight,
	startForceHeight uint64,
	polySdk *polysdk.PolySdk,
	quorumClient *sccli.Client,
	boltDB *db.BoltDB,
) (*QuorumManager, error)

func (*QuorumManager) CheckDeposit

func (m *QuorumManager) CheckDeposit()

func (*QuorumManager) MonitorChain

func (m *QuorumManager) MonitorChain()

MonitorChain the `QuorumManager` needs to traverse all of blocks and events on the quorum chain, and record the relationship of block height and block content which contains block header and event logs. and these data should be synced to `headerSync` and `crossChainManager` contracts located on poly chain.

func (*QuorumManager) MonitorDeposit

func (m *QuorumManager) MonitorDeposit()

type QuorumSender

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

type QuorumTxInfo

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

Jump to

Keyboard shortcuts

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