mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-03 22:57:22 +00:00
Pretty print JSON
This commit is contained in:
@@ -3,14 +3,14 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/go-wire"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func gen_validator() {
|
||||
|
||||
privValidator := types.GenPrivValidator()
|
||||
privValidatorJSONBytes := wire.JSONBytes(privValidator)
|
||||
privValidatorJSONBytes := wire.JSONBytesPretty(privValidator)
|
||||
fmt.Printf(`Generated a new validator!
|
||||
Paste the following JSON into your %v file
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/go-wire"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func show_validator() {
|
||||
privValidatorFile := config.GetString("priv_validator_file")
|
||||
privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
|
||||
fmt.Println(string(wire.JSONBytes(privValidator.PubKey)))
|
||||
fmt.Println(string(wire.JSONBytesPretty(privValidator.PubKey)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user