Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add Push Monitoring Path #86

Merged
merged 18 commits into from
Oct 29, 2024
1 change: 1 addition & 0 deletions bothan-api/client/go-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import (
type Client interface {
UpdateRegistry(ipfsHash string, version string) error
SetActiveSignalIDs(signalIDs []string) error
PushMonitoringRecords(uuid, txHash string) error
GetPrices(signalIDs []string) (*proto.GetPricesResponse, error)
}
19 changes: 10 additions & 9 deletions bothan-api/client/go-client/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ func (c *GrpcClient) UpdateRegistry(ipfsHash string, version string) error {
defer cancel()

_, err := client.UpdateRegistry(ctx, &signal.UpdateRegistryRequest{IpfsHash: ipfsHash, Version: version})
if err != nil {
return err
}

return nil
return err
}

func (c *GrpcClient) SetActiveSignalIDs(signalIDs []string) error {
Expand All @@ -45,11 +41,16 @@ func (c *GrpcClient) SetActiveSignalIDs(signalIDs []string) error {
defer cancel()

_, err := client.SetActiveSignalIds(ctx, &signal.SetActiveSignalIdsRequest{SignalIds: signalIDs})
if err != nil {
return err
}
return err
}

func (c *GrpcClient) PushMonitoringRecords(uuid, txHash string) error {
client := signal.NewSignalServiceClient(c.connection)
ctx, cancel := context.WithTimeout(context.Background(), c.timeout)
defer cancel()

return nil
_, err := client.PushMonitoringRecords(ctx, &signal.PushMonitoringRecordsRequest{Uuid: uuid, TxHash: txHash})
return err
}

func (c *GrpcClient) GetPrices(signalIDs []string) (*price.GetPricesResponse, error) {
Expand Down
140 changes: 113 additions & 27 deletions bothan-api/client/go-client/proto/signal/signal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions bothan-api/client/go-client/proto/signal/signal.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading