-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathpublic.go
More file actions
49 lines (41 loc) · 1.43 KB
/
public.go
File metadata and controls
49 lines (41 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package block
import (
"github.com/evstack/ev-node/block/internal/common"
"github.com/evstack/ev-node/block/internal/da"
coreda "github.com/evstack/ev-node/core/da"
"github.com/evstack/ev-node/pkg/config"
"github.com/rs/zerolog"
)
// BlockOptions defines the options for creating block components
type BlockOptions = common.BlockOptions
// DefaultBlockOptions returns the default block options
func DefaultBlockOptions() BlockOptions {
return common.DefaultBlockOptions()
}
// Expose Metrics for constructor
type Metrics = common.Metrics
// PrometheusMetrics creates a new PrometheusMetrics instance with the given namespace and labelsAndValues.
func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
return common.PrometheusMetrics(namespace, labelsAndValues...)
}
// NopMetrics creates a new NopMetrics instance.
func NopMetrics() *Metrics {
return common.NopMetrics()
}
// DAClient is the interface representing the DA client for public use.
type DAClient = da.Client
// NewDAClient creates a new DA client with configuration
func NewDAClient(
daLayer coreda.DA,
config config.Config,
logger zerolog.Logger,
) DAClient {
return da.NewClient(da.Config{
DA: daLayer,
Logger: logger,
Namespace: config.DA.GetNamespace(),
DefaultTimeout: config.DA.RequestTimeout.Duration,
DataNamespace: config.DA.GetDataNamespace(),
RetrieveBatchSize: config.DA.RetrieveBatchSize,
})
}