mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 04:01:40 +00:00
Example that showcases how to build your own tendermint node
This example shows how a user of the tendermint library can build their own node and supply it with its own commands. It includes two todos in order to make it easier for library users to use tendermint.
This commit is contained in:
committed by
Ethan Buchman
parent
b50339e8e7
commit
2c129447fd
35
cmd/hsm/main.go
Normal file
35
cmd/hsm/main.go
Normal file
@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
tc "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
||||
"github.com/tendermint/tmlibs/cli"
|
||||
|
||||
"github.com/tendermint/tendermint/cmd/hsm/commands"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// TODO: Make it easier to build a tendermint instance from scratch.
|
||||
// All commands should be exported and it should be easy to override
|
||||
// certain aspects of a single command.
|
||||
// Probably every command should have a constructor that allows a user
|
||||
// to vary the configuration. This is at least true for run_node.go
|
||||
|
||||
rootCmd := tc.RootCmd
|
||||
rootCmd.AddCommand(tc.GenValidatorCmd)
|
||||
rootCmd.AddCommand(tc.InitFilesCmd)
|
||||
rootCmd.AddCommand(tc.ProbeUpnpCmd)
|
||||
rootCmd.AddCommand(tc.ReplayCmd)
|
||||
rootCmd.AddCommand(tc.ReplayConsoleCmd)
|
||||
rootCmd.AddCommand(tc.ResetAllCmd)
|
||||
rootCmd.AddCommand(tc.ResetPrivValidatorCmd)
|
||||
rootCmd.AddCommand(tc.ShowValidatorCmd)
|
||||
rootCmd.AddCommand(tc.TestnetFilesCmd)
|
||||
rootCmd.AddCommand(tc.VersionCmd)
|
||||
|
||||
rootCmd.AddCommand(commands.RunNodeCmd)
|
||||
|
||||
cmd := cli.PrepareBaseCmd(rootCmd, "TM", os.ExpandEnv("$HOME/.tendermint"))
|
||||
cmd.Execute()
|
||||
}
|
Reference in New Issue
Block a user