portal

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// relaying header chain
	TestnetBNBChainID        = "Binance-Chain-Ganges"
	TestnetBTCChainID        = "Bitcoin-Testnet"
	TestnetBTCDataFolderName = "btcrelayingv15"

	// BNB fullnode
	TestnetBNBFullNodeHost     = "data-seed-pre-0-s3.binance.org"
	TestnetBNBFullNodeProtocol = "https"
	TestnetBNBFullNodePort     = "443"
	TestnetPortalFeeder        = "12S2ciPBja9XCnEVEcsPvmCLeQH44vF8DMwSqgkH7wFETem5FiqiEpFfimETcNqDkARfht1Zpph9u5eQkjEnWsmZ5GB5vhc928EoNYH"

	// relaying header chain
	Testnet2BNBChainID        = "Binance-Chain-Ganges"
	Testnet2BTCChainID        = "Bitcoin-Testnet-2"
	Testnet2BTCDataFolderName = "btcrelayingv12"

	// BNB fullnode
	Testnet2BNBFullNodeHost     = "data-seed-pre-0-s3.binance.org"
	Testnet2BNBFullNodeProtocol = "https"
	Testnet2BNBFullNodePort     = "443"
	Testnet2PortalFeeder        = "12S2ciPBja9XCnEVEcsPvmCLeQH44vF8DMwSqgkH7wFETem5FiqiEpFfimETcNqDkARfht1Zpph9u5eQkjEnWsmZ5GB5vhc928EoNYH"

	// relaying header chain
	MainnetBNBChainID        = "Binance-Chain-Tigris"
	MainnetBTCChainID        = "Bitcoin-Mainnet"
	MainnetBTCDataFolderName = "btcrelayingv8"

	// BNB fullnode
	MainnetBNBFullNodeHost     = "dataseed1.ninicoin.io"
	MainnetBNBFullNodeProtocol = "https"
	MainnetBNBFullNodePort     = "443"
	MainnetPortalFeeder        = "12RwJVcDx4SM4PvjwwPrCRPZMMRT9g6QrnQUHD54EbtDb6AQbe26ciV6JXKyt4WRuFQVqLKqUUbb7VbWxR5V6KaG9HyFbKf6CrRxhSm"

	// portal token v4
	LocalPortalV4BTCID    = "ef5947f70ead81a76a53c7c8b7317dd5245510c665d3a13921dc9a581188728b"
	TestnetPortalV4BTCID  = "4584d5e9b2fc0337dfb17f4b5bb025e5b82c38cfa4f54e8a3d4fcdd03954ff82"
	Testnet2PortalV4BTCID = "4584d5e9b2fc0337dfb17f4b5bb025e5b82c38cfa4f54e8a3d4fcdd03954ff82"
	MainnetPortalV4BTCID  = "b832e5d3b1f01a4f0623f7fe91d6673461e1f5d37d91fe78c5c2e6183ff39696"
)

Variables

View Source
var Logger = PortalLogger{}

Global instant to use

Functions

func CollectPortalInstructions

func CollectPortalInstructions(pm *PortalManager, metaType int, action []string, shardID byte) bool

func HandlePortalInsts

func HandlePortalInsts(
	bc metadata.ChainRetriever,
	stateDB *statedb.StateDB,
	beaconHeight uint64,
	shardHeight map[byte]uint64,
	currentPortalState *portalprocessv3.CurrentPortalState,
	currentPortalStateV4 *portalprocessv4.CurrentPortalStateV4,
	relayingState *portalrelaying.RelayingHeaderChainState,
	rewardForCustodianByEpoch map[common.Hash]uint64,
	portalParams PortalParams,
	pm *PortalManager,
	epochBlocks uint64,
) ([][]string, error)

func ProcessPortalInsts

func ProcessPortalInsts(
	bc metadata.ChainRetriever,
	portalLastStateV3 *portalprocessv3.CurrentPortalState,
	portalLastStateV4 *portalprocessv4.CurrentPortalStateV4,
	portalStateDB *statedb.StateDB,
	relayingState *portalrelaying.RelayingHeaderChainState,
	portalParams PortalParams,
	beaconHeight uint64,
	instructions [][]string,
	pm *PortalManager,
	epoch uint64,
	isSkipPortalV3Ints bool) (*portalprocessv3.CurrentPortalState, *portalprocessv4.CurrentPortalStateV4, error)

func SetupParam

func SetupParam()

func SetupPortalParam

func SetupPortalParam(newPortalParam *PortalParams)

SetupPortalParam Do not use this function in development or production process Only use for unit test

Types

type PortalLogger

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

func (*PortalLogger) Init

func (p *PortalLogger) Init(inst common.Logger)

type PortalManager

type PortalManager struct {
	RelayingChainsProcessors map[int]portalrelaying.RelayingProcessor
	PortalInstProcessorsV3   map[int]portalprocessv3.PortalInstructionProcessorV3
	PortalInstProcessorsV4   map[int]portalprocessv4.PortalInstructionProcessorV4
}

func NewPortalManager

func NewPortalManager() *PortalManager

type PortalParams

type PortalParams struct {
	RelayingParam  portalrelaying.RelayingParams
	PortalParamsV3 map[uint64]portalv3.PortalParams
	PortalParamsV4 map[uint64]portalv4.PortalParams
}

func GetPortalParams

func GetPortalParams() *PortalParams

func (PortalParams) GetPortalParamsV3

func (p PortalParams) GetPortalParamsV3(beaconHeight uint64) portalv3.PortalParams

func (PortalParams) GetPortalParamsV4

func (p PortalParams) GetPortalParamsV4(beaconHeight uint64) portalv4.PortalParams

Jump to

Keyboard shortcuts

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