config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientCacheSize            = 1000
	ServerCacheSize            = 16
	OpenChannelTimeout         = uint64(600)    // seconds
	CooperativeWithdrawTimeout = uint64(60)     // seconds
	PayResolveTimeout          = uint64(60)     // seconds (on-chain partial-resolve challenge window)
	AdminSendTokenTimeout      = uint64(600)    // seconds
	QuickCatchBlockDelay       = uint64(2)      // blocks (unrelated to deadlines — fast-path reorg confirmation)
	TcbTimeoutSeconds          = uint64(604800) // 7 days, seconds

	// 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(86400) // 1 day, seconds
	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

	// Safe-margin knobs are env-var tunable so e2e tests can shrink them. Production
	// defaults (60s) absorb chain-confirmation slack past a deadline; tests typically
	// set CELER_*_SAFE_MARGIN_S=5 to keep the timeout-and-sweep flow snappy.
	WithdrawTimeoutSafeMargin = envUint("CELER_WITHDRAW_SAFE_MARGIN_S", 60) // seconds
	PaySendTimeoutSafeMargin  = envUint("CELER_PAY_SEND_SAFE_MARGIN_S", 60) // seconds
	PayRecvTimeoutSafeMargin  = envUint("CELER_PAY_RECV_SAFE_MARGIN_S", 60) // seconds
)

NOTE: not protected by lock, only set once at initialization. All "*Timeout" / "*Deadline" / "*SafeMargin" values below are in seconds — the contracts measure deadlines and challenge windows in `block.timestamp` (unix seconds), so off-chain code follows the same unit and comparisons against on-chain state stay aligned.

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