-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Separate Reporter Part 2] base report logic with rest api (#1873)
* comment out / remove unused code from reporter * comment out tests and create reporter entrypoint * temp comment out deviation reporter * initial dal fetch and submit logic * report logic implemented * temp disable reporter tests * remove reporter from node entrypoint * replace zerolog with zeropglog in reporter entrypoing * shared chain helper and mutex
- Loading branch information
Showing
12 changed files
with
1,155 additions
and
1,484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
|
||
"bisonai.com/orakl/node/pkg/reporter" | ||
"bisonai.com/orakl/node/pkg/zeropglog" | ||
"github.com/rs/zerolog/log" | ||
) | ||
|
||
func main() { | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
sigChan := make(chan os.Signal, 1) | ||
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) | ||
|
||
zeropglog := zeropglog.New() | ||
go zeropglog.Run(ctx) | ||
|
||
r := reporter.New() | ||
err := r.Run(ctx) | ||
if err != nil { | ||
log.Error().Err(err).Msg("Failed to start reporter") | ||
cancel() | ||
return | ||
} | ||
|
||
<-sigChan | ||
log.Info().Msg("Reporter termination signal received") | ||
|
||
cancel() | ||
|
||
log.Info().Msg("Reporter service has stopped") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.