-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/autoshard-filter
- Loading branch information
Showing
70 changed files
with
640 additions
and
337 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
run: | ||
build-tags: | ||
- gowaku_rln | ||
|
||
issues: | ||
include: | ||
- EXC0012 | ||
|
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
0.7.0 | ||
0.8.0 |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//go:build !gowaku_rln | ||
// +build !gowaku_rln | ||
//go:build gowaku_no_rln | ||
// +build gowaku_no_rln | ||
|
||
package main | ||
|
||
|
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//go:build !gowaku_rln | ||
// +build !gowaku_rln | ||
//go:build gowaku_no_rln | ||
// +build gowaku_no_rln | ||
|
||
package main | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//go:build gowaku_rln | ||
// +build gowaku_rln | ||
//go:build !gowaku_no_rln | ||
// +build !gowaku_no_rln | ||
|
||
package main | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//go:build !gowaku_rln | ||
// +build !gowaku_rln | ||
//go:build gowaku_no_rln | ||
// +build gowaku_no_rln | ||
|
||
package server | ||
|
||
|
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,48 @@ | ||
package rest | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
"net/http" | ||
|
||
"github.com/go-chi/chi/v5" | ||
"github.com/waku-org/go-waku/waku/v2/node" | ||
) | ||
|
||
type HealthService struct { | ||
node *node.WakuNode | ||
mux *chi.Mux | ||
} | ||
|
||
const routeHealth = "/health" | ||
|
||
func NewHealthService(node *node.WakuNode, m *chi.Mux) *HealthService { | ||
h := &HealthService{ | ||
node: node, | ||
mux: m, | ||
} | ||
|
||
m.Get(routeHealth, h.getHealth) | ||
|
||
return h | ||
} | ||
|
||
type HealthResponse string | ||
|
||
func (d *HealthService) getHealth(w http.ResponseWriter, r *http.Request) { | ||
isReady, err := d.node.RLNRelay().IsReady(r.Context()) | ||
if err != nil { | ||
if errors.Is(err, context.DeadlineExceeded) { | ||
writeResponse(w, HealthResponse("Health check timed out"), http.StatusInternalServerError) | ||
} else { | ||
writeResponse(w, HealthResponse(err.Error()), http.StatusInternalServerError) | ||
} | ||
return | ||
} | ||
|
||
if isReady { | ||
writeResponse(w, HealthResponse("Node is healthy"), http.StatusOK) | ||
} else { | ||
writeResponse(w, HealthResponse("Node is not ready"), http.StatusInternalServerError) | ||
} | ||
} |
Oops, something went wrong.