Skip to content

Commit

Permalink
hardcode commit hash and version
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavvvvv committed Mar 2, 2025
1 parent 3452440 commit 4b66ea4
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions core/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"log"
"os"
"os/exec"
"strings"

"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -280,35 +279,10 @@ func GenerateWalletAddressAptos(mnemonic string) {
log.Println("Aptos Wallet Address:", WalletAddress)
}

func getGitHash(repoURL string, branch string) (string, error) {
// Git command to fetch the latest commit hash of the specified branch
cmd := exec.Command("git", "ls-remote", repoURL, branch)
output, err := cmd.Output()
if err != nil {
return "", err
}

// Parse the output to get the commit hash
result := strings.Fields(string(output))
if len(result) > 0 {
return result[0], nil
}
return "", fmt.Errorf("no commit hash found for branch %s", branch)
}


func GetCodeHashAndVersion() (string, string) {
repoURL := "https://github.com/NetSepio/erebrus.git"
branch := "main"
hash, err := getGitHash(repoURL, branch)
if err != nil {
fmt.Println("Error getting Git hash:", err)
return "1234567890", "1.1.1-alpha"
}
if len(CodeHash) == 0 {
CodeHash = hash
}
if len(Version) == 0 {
Version = "1.1.1-alpha"
}
CodeHash = "4f5610aae32077a92ac570eeff5f3a404052fd94"
Version = "1.1.1-alpha"
return CodeHash, Version
}

0 comments on commit 4b66ea4

Please sign in to comment.