Skip to content

venus增加网络参数接口,其他项目需要网络需要网络相关参数,需通过接口获取 #4856

@Fatman13

Description

@Fatman13

原文 by @hunjixin

venus 增加获取网络参数接口

  • 方便下游组件能通过接口获取到网络参数,减少重复的网络参数配置
  • 下游组件可以不用设置网络类型 flag

接口

新增接口:ChainGetNetworkParams(ctx context.Context) (*types.NetworkParams, error)

ChainGetNetworkParams(ctx context.Context) (*types.NetworkParams, error)

type NetworkType int
type NetworkName string

type NetworkParams struct {
	NetworkName             NetworkName
	NetworkType             NetworkType
	BlockDelay              uint64
	ConsensusMinerMinPower  uint64
	ReplaceProofTypes       []abi.RegisteredSealProof
	PreCommitChallengeDelay abi.ChainEpoch
	# 升级高度
	ForkUpgradeParam        ForkUpgradeParam
}

涉及组件

  • venus-sealer (考虑不动)
  • venus-miner
  • venus-market
  • venus-messager
  • venus-cluster

待考虑问题

  • lotus 也需要增加相应接口

Metadata

Metadata

Assignees

No one assigned

    Labels

    CU-chain-serviceVenus chain service related issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions