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

Beds 472/notifications get settings #909

Merged
merged 13 commits into from
Oct 7, 2024
78 changes: 78 additions & 0 deletions backend/pkg/api/data_access/clients.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package dataaccess

import "github.com/gobitfly/beaconchain/pkg/api/types"

type ClientRepository interface {
GetAllClients() ([]types.ClientInfo, error)
}

func (d *DataAccessService) GetAllClients() ([]types.ClientInfo, error) {
// TODO @recy21
// probably should load the clients into mem from some config when the service is created

return []types.ClientInfo{
// Execution Clients
{
Id: 0,
Name: "Geth",
Category: "Execution Clients",
},
{
Id: 1,
Name: "Nethermind",
Category: "Execution Clients",
},
{
Id: 2,
Name: "Besu",
Category: "Execution Clients",
},
{
Id: 3,
Name: "Erigon",
Category: "Execution Clients",
},
{
Id: 4,
Name: "Reth",
Category: "Execution Clients",
},
// Consensus Clients
{
Id: 5,
Name: "Teku",
Category: "Consensus Clients",
},
{
Id: 6,
Name: "Prysm",
Category: "Consensus Clients",
},
{
Id: 7,
Name: "Nimbus",
Category: "Consensus Clients",
},
{
Id: 8,
Name: "Lighthouse",
Category: "Consensus Clients",
},
{
Id: 9,
Name: "Lodestar",
Category: "Consensus Clients",
},
// Other
{
Id: 10,
Name: "Rocketpool Smart Node",
Category: "Other",
},
{
Id: 11,
Name: "MEV-Boost",
Category: "Other",
},
}, nil
}
1 change: 1 addition & 0 deletions backend/pkg/api/data_access/data_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type DataAccessor interface {
ValidatorDashboardRepository
SearchRepository
NetworkRepository
ClientRepository
UserRepository
AppRepository
NotificationsRepository
Expand Down
68 changes: 68 additions & 0 deletions backend/pkg/api/data_access/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,74 @@ func (d *DummyService) GetAllNetworks() ([]t.NetworkInfo, error) {
}, nil
}

func (d *DummyService) GetAllClients() ([]types.ClientInfo, error) {
return []types.ClientInfo{
// Execution Clients
{
Id: 0,
Name: "Geth",
Category: "Execution Clients",
},
{
Id: 1,
Name: "Nethermind",
Category: "Execution Clients",
},
{
Id: 2,
Name: "Besu",
Category: "Execution Clients",
},
{
Id: 3,
Name: "Erigon",
Category: "Execution Clients",
},
{
Id: 4,
Name: "Reth",
Category: "Execution Clients",
},
// Consensus Clients
{
Id: 5,
Name: "Teku",
Category: "Consensus Clients",
},
{
Id: 6,
Name: "Prysm",
Category: "Consensus Clients",
},
{
Id: 7,
Name: "Nimbus",
Category: "Consensus Clients",
},
{
Id: 8,
Name: "Lighthouse",
Category: "Consensus Clients",
},
{
Id: 9,
Name: "Lodestar",
Category: "Consensus Clients",
},
// Other
{
Id: 10,
Name: "Rocketpool Smart Node",
Category: "Other",
},
{
Id: 11,
Name: "MEV-Boost",
Category: "Other",
},
}, nil
}

func (d *DummyService) GetSearchValidatorByIndex(ctx context.Context, chainId, index uint64) (*t.SearchValidator, error) {
return getDummyStruct[t.SearchValidator]()
}
Expand Down
Loading
Loading