Skip to content

Commit

Permalink
Add version metadata to the logs (#191)
Browse files Browse the repository at this point in the history
* Add version metadata to the logs

* Lint fix
  • Loading branch information
Stefan-Ethernal authored Apr 11, 2024
1 parent aca4572 commit 03a2107
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/cluster
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ rm -rf test-chain-*
rm -f genesis.json

# Build binary
go build -o blade .
make build

# If --docker flag is set run docker environment otherwise run from binary
case "$2" in
Expand Down
26 changes: 16 additions & 10 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,23 @@ import (
"path/filepath"
"time"

"github.com/0xPolygon/polygon-edge/blockchain/storagev2"
"github.com/0xPolygon/polygon-edge/blockchain/storagev2/leveldb"
"github.com/0xPolygon/polygon-edge/blockchain/storagev2/memory"
consensusPolyBFT "github.com/0xPolygon/polygon-edge/consensus/polybft"
"github.com/0xPolygon/polygon-edge/forkmanager"
"github.com/0xPolygon/polygon-edge/gasprice"
"github.com/hashicorp/go-hclog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"google.golang.org/grpc"

"github.com/0xPolygon/polygon-edge/archive"
"github.com/0xPolygon/polygon-edge/blockchain"
"github.com/0xPolygon/polygon-edge/blockchain/storagev2"
"github.com/0xPolygon/polygon-edge/blockchain/storagev2/leveldb"
"github.com/0xPolygon/polygon-edge/blockchain/storagev2/memory"
"github.com/0xPolygon/polygon-edge/chain"
"github.com/0xPolygon/polygon-edge/consensus"
consensusPolyBFT "github.com/0xPolygon/polygon-edge/consensus/polybft"
"github.com/0xPolygon/polygon-edge/contracts"
"github.com/0xPolygon/polygon-edge/crypto"
"github.com/0xPolygon/polygon-edge/forkmanager"
"github.com/0xPolygon/polygon-edge/gasprice"
"github.com/0xPolygon/polygon-edge/helper/common"
"github.com/0xPolygon/polygon-edge/helper/progress"
"github.com/0xPolygon/polygon-edge/jsonrpc"
Expand All @@ -39,10 +43,7 @@ import (
"github.com/0xPolygon/polygon-edge/txpool"
"github.com/0xPolygon/polygon-edge/types"
"github.com/0xPolygon/polygon-edge/validate"
"github.com/hashicorp/go-hclog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"google.golang.org/grpc"
"github.com/0xPolygon/polygon-edge/versioning"
)

var (
Expand Down Expand Up @@ -147,6 +148,11 @@ func NewServer(config *Config) (*Server, error) {
}

m.logger.Info("Data dir", "path", config.DataDir)
m.logger.Info("Version metadata",
"version", versioning.Version,
"commit", versioning.Commit,
"branch", versioning.Branch,
"build time", versioning.BuildTime)

var dirPaths = []string{
"blockchain",
Expand Down

0 comments on commit 03a2107

Please sign in to comment.