Skip to content

Commit

Permalink
feat: implement pip-14 (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirvalhalla authored Dec 8, 2023
1 parent 4abe3f9 commit b67b301
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
25 changes: 16 additions & 9 deletions version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ package version

import (
"fmt"
"os"
"path/filepath"
"runtime"
)

// These constants follow the semantic versioning 2.0.0 spec (http://semver.org/)
const (
major uint = 0
minor uint = 18
patch uint = 0
meta string = "beta"
major uint = 0
minor uint = 18
patch uint = 0
meta string = "beta"
protocolVersion uint = 1
)

func Agent() string {
return fmt.Sprintf("pactus/%s", Version())
return fmt.Sprintf("node=%s/node-version=v%s/protocol-version=%d/os=%s/arch=%s",
ExecutorName(), Version(), protocolVersion, runtime.GOOS, runtime.GOARCH)
}

func Version() string {
version := fmt.Sprintf("%d.%d.%d", major, minor, patch)

if meta != "" {
version = fmt.Sprintf("%s-%s", version, meta)
}
version = fmt.Sprintf("%s-%s", version, meta)

return version
}

func ExecutorName() string {
executorName, _ := os.Executable()
return filepath.Base(executorName)
}
6 changes: 2 additions & 4 deletions www/grpc/statik/statik.go

Large diffs are not rendered by default.

0 comments on commit b67b301

Please sign in to comment.