Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateKeyFromRaw ¶
func PrivateKeyFromRaw(privateKey string) *privateKeyFromRaw
PrivateKeyFromRaw creates a new instance of the privateKeyFromRaw generator with the raw private key.
func PrivateKeyRandom ¶
func PrivateKeyRandom() *privateKeyRandom
PrivateKeyRandom creates a new instance of the privateKeyRandom generator.
Types ¶
type PrivateKeyGenerator ¶
type PrivateKeyGenerator interface {
// Generate creates a new Solana keypair and returns the private key
Generate() (sollib.PrivateKey, error)
}
PrivateKeyGenerator is an interface for generating Solana Keypairs.
type RPCChainProvider ¶
type RPCChainProvider struct {
// contains filtered or unexported fields
}
RPCChainProvider is a chain provider that provides a chain that connects to an Solana node via RPC.
func NewRPCChainProvider ¶
func NewRPCChainProvider(selector uint64, config RPCChainProviderConfig) *RPCChainProvider
func (*RPCChainProvider) BlockChain ¶
func (p *RPCChainProvider) BlockChain() chain.BlockChain
BlockChain returns the Aptos chain instance managed by this provider. You must call Initialize before using this method to ensure the chain is properly set up.
func (*RPCChainProvider) ChainSelector ¶
func (p *RPCChainProvider) ChainSelector() uint64
ChainSelector returns the chain selector of the Aptos chain managed by this provider.
func (*RPCChainProvider) Initialize ¶
func (p *RPCChainProvider) Initialize() (chain.BlockChain, error)
Initialize initializes the RPCChainProvider. It generates the deployer keypair from the provided configuration, writes it to the specified KeypairPath directory, and sets up the Solana client with the provided HTTP RPC URL. It returns the initialized Solana chain instance.
func (*RPCChainProvider) Name ¶
func (*RPCChainProvider) Name() string
Name returns the name of the RPCChainProvider.
type RPCChainProviderConfig ¶
type RPCChainProviderConfig struct {
// Required: The HTTP RPC URL to connect to the Solana node
HTTPURL string
// Required: A generator for the deployer key. Use PrivateKeyFromRaw to create a deployer
// key from a private key.
DeployerKeyGen PrivateKeyGenerator
// Required: The absolute path to the directory containing the Solana CLI binaries.
ProgramsPath string
// Required: The absolute path to the directory that will contain the keypair file used for
// deploying programs for the Solana CLI.
KeypairDirPath string
}
RPCChainProviderConfig holds the configuration to initialize the RPCChainProvider.