solutils

package
v0.0.0-...-90a68d8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProgMCM              = "mcm"
	ProgTimelock         = "timelock"
	ProgAccessController = "access_controller"
)

Program names

Variables

View Source
var Directory = directory{

	ProgMCM:              {ID: "5vNJx78mz7KVMjhuipyr9jKBKcMrKYGdjGkgE4LUmjKk", Repo: repoCCIP, ProgramBufferBytes: 1 * 1024 * 1024},
	ProgTimelock:         {ID: "DoajfR5tK24xVw51fWcawUZWhAXD8yrBJVacc13neVQA", Repo: repoCCIP, ProgramBufferBytes: 1 * 1024 * 1024},
	ProgAccessController: {ID: "6KsN58MTnRQ8FfPaXHiFPPFGDRioikj9CdPvPxZJdCjb", Repo: repoCCIP, ProgramBufferBytes: 1 * 1024 * 1024},
}

Directory maps program names to their corresponding program information, including program ID, repository, and buffer size for upgrades.

View Source
var (
	MCMSProgramNames = []string{ProgMCM, ProgTimelock, ProgAccessController}
)

MCMSProgramNames names grouped by their usage.

Functions

func DownloadChainlinkCCIPProgramArtifacts

func DownloadChainlinkCCIPProgramArtifacts(ctx context.Context, targetDir string, sha string, lggr logger.Logger) error

DownloadChainlinkCCIPProgramArtifacts downloads CCIP program artifacts from the smartcontractkit/chainlink-ccip GitHub repository.

The function downloads a tar.gz archive containing Solana program binaries and extracts them to the specified target directory. If sha is empty, it automatically resolves the version by parsing the "github.com/smartcontractkit/chainlink-ccip/chains/solana" dependency from the nearest go.mod file.

Parameters:

  • ctx: Context for cancellation and timeout control
  • targetDir: Directory where extracted artifacts will be stored
  • sha: Git commit SHA or version identifier. If empty, auto-resolved from go.mod
  • lggr: Logger for progress and debug information. Can be nil to disable logging

Returns an error if the download fails, extraction fails, or SHA resolution fails.

func GetProgramBufferBytes

func GetProgramBufferBytes(name string) int

GetProgramBufferBytes returns the size of the program buffer in bytes for the given program name.

Returns 0 if the program is not found or if the program is not upgradable.

func GetProgramID

func GetProgramID(name string) string

GetProgramID returns the program ID for a given program name.

Returns the program ID for the given program name or an empty string if the program is not found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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