-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
explorer.go
31 lines (23 loc) · 941 Bytes
/
explorer.go
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
package telemetry
import (
"context"
ocrtypes "github.com/smartcontractkit/libocr/commontypes"
"github.com/smartcontractkit/chainlink/v2/core/services/synchronization"
)
var _ MonitoringEndpointGenerator = &ExplorerAgent{}
type ExplorerAgent struct {
explorerClient synchronization.ExplorerClient
}
// NewExplorerAgent returns a Agent which is just a thin wrapper over
// the explorerClient for now
func NewExplorerAgent(explorerClient synchronization.ExplorerClient) *ExplorerAgent {
return &ExplorerAgent{explorerClient}
}
// SendLog sends a telemetry log to the explorer
func (t *ExplorerAgent) SendLog(log []byte) {
t.explorerClient.Send(context.Background(), log, synchronization.ExplorerBinaryMessage)
}
// GenMonitoringEndpoint creates a monitoring endpoint for telemetry
func (t *ExplorerAgent) GenMonitoringEndpoint(contractID string, telemType synchronization.TelemetryType) ocrtypes.MonitoringEndpoint {
return t
}