Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
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 {
ReadClient
State stateapi.Module
// contains filtered or unexported fields
}
Client is a simplified Celestia client to submit blobs and interact with DA RPC.
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
type KeyringConfig ¶
KeyringConfig contains configuration parameters for constructing the node's keyring signer.
type ReadClient ¶
type ReadClient struct {
Blob blobapi.Module
Header headerapi.Module
Fraud fraudapi.Module
Blobstream blobstreamapi.Module
// contains filtered or unexported fields
}
func NewReadClient ¶
func NewReadClient(ctx context.Context, cfg ReadConfig) (*ReadClient, error)
func (*ReadClient) Close ¶
func (c *ReadClient) Close() error
Close closes all open connections to Celestia consensus nodes and Bridge nodes.
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
// TxWorkerAccounts is used for queued submission. It defines how many accounts the
// TxClient uses for PayForBlob submissions.
// - Value of 0 submits transactions immediately (without a submission queue).
// - Value of 1 uses synchronous submission (submission queue with default
// signer as author of transactions).
// - Value of > 1 uses parallel submission (submission queue with several accounts
// submitting blobs). Parallel submission is not guaranteed to include blobs
// in the same order as they were submitted.
TxWorkerAccounts int
}
func (SubmitConfig) Validate ¶
func (cfg SubmitConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.