config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientCacheSize            = 1000
	ServerCacheSize            = 16
	OpenChannelTimeout         = uint64(100)
	CooperativeWithdrawTimeout = uint64(10)
	WithdrawTimeoutSafeMargin  = uint64(6) // TODO: this should be profile.blockdelay + margin
	PayResolveTimeout          = uint64(10)
	PaySendTimeoutSafeMargin   = uint64(6)
	PayRecvTimeoutSafeMargin   = uint64(4)
	AdminSendTokenTimeout      = uint64(50)
	QuickCatchBlockDelay       = uint64(2)
	TcbTimeoutInBlockNumber    = 576000

	// Protocol Version in AuthReq, >=1 support sync
	AuthProtocolVersion = uint64(1)
	// AuthAckTimeout is duration client will wait for AuthAck msg
	AuthAckTimeout = 5 * time.Second

	// grpc dial timeout seconds, block until 15s
	GrpcDialTimeout = 15

	EventListenerLeaseName          = "eventlistener"
	EventListenerLeaseRenewInterval = 60 * time.Second
	EventListenerLeaseTimeout       = 90 * time.Second

	// used by clients to control onchain query frequency
	QueryName_OnChainBalance      = "onchainBalance"
	QueryName_OnChainResolvedPays = "onchainResolvedPays"
)

Variables

View Source
var (
	ChainId               *big.Int
	ChannelDisputeTimeout = uint64(10000)
	BlockDelay            = uint64(5)
	BlockIntervalSec      = uint64(10)
	EventListenerHttp     = ""
	RouterBcastInterval   = 293 * time.Second
	RouterBuildInterval   = 367 * time.Second
	RouterAliveTimeout    = 900 * time.Second
	OspClearPaysInterval  = 613 * time.Second
	OspReportInverval     = 887 * time.Second
)

NOTE: not protected by lock, only set once at initialization

View Source
var KeepAliveClientParams = keepalive.ClientParameters{
	Time:                15 * time.Second,
	Timeout:             3 * time.Second,
	PermitWithoutStream: true,
}

KeepAliveClientParams is grpc client side keeyalive parameters Make sure these parameters are set in coordination with the keepalive policy on the server, as incompatible settings can result in closing of connection

View Source
var KeepAliveEnforcePolicy = keepalive.EnforcementPolicy{
	MinTime:             12 * time.Second,
	PermitWithoutStream: true,
}

KeepAliveEnforcePolicy is grpc server side policy

View Source
var KeepAliveServerParams = keepalive.ServerParameters{
	Time:    20 * time.Second,
	Timeout: 3 * time.Second,
}

KeepAliveServerParams is grpc server side keeyalive parameters

Functions

func QuickTransactOptions

func QuickTransactOptions(opts ...eth.TxOption) []eth.TxOption

func SetGlobalConfigFromProfile

func SetGlobalConfigFromProfile(profile *common.CProfile)

func TransactOptions

func TransactOptions(opts ...eth.TxOption) []eth.TxOption

func WaitMinedOptions

func WaitMinedOptions() []eth.TxOption

Types

This section is empty.

Jump to

Keyboard shortcuts

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