Skip to content

Commit

Permalink
Merge pull request #70 from asymmetric-research/exporter-rename
Browse files Browse the repository at this point in the history
renamed solana_exporter -> solana-exporter
  • Loading branch information
johnstonematt authored Nov 5, 2024
2 parents 49486bc + d2c2ff2 commit 42d5669
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- name: Test rpc package
run: go test -v ./pkg/rpc

- name: Test solana_exporter
run: go test -v ./cmd/solana_exporter
- name: Test solana-exporter
run: go test -v ./cmd/solana-exporter

- name: Run all tests with coverage
run: go test -v -coverprofile=coverage.out ./...
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# builds:
.builds
/solana_exporter
/solana-exporter
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.22 as builder
COPY . /opt
WORKDIR /opt

RUN CGO_ENABLED=0 go build -o /opt/bin/app github.com/asymmetric-research/solana_exporter/cmd/solana_exporter
RUN CGO_ENABLED=0 go build -o /opt/bin/app github.com/asymmetric-research/solana-exporter/cmd/solana-exporter

FROM scratch

Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To use the Solana Exporter, simply run the program with the desired
[command line configuration](#Command-Line-Arguments), e.g.,

```shell
solana_exporter \
solana-exporter \
-nodekey <VALIDATOR_IDENTITY_1> -nodekey <VALIDATOR_IDENTITY_2> \
-balance-address <ADDRESS_1> -balance-address <ADDRESS_2> \
-comprehensive-slot-tracking \
Expand All @@ -20,13 +20,13 @@ solana_exporter \
## Installation
### Build

Assuming you already have [Go installed](https://go.dev/doc/install), the `solana_exporter` can be installed by
Assuming you already have [Go installed](https://go.dev/doc/install), the `solana-exporter` can be installed by
cloning this repository and building the binary:

```shell
git clone https://github.com/asymmetric-research/solana_exporter.git
cd solana_exporter
CGO_ENABLED=0 go build ./cmd/solana_exporter
git clone https://github.com/asymmetric-research/solana-exporter.git
cd solana-exporter
CGO_ENABLED=0 go build ./cmd/solana-exporter
```

## Configuration
Expand Down Expand Up @@ -56,13 +56,10 @@ The exporter is configured via the following command line arguments:
* Configuring `-monitor-block-sizes` with many `-nodekey`'s can potentially strain the node - every block produced
by a configured `-nodekey` is fetched, and a typical block can be as large as 5MB.

If you want verbose logs, specify `-v=<num>`. Higher verbosity means more debug output. For most users, the default
verbosity level is fine. If you want detailed log output for missed blocks, run with `-v=1`.

## Metrics
### Overview

The table below describes all the metrics collected by the `solana_exporter`:
The table below describes all the metrics collected by the `solana-exporter`:

| Metric | Description | Labels |
|-------------------------------------|------------------------------------------------------------------------------------------|-------------------------------|
Expand Down
12 changes: 6 additions & 6 deletions cmd/solana_exporter/config.go → cmd/solana-exporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"flag"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"time"
)

Expand Down Expand Up @@ -61,19 +61,19 @@ func NewExporterConfig(
)
if lightMode {
if comprehensiveSlotTracking {
return nil, fmt.Errorf("'-light-mode' is imcompatible with `-comprehensive-slot-tracking`")
return nil, fmt.Errorf("'-light-mode' is incompatible with `-comprehensive-slot-tracking`")
}

if monitorBlockSizes {
return nil, fmt.Errorf("'-light-mode' is imcompatible with `-monitor-block-sizes`")
return nil, fmt.Errorf("'-light-mode' is incompatible with `-monitor-block-sizes`")
}

if len(nodeKeys) > 0 {
return nil, fmt.Errorf("'-light-mode' is imcompatible with `-nodekey`")
return nil, fmt.Errorf("'-light-mode' is incompatible with `-nodekey`")
}

if len(balanceAddresses) > 0 {
return nil, fmt.Errorf("'-light-mode' is imcompatible with `-balance-addresses`")
return nil, fmt.Errorf("'-light-mode' is incompatible with `-balance-addresses`")
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"errors"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"context"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
"github.com/stretchr/testify/assert"
Expand Down
4 changes: 2 additions & 2 deletions cmd/solana_exporter/main.go → cmd/solana-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"context"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"net/http"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"os"
"testing"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/solana_exporter/slots.go → cmd/solana-exporter/slots.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"errors"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"go.uber.org/zap"
"slices"
"strings"
"time"

"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
"github.com/stretchr/testify/assert"
Expand Down
4 changes: 2 additions & 2 deletions cmd/solana_exporter/utils.go → cmd/solana-exporter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"slices"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
_ "embed"
"encoding/json"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/asymmetric-research/solana-exporter/pkg/rpc"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down Expand Up @@ -101,4 +101,5 @@ func TestCountVoteTransactions(t *testing.T) {
assert.NoError(t, err)
// https://explorer.solana.com/block/297609329
assert.Equal(t, 1048, voteCount)
assert.Equal(t, 446, len(block.Transactions)-voteCount)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/asymmetric-research/solana_exporter
module github.com/asymmetric-research/solana-exporter

go 1.22

Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"go.uber.org/zap"
"io"
"net/http"
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func newMethodTester(t *testing.T, method string, result any) (*MockServer, *Client) {
t.Helper()
return NewMockClient(t, map[string]any{method: result}, nil, nil, nil, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"go.uber.org/zap"
"net"
"net/http"
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/rpc_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rpc

import (
"github.com/asymmetric-research/solana_exporter/pkg/slog"
"github.com/asymmetric-research/solana-exporter/pkg/slog"
"os"
"testing"
)
Expand Down

0 comments on commit 42d5669

Please sign in to comment.