Skip to content
Merged
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
28 changes: 28 additions & 0 deletions .air.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Air configuration file for Go live reload

root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/main ./cmd/main.go"
bin = "./tmp/main"
include_ext = ["go"]
exclude_dir = ["tmp", "vendor"]
exclude_file = []
follow_symlink = true
delay = 1000 # ms
log = "build.log"
send_interrupt = true
kill_delay = 500

[log]
time = true

[color]
main = "yellow"
watcher = "cyan"
build = "green"
runner = "magenta"

[misc]
clean_on_exit = true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# air
tmp
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# Validator Tracker Notifier

## Development Mode (Dev Mode)

This project supports a development mode with automatic reload on code changes using [air](https://github.com/cosmtrek/air).

### Prerequisites

- [Go](https://golang.org/dl/) installed
- [air](https://github.com/cosmtrek/air) installed (install with `go install github.com/cosmtrek/air@latest`)

### Running in Dev Mode

To start the application in development mode with live reload and debug logging:

```sh
LOG_LEVEL=DEBUG air
```

This will watch for file changes and automatically restart the app. You can edit code and see changes reflected immediately.

### Example

```sh
# Install air if you haven't already
go install github.com/air-verse/air@latest

# Run in dev mode with debug logs
LOG_LEVEL=DEBUG air
```
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
func main() {
// Load config
cfg := config.LoadConfig()
logger.Info("Loaded config: network=%s, beaconEndpoint=%s, web3SignerEndpoint=%s",
logger.Info("Loaded e config: network=%s, beaconEndpoint=%s, web3SignerEndpoint=%s",
cfg.Network, cfg.BeaconEndpoint, cfg.Web3SignerEndpoint)

// Initialize adapters
Expand Down
1 change: 1 addition & 0 deletions internal/adapters/beacon/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/attestantio/go-eth2-client/spec/phase0"
)

// TODO: should the adapter avoid returning err when initializing?
// TODO: implement slash method

type beaconAttestantClient struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func LoadConfig() Config {
beaconEndpoint := fmt.Sprintf("http://beacon-chain.%s.dncore.dappnode:3500", network)
web3SignerEndpoint := fmt.Sprintf("http://web3signer.web3signer-%s.dappnode:9000", network)
dappmanagerEndpoint := "http://dappmanager.dappnode"
notifierEndpoint := "http://notifier.dappnode:8080"
notifierEndpoint := "http://notifier.dappnode:8080f"

// Allow override via environment variables
if envBeacon := os.Getenv("BEACON_ENDPOINT"); envBeacon != "" {
Expand Down