Last active
January 8, 2019 15:03
-
-
Save liamsi/a80993f24bff574bbfdbbfa9efa84bc7 to your computer and use it in GitHub Desktop.
dump validator privkey for kms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"github.com/tendermint/tendermint/crypto/ed25519" | |
"github.com/tendermint/tendermint/privval" | |
) | |
func main() { | |
keyFile := "/Users/ismail/.tendermint/config/priv_validator_key.json" | |
stateFile := "/Users/ismail/.tendermint/data/priv_validator_state.json" | |
fpv := privval.LoadFilePV(keyFile, stateFile) | |
pkb := [64]byte(fpv.Key.PrivKey.(ed25519.PrivKeyEd25519)) | |
err := ioutil.WriteFile("/tmp/signing2.key", pkb[:32], 0644) | |
if err != nil { | |
fmt.Println("Duh!!", err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment