Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
- `GET /api/v0/event_indexer/address_events`: Retrieves the eventes associated to an EA
- query params:
- `address`: Address to get events.
- Proxy API: a proxy API that redirect requests to the [Lico API keys](https://github.com/lidofinance/lido-keys-api). Its main functionality is to avoid the cors issues when the Lido CSM UI tries to fetch the API.

## Environment Variables

Expand All @@ -60,7 +59,6 @@ To configure the app, set the following environment variables:
|------------------|------------------------------------------------------------------------------------------------------|
| `NETWORK` | Ethereum network (e.g., `mainnet`, `holesky`). Default holesky |
| `API_PORT` | Port on which the API will be exposed. Default 8080 |
| `PROXY_API_PORT` | Proxy port on which the Proxy API will be exposed. Default 8081 |
| `BEACONCHAIN_URL`| URL of the Ethereum beacon chain client. Default http://beacon-chain.<network>,dncore.dappnode:3500 |
| `WS_URL` | URL of the Ethereum WebSocket client. Default ws://execution.<network>.dncore.dappnode:8546 |
| `RPC_URL` | URL of the Ethereum RPC client. Default http://execution.<network>.dncore.dappnode:8545 |
Expand Down
7 changes: 2 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ func main() {

// Initialize API services
apiService := services.NewAPIServerService(ctx, networkConfig.ApiPort, storageAdapter, notifierAdapter, relaysUsedAdapter, relaysAllowedAdapter, csModuleEventsScannerService, networkConfig.CORS)
proxyService := services.NewProxyAPIServerService(networkConfig.ProxyApiPort, networkConfig.LidoKeysApiUrl, networkConfig.CORS)

// Start API services
apiService.Start(&wg)
proxyService.Start(&wg)

// Wait for and validate initial configuration
if err := waitForConfig(ctx, storageAdapter); err != nil {
Expand Down Expand Up @@ -123,7 +121,7 @@ func main() {
go eventsWatcherService.WatchAllEvents(ctx, &wg)

// Handle OS signals for shutdown
handleShutdown(cancel, apiService, proxyService)
handleShutdown(cancel, apiService)

// Wait for all goroutines to finish
wg.Wait()
Expand Down Expand Up @@ -153,7 +151,7 @@ func waitForConfig(ctx context.Context, storageAdapter *storage.Storage) error {
}

// handleShutdown manages graceful shutdown for services
func handleShutdown(cancel context.CancelFunc, apiService *services.APIServerService, proxyService *services.ProxyAPIServerService) {
func handleShutdown(cancel context.CancelFunc, apiService *services.APIServerService) {
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)

Expand All @@ -167,6 +165,5 @@ func handleShutdown(cancel context.CancelFunc, apiService *services.APIServerSer
defer shutdownCancel()

apiService.Shutdown(shutdownCtx)
proxyService.Shutdown(shutdownCtx)
}()
}
149 changes: 0 additions & 149 deletions internal/application/services/proxy_api_server.go

This file was deleted.

19 changes: 0 additions & 19 deletions internal/config/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ type Config struct {
// tx receipts
CSModuleTxReceipt common.Hash

// Lido specifics
LidoKeysApiUrl string
ProxyApiPort uint64

// Blockchain
MinGenesisTime uint64
BlockChunkSize uint64
Expand Down Expand Up @@ -98,17 +94,6 @@ func LoadNetworkConfig() (Config, error) {
}
}

proxyApiPortStr := os.Getenv("PROXY_API_PORT")
proxyApiPort := uint64(8081)
if proxyApiPortStr != "" {
// Try to parse the port as uint64
if port, err := strconv.ParseUint(proxyApiPortStr, 10, 64); err == nil {
proxyApiPort = port
} else {
logger.Fatal("Invalid PROXY_API_PORT value: %s", proxyApiPortStr)
}
}

network := os.Getenv("NETWORK")
// Default to holesky
if network == "" {
Expand Down Expand Up @@ -180,8 +165,6 @@ func LoadNetworkConfig() (Config, error) {
CsFeeDistributorBlockDeployment: uint64(1774650),
CSModuleAddress: common.HexToAddress("0x4562c3e63c2e586cD1651B958C22F88135aCAd4f"),
CSModuleTxReceipt: common.HexToHash("0x1475719ecbb73b28bc531bb54b37695df1bf6b71c6d2bf1d28b4efa404867e26"),
LidoKeysApiUrl: "https://keys-api-holesky.testnet.fi",
ProxyApiPort: proxyApiPort,
MinGenesisTime: uint64(1695902400),
BlockChunkSize: blockChunkSize,
}
Expand Down Expand Up @@ -221,8 +204,6 @@ func LoadNetworkConfig() (Config, error) {
CsFeeDistributorBlockDeployment: uint64(20935463),
CSModuleAddress: common.HexToAddress("0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F"),
CSModuleTxReceipt: common.HexToHash("0xf5330dbcf09885ed145c4435e356b5d8a10054751bb8009d3a2605d476ac173f"),
LidoKeysApiUrl: "https://keys-api.lido.fi",
ProxyApiPort: proxyApiPort,
MinGenesisTime: uint64(1606824023),
BlockChunkSize: blockChunkSize,
}
Expand Down