Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterForSpecUpdatesOrSetStaticSpecsWithToken ¶
func RegisterForSpecUpdatesOrSetStaticSpecsWithToken(ctx context.Context, chainParser chainlib.ChainParser, specPaths []string, rpcEndpoint lavasession.RPCEndpoint, specUpdaterInf SpecUpdaterInf, githubToken string, gitlabToken string) error
RegisterForSpecUpdatesOrSetStaticSpecsWithToken loads specs from multiple sources and aggregates them. Sources are processed in order; later sources override earlier ones for the same chain ID.
It supports:
- Remote repositories (GitHub/GitLab) - detected automatically by URL pattern
- Local directories - all JSON files in the directory are loaded
- Local files - single JSON file or comma-separated list of files
Local files can be specified either as separate flags or comma-separated:
--use-static-spec file1.json --use-static-spec file2.json --use-static-spec file1.json,file2.json
For remote repositories, the appropriate token (githubToken or gitlabToken) is used for authentication. When specPaths is empty and specUpdaterInf is non-nil, it falls back to blockchain registration.
Types ¶
type SpecUpdaterInf ¶
type SpecUpdaterInf interface {
RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error
}
SpecUpdaterInf is implemented by state-tracker types that can register a SpecUpdatable for live on-chain spec updates. Callers that do not need live updates (e.g. the smart router using static specs) may pass nil.