Skip to content

Commit

Permalink
fix: broken links for nodeapi
Browse files Browse the repository at this point in the history
  • Loading branch information
renlulu committed May 6, 2024
1 parent be4b790 commit 574d582
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nodeapi/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Node Api

This package implements the eigenlayer avs node spec [node-api](https://eigen.nethermind.io/docs/category/avs-node-api).
This package implements the eigenlayer avs node spec [node-api](https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/).

For an example of how to use this package, see [node-api-example](./nodeapi_example_test.go#L8)
12 changes: 6 additions & 6 deletions nodeapi/nodeapi.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nodeapi

// Implementation of https://eigen.nethermind.io/docs/spec/api/#api-versioning
// Implementation of https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#api-versioning

import (
"context"
Expand All @@ -18,7 +18,7 @@ import (
const (
baseUrl = "/eigen"
// Spec version is the version of the avs node spec that this node is implementing
// see https://eigen.nethermind.io/docs/spec/api/#api-versioning
// see https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#api-versioning
specSemVer = "v0.0.1"
)

Expand Down Expand Up @@ -131,7 +131,7 @@ func (api *NodeApi) specVersionHandler(w http.ResponseWriter, r *http.Request) {
}
}

// https://eigen.nethermind.io/docs/metrics/metrics-api#get-eigennodeversion
// https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#get-eigennode
func (api *NodeApi) nodeHandler(w http.ResponseWriter, r *http.Request) {
response := map[string]string{
"node_name": api.avsNodeName,
Expand All @@ -144,7 +144,7 @@ func (api *NodeApi) nodeHandler(w http.ResponseWriter, r *http.Request) {
}
}

// https://eigen.nethermind.io/docs/metrics/metrics-api#get-eigennodehealth
// https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#get-eigennodehealth
func (api *NodeApi) healthHandler(w http.ResponseWriter, r *http.Request) {
switch api.health {
case Healthy:
Expand All @@ -163,7 +163,7 @@ func (api *NodeApi) healthHandler(w http.ResponseWriter, r *http.Request) {
}
}

// https://eigen.nethermind.io/docs/metrics/metrics-api#get-eigennodeservices
// https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#get-eigennodeservices
func (api *NodeApi) servicesHandler(w http.ResponseWriter, r *http.Request) {
response := map[string][]nodeService{
"services": api.nodeServices,
Expand All @@ -174,7 +174,7 @@ func (api *NodeApi) servicesHandler(w http.ResponseWriter, r *http.Request) {
}
}

// https://eigen.nethermind.io/docs/metrics/metrics-api#get-eigennodeservicesservice_idhealth
// https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#get-eigennodeservicesservice_idhealth
func (api *NodeApi) serviceHealthHandler(w http.ResponseWriter, r *http.Request) {
suffix, found := strings.CutPrefix(r.URL.Path, "/eigen/node/services/")
if !found {
Expand Down
2 changes: 1 addition & 1 deletion nodeapi/nodeapi_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func ExampleNodeApi() {

nodeApi := nodeapi.NewNodeApi("testAvs", "v0.0.1", "localhost:8080", logger)
// register a service with the nodeApi. This could be a db, a cache, a queue, etc.
// see https://eigen.nethermind.io/docs/spec/api/#get-eigennodeservices
// see https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/api/#get-eigennodeservices
nodeApi.RegisterNewService("testServiceId", "testServiceName", "testServiceDescription", nodeapi.ServiceStatusInitializing)

// this starts the nodeApi server in a goroutine, so no need to wrap it in a go func
Expand Down

0 comments on commit 574d582

Please sign in to comment.