Go-SDK & CLI tool to interact with the Woop Blockchain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-sdk/cmd/main.go

40 lines
906 B

package main
import (
"fmt"
"os"
"path"
9 months ago
cmd "github.com/woop-chain/go-sdk/cmd/subcommands"
// Need this side effect
"github.com/spf13/cobra"
9 months ago
_ "github.com/woop-chain/go-sdk/pkg/store"
)
var (
version string
commit string
builtAt string
builtBy string
)
func main() {
// HACK Force usage of go implementation rather than the C based one. Do the right way, see the
// notes one line 66,67 of https://golang.org/src/net/net.go that say can make the decision at
// build time.
os.Setenv("GODEBUG", "netdns=go")
cmd.VersionWrapDump = version + "-" + commit
cmd.RootCmd.AddCommand(&cobra.Command{
Use: "version",
Short: "Show version",
4 years ago
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Fprintf(os.Stderr,
9 months ago
"Woop (C) 2024. %v, version %v-%v (%v %v)\n",
path.Base(os.Args[0]), version, commit, builtBy, builtAt)
os.Exit(0)
return nil
},
})
cmd.Execute()
}