mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
79 lines
2.5 KiB
Go
79 lines
2.5 KiB
Go
// Copyright 2016 The go-ethereum Authors
|
|
// This file is part of go-ethereum.
|
|
//
|
|
// go-ethereum is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// go-ethereum is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
"strings"
|
|
|
|
"github.com/XinFinOrg/XDPoSChain/eth"
|
|
"github.com/XinFinOrg/XDPoSChain/eth/ethconfig"
|
|
"github.com/XinFinOrg/XDPoSChain/params"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var (
|
|
versionCommand = &cli.Command{
|
|
Action: version,
|
|
Name: "version",
|
|
Usage: "Print version numbers",
|
|
ArgsUsage: " ",
|
|
Description: `
|
|
The output of this command is supposed to be machine-readable.
|
|
`,
|
|
}
|
|
licenseCommand = &cli.Command{
|
|
Action: license,
|
|
Name: "license",
|
|
Usage: "Display license information",
|
|
ArgsUsage: " ",
|
|
}
|
|
)
|
|
|
|
func version(ctx *cli.Context) error {
|
|
fmt.Println(strings.Title(clientIdentifier))
|
|
fmt.Println("Version:", params.Version)
|
|
if gitCommit != "" {
|
|
fmt.Println("Git Commit:", gitCommit)
|
|
}
|
|
fmt.Println("Architecture:", runtime.GOARCH)
|
|
fmt.Println("Protocol Versions:", eth.ProtocolVersions)
|
|
fmt.Println("Network Id:", ethconfig.Defaults.NetworkId)
|
|
fmt.Println("Go Version:", runtime.Version())
|
|
fmt.Println("Operating System:", runtime.GOOS)
|
|
fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH"))
|
|
fmt.Printf("GOROOT=%s\n", runtime.GOROOT())
|
|
return nil
|
|
}
|
|
|
|
func license(_ *cli.Context) error {
|
|
fmt.Println(`XDC is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
XDC is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with XDC. If not, see <http://www.gnu.org/licenses/>.`)
|
|
return nil
|
|
}
|