gethaws

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 6 Imported by: 1

README

Geth Client For AWS Managed Blockchain

Installing

go get github.com/said1296/gethaws

Limitations

Only works for HTTP client, will add support for other client types if people request it.

Usage

The client creation functions receive an AWS Config object as defined in github.com/aws/aws-sdk-go-v2/config. Further configuration instructions available in:

https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/

import (
	"github.com/aws/aws-sdk-go-v2/config"
)

os.SetEnv("AWS_REGION", "us-east-2")
os.SetEnv("AWS_ACCESS_KEY_ID", "my_access_key_id")
os.SetEnv("AWS_SECRET_ACCESS_KEY", "my_secret_access_key")

awsConfig, err := config.LoadDefaultConfig(ctx)
if err != nil {
    panic(err)
}
awsConfig.HTTPClient = new(http.Client)

// Can also call gethaws.CreateClient or gethaws.CreateRpcClient to just get one type of client
client, rpcClient, err = gethaws.CreateClients(c.EvmProvider, awsConfig)
if err != nil {
    panic(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(endpoint string, config aws.Config) (*ethclient.Client, error)

CreateClient creates an ethclient.Client from an endpoint string and an aws.Config struct

func CreateClients

func CreateClients(endpoint string, config aws.Config) (*ethclient.Client, *rpc.Client, error)

CreateClients creates an ethclient.Client and an rpc.Client from an endpoint string and an aws.Config struct

func CreateRpcClient

func CreateRpcClient(endpoint string, config aws.Config) (*rpc.Client, error)

CreateRpcClient creates an rpc.Client from an endpoint string and an aws.Config struct

Types

type CreationError

type CreationError struct {
	// contains filtered or unexported fields
}

func (CreationError) Error

func (e CreationError) Error() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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