Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrReadOnlyMode = errors.New("submit is disabled in read only client")
Functions ¶
func KeyringWithNewKey ¶
func KeyringWithNewKey(cfg KeyringConfig, path string) (keyring.Keyring, error)
KeyringWithNewKey is a helper function for easy keyring initialization. It initializes a keyring with the given config and path. It creates a new key if no key is found in the keyring store.
Types ¶
type Client ¶
type Client struct {
Blob blobapi.Module
Header headerapi.Module
State stateapi.Module
Fraud fraudapi.Module
Blobstream blobstreamapi.Module
// contains filtered or unexported fields
}
Client is a simplified Celestia client to submit blobs and interact with DA RPC.
func New ¶
New initializes the Celestia client. It connects to the Celestia consensus nodes and Bridge nodes. Any changes to the keyring are not visible to the client. The client needs to be reinitialized to pick up new keys.
func NewReadClient ¶
func NewReadClient(ctx context.Context, cfg ReadConfig) (*Client, error)
type Config ¶
type Config struct {
ReadConfig ReadConfig
SubmitConfig SubmitConfig
}
Config holds configuration for the Client.
type CoreGRPCConfig ¶
type CoreGRPCConfig struct {
// Addr is the address of the core gRPC server.
Addr string
// TLSEnabled specifies whether the connection is secure or not.
TLSEnabled bool
// AuthToken is the authentication token to be used for gRPC authentication.
// If left empty, the client will not include the authentication token in its requests.
// Note: AuthToken is insecure without TLS
AuthToken string
}
CoreGRPCConfig is the configuration for the core gRPC client.
func (*CoreGRPCConfig) Validate ¶
func (cfg *CoreGRPCConfig) Validate() error
Validate performs basic validation of the config.
type KeyringConfig ¶
KeyringConfig contains configuration parameters for constructing the node's keyring signer.
type ReadConfig ¶
type ReadConfig struct {
// BridgeDAAddr is the address of the bridge node
BridgeDAAddr string
// DAAuthToken sets the value for Authorization http header
DAAuthToken string
// HTTPHeader contains custom headers that will be sent with each request
HTTPHeader http.Header
// EnableDATLS enables TLS for bridge node
EnableDATLS bool
}
Bridge node json-rpc connection config
func (ReadConfig) Validate ¶
func (cfg ReadConfig) Validate() error
type SubmitConfig ¶
type SubmitConfig struct {
DefaultKeyName string
Network p2p.Network
CoreGRPCConfig CoreGRPCConfig
}
func (SubmitConfig) Validate ¶
func (cfg SubmitConfig) Validate() error