mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 18:51:39 +00:00
Fix cmd and lite
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/tendermint/go-amino"
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
|
|
||||||
proto "github.com/tendermint/tendermint/benchmarks/proto"
|
proto "github.com/tendermint/tendermint/benchmarks/proto"
|
||||||
@ -13,6 +14,8 @@ import (
|
|||||||
|
|
||||||
func BenchmarkEncodeStatusWire(b *testing.B) {
|
func BenchmarkEncodeStatusWire(b *testing.B) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
|
cdc := amino.NewCodec()
|
||||||
|
ctypes.RegisterAmino(cdc)
|
||||||
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
||||||
status := &ctypes.ResultStatus{
|
status := &ctypes.ResultStatus{
|
||||||
NodeInfo: p2p.NodeInfo{
|
NodeInfo: p2p.NodeInfo{
|
||||||
@ -43,6 +46,8 @@ func BenchmarkEncodeStatusWire(b *testing.B) {
|
|||||||
|
|
||||||
func BenchmarkEncodeNodeInfoWire(b *testing.B) {
|
func BenchmarkEncodeNodeInfoWire(b *testing.B) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
|
cdc := amino.NewCodec()
|
||||||
|
ctypes.RegisterAmino(cdc)
|
||||||
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
||||||
nodeInfo := p2p.NodeInfo{
|
nodeInfo := p2p.NodeInfo{
|
||||||
PubKey: pubKey,
|
PubKey: pubKey,
|
||||||
@ -66,6 +71,8 @@ func BenchmarkEncodeNodeInfoWire(b *testing.B) {
|
|||||||
|
|
||||||
func BenchmarkEncodeNodeInfoBinary(b *testing.B) {
|
func BenchmarkEncodeNodeInfoBinary(b *testing.B) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
|
cdc := amino.NewCodec()
|
||||||
|
ctypes.RegisterAmino(cdc)
|
||||||
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
pubKey := crypto.GenPrivKeyEd25519().PubKey()
|
||||||
nodeInfo := p2p.NodeInfo{
|
nodeInfo := p2p.NodeInfo{
|
||||||
PubKey: pubKey,
|
PubKey: pubKey,
|
||||||
|
@ -30,7 +30,7 @@ func main() {
|
|||||||
"privPath", *privValPath,
|
"privPath", *privValPath,
|
||||||
)
|
)
|
||||||
|
|
||||||
privVal := priv_val.LoadPrivValidatorJSON(*privValPath)
|
privVal := priv_val.LoadFilePV(*privValPath)
|
||||||
|
|
||||||
rs := priv_val.NewRemoteSigner(
|
rs := priv_val.NewRemoteSigner(
|
||||||
logger,
|
logger,
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/types"
|
pvm "github.com/tendermint/tendermint/types/priv_validator"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenValidatorCmd allows the generation of a keypair for a
|
// GenValidatorCmd allows the generation of a keypair for a
|
||||||
@ -18,11 +17,11 @@ var GenValidatorCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func genValidator(cmd *cobra.Command, args []string) {
|
func genValidator(cmd *cobra.Command, args []string) {
|
||||||
privValidator := types.GenPrivValidatorFS("")
|
pv := pvm.GenFilePV("")
|
||||||
privValidatorJSONBytes, err := json.MarshalIndent(privValidator, "", "\t")
|
jsbz, err := cdc.MarshalJSON(pv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
fmt.Printf(`%v
|
fmt.Printf(`%v
|
||||||
`, string(privValidatorJSONBytes))
|
`, string(jsbz))
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
|
pvm "github.com/tendermint/tendermint/types/priv_validator"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,13 +18,13 @@ var InitFilesCmd = &cobra.Command{
|
|||||||
func initFiles(cmd *cobra.Command, args []string) {
|
func initFiles(cmd *cobra.Command, args []string) {
|
||||||
// private validator
|
// private validator
|
||||||
privValFile := config.PrivValidatorFile()
|
privValFile := config.PrivValidatorFile()
|
||||||
var privValidator *types.PrivValidatorFS
|
var pv *pvm.FilePV
|
||||||
if cmn.FileExists(privValFile) {
|
if cmn.FileExists(privValFile) {
|
||||||
privValidator = types.LoadPrivValidatorFS(privValFile)
|
pv = pvm.LoadFilePV(privValFile)
|
||||||
logger.Info("Found private validator", "path", privValFile)
|
logger.Info("Found private validator", "path", privValFile)
|
||||||
} else {
|
} else {
|
||||||
privValidator = types.GenPrivValidatorFS(privValFile)
|
pv = pvm.GenFilePV(privValFile)
|
||||||
privValidator.Save()
|
pv.Save()
|
||||||
logger.Info("Generated private validator", "path", privValFile)
|
logger.Info("Generated private validator", "path", privValFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ func initFiles(cmd *cobra.Command, args []string) {
|
|||||||
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
||||||
}
|
}
|
||||||
genDoc.Validators = []types.GenesisValidator{{
|
genDoc.Validators = []types.GenesisValidator{{
|
||||||
PubKey: privValidator.GetPubKey(),
|
PubKey: pv.GetPubKey(),
|
||||||
Power: 10,
|
Power: 10,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/types"
|
pvm "github.com/tendermint/tendermint/types/priv_validator"
|
||||||
"github.com/tendermint/tmlibs/log"
|
"github.com/tendermint/tmlibs/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ var ResetPrivValidatorCmd = &cobra.Command{
|
|||||||
// ResetAll removes the privValidator files.
|
// ResetAll removes the privValidator files.
|
||||||
// Exported so other CLI tools can use it.
|
// Exported so other CLI tools can use it.
|
||||||
func ResetAll(dbDir, privValFile string, logger log.Logger) {
|
func ResetAll(dbDir, privValFile string, logger log.Logger) {
|
||||||
resetPrivValidatorFS(privValFile, logger)
|
resetFilePV(privValFile, logger)
|
||||||
if err := os.RemoveAll(dbDir); err != nil {
|
if err := os.RemoveAll(dbDir); err != nil {
|
||||||
logger.Error("Error removing directory", "err", err)
|
logger.Error("Error removing directory", "err", err)
|
||||||
return
|
return
|
||||||
@ -44,18 +44,18 @@ func resetAll(cmd *cobra.Command, args []string) {
|
|||||||
// XXX: this is totally unsafe.
|
// XXX: this is totally unsafe.
|
||||||
// it's only suitable for testnets.
|
// it's only suitable for testnets.
|
||||||
func resetPrivValidator(cmd *cobra.Command, args []string) {
|
func resetPrivValidator(cmd *cobra.Command, args []string) {
|
||||||
resetPrivValidatorFS(config.PrivValidatorFile(), logger)
|
resetFilePV(config.PrivValidatorFile(), logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
func resetPrivValidatorFS(privValFile string, logger log.Logger) {
|
func resetFilePV(privValFile string, logger log.Logger) {
|
||||||
// Get PrivValidator
|
// Get PrivValidator
|
||||||
if _, err := os.Stat(privValFile); err == nil {
|
if _, err := os.Stat(privValFile); err == nil {
|
||||||
privValidator := types.LoadPrivValidatorFS(privValFile)
|
pv := pvm.LoadFilePV(privValFile)
|
||||||
privValidator.Reset()
|
pv.Reset()
|
||||||
logger.Info("Reset PrivValidator", "file", privValFile)
|
logger.Info("Reset PrivValidator", "file", privValFile)
|
||||||
} else {
|
} else {
|
||||||
privValidator := types.GenPrivValidatorFS(privValFile)
|
pv := pvm.GenFilePV(privValFile)
|
||||||
privValidator.Save()
|
pv.Save()
|
||||||
logger.Info("Generated PrivValidator", "file", privValFile)
|
logger.Info("Generated PrivValidator", "file", privValFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
cfg "github.com/tendermint/tendermint/config"
|
cfg "github.com/tendermint/tendermint/config"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
|
pvm "github.com/tendermint/tendermint/types/priv_validator"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,10 +47,10 @@ func testnetFiles(cmd *cobra.Command, args []string) {
|
|||||||
cmn.Exit(err.Error())
|
cmn.Exit(err.Error())
|
||||||
}
|
}
|
||||||
// Read priv_validator.json to populate vals
|
// Read priv_validator.json to populate vals
|
||||||
privValFile := filepath.Join(dataDir, mach, defaultConfig.PrivValidator)
|
pvFile := filepath.Join(dataDir, mach, defaultConfig.PrivValidator)
|
||||||
privVal := types.LoadPrivValidatorFS(privValFile)
|
pv := pvm.LoadFilePV(pvFile)
|
||||||
genVals[i] = types.GenesisValidator{
|
genVals[i] = types.GenesisValidator{
|
||||||
PubKey: privVal.GetPubKey(),
|
PubKey: pv.GetPubKey(),
|
||||||
Power: 1,
|
Power: 1,
|
||||||
Name: mach,
|
Name: mach,
|
||||||
}
|
}
|
||||||
@ -78,13 +79,13 @@ func initMachCoreDirectory(base, mach string) error {
|
|||||||
// Create priv_validator.json file if not present
|
// Create priv_validator.json file if not present
|
||||||
defaultConfig := cfg.DefaultBaseConfig()
|
defaultConfig := cfg.DefaultBaseConfig()
|
||||||
dir := filepath.Join(base, mach)
|
dir := filepath.Join(base, mach)
|
||||||
privValPath := filepath.Join(dir, defaultConfig.PrivValidator)
|
pvPath := filepath.Join(dir, defaultConfig.PrivValidator)
|
||||||
dir = filepath.Dir(privValPath)
|
dir = filepath.Dir(pvPath)
|
||||||
err := cmn.EnsureDir(dir, 0700)
|
err := cmn.EnsureDir(dir, 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
ensurePrivValidator(privValPath)
|
ensurePrivValidator(pvPath)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -93,6 +94,6 @@ func ensurePrivValidator(file string) {
|
|||||||
if cmn.FileExists(file) {
|
if cmn.FileExists(file) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
privValidator := types.GenPrivValidatorFS(file)
|
pv := pvm.GenFilePV(file)
|
||||||
privValidator.Save()
|
pv.Save()
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
package files
|
package files
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
wire "github.com/tendermint/go-wire"
|
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/lite"
|
"github.com/tendermint/tendermint/lite"
|
||||||
liteErr "github.com/tendermint/tendermint/lite/errors"
|
liteErr "github.com/tendermint/tendermint/lite/errors"
|
||||||
)
|
)
|
||||||
@ -19,7 +17,7 @@ const (
|
|||||||
MaxFullCommitSize = 1024 * 1024
|
MaxFullCommitSize = 1024 * 1024
|
||||||
)
|
)
|
||||||
|
|
||||||
// SaveFullCommit exports the seed in binary / go-wire style
|
// SaveFullCommit exports the seed in binary / go-amino style
|
||||||
func SaveFullCommit(fc lite.FullCommit, path string) error {
|
func SaveFullCommit(fc lite.FullCommit, path string) error {
|
||||||
f, err := os.Create(path)
|
f, err := os.Create(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -27,9 +25,11 @@ func SaveFullCommit(fc lite.FullCommit, path string) error {
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
var n int
|
_, err = cdc.MarshalBinaryWriter(f, fc)
|
||||||
wire.WriteBinary(fc, f, &n, &err)
|
if err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveFullCommitJSON exports the seed in a json format
|
// SaveFullCommitJSON exports the seed in a json format
|
||||||
@ -39,9 +39,15 @@ func SaveFullCommitJSON(fc lite.FullCommit, path string) error {
|
|||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
stream := json.NewEncoder(f)
|
bz, err := cdc.MarshalJSON(fc)
|
||||||
err = stream.Encode(fc)
|
if err != nil {
|
||||||
return errors.WithStack(err)
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
_, err = f.Write(bz)
|
||||||
|
if err != nil {
|
||||||
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFullCommit loads the full commit from the file system.
|
// LoadFullCommit loads the full commit from the file system.
|
||||||
@ -56,9 +62,11 @@ func LoadFullCommit(path string) (lite.FullCommit, error) {
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
var n int
|
_, err = cdc.UnmarshalBinaryReader(f, &fc, 0)
|
||||||
wire.ReadBinaryPtr(&fc, f, MaxFullCommitSize, &n, &err)
|
if err != nil {
|
||||||
return fc, errors.WithStack(err)
|
return fc, errors.WithStack(err)
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFullCommitJSON loads the commit from the file system in JSON format.
|
// LoadFullCommitJSON loads the commit from the file system in JSON format.
|
||||||
@ -73,7 +81,13 @@ func LoadFullCommitJSON(path string) (lite.FullCommit, error) {
|
|||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
stream := json.NewDecoder(f)
|
bz, err := ioutil.ReadAll(f)
|
||||||
err = stream.Decode(&fc)
|
if err != nil {
|
||||||
return fc, errors.WithStack(err)
|
return fc, errors.WithStack(err)
|
||||||
|
}
|
||||||
|
err = cdc.UnmarshalJSON(bz, &fc)
|
||||||
|
if err != nil {
|
||||||
|
return fc, errors.WithStack(err)
|
||||||
|
}
|
||||||
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
12
lite/files/wire.go
Normal file
12
lite/files/wire.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package files
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tendermint/go-amino"
|
||||||
|
"github.com/tendermint/go-crypto"
|
||||||
|
)
|
||||||
|
|
||||||
|
var cdc = amino.NewCodec()
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
crypto.RegisterAmino(cdc)
|
||||||
|
}
|
@ -23,7 +23,7 @@ type ValKeys []crypto.PrivKey
|
|||||||
func GenValKeys(n int) ValKeys {
|
func GenValKeys(n int) ValKeys {
|
||||||
res := make(ValKeys, n)
|
res := make(ValKeys, n)
|
||||||
for i := range res {
|
for i := range res {
|
||||||
res[i] = crypto.GenPrivKeyEd25519().Wrap()
|
res[i] = crypto.GenPrivKeyEd25519()
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ func GenValKeys(n int) ValKeys {
|
|||||||
func (v ValKeys) Change(i int) ValKeys {
|
func (v ValKeys) Change(i int) ValKeys {
|
||||||
res := make(ValKeys, len(v))
|
res := make(ValKeys, len(v))
|
||||||
copy(res, v)
|
copy(res, v)
|
||||||
res[i] = crypto.GenPrivKeyEd25519().Wrap()
|
res[i] = crypto.GenPrivKeyEd25519()
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ func (v ValKeys) Extend(n int) ValKeys {
|
|||||||
func GenSecpValKeys(n int) ValKeys {
|
func GenSecpValKeys(n int) ValKeys {
|
||||||
res := make(ValKeys, n)
|
res := make(ValKeys, n)
|
||||||
for i := range res {
|
for i := range res {
|
||||||
res[i] = crypto.GenPrivKeySecp256k1().Wrap()
|
res[i] = crypto.GenPrivKeySecp256k1()
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,12 @@ package proxy
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/tendermint/go-amino"
|
||||||
"github.com/tendermint/tmlibs/log"
|
"github.com/tendermint/tmlibs/log"
|
||||||
|
|
||||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||||
"github.com/tendermint/tendermint/rpc/core"
|
"github.com/tendermint/tendermint/rpc/core"
|
||||||
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||||
rpc "github.com/tendermint/tendermint/rpc/lib/server"
|
rpc "github.com/tendermint/tendermint/rpc/lib/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,13 +25,15 @@ func StartProxy(c rpcclient.Client, listenAddr string, logger log.Logger) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cdc := amino.NewCodec()
|
||||||
|
ctypes.RegisterAmino(cdc)
|
||||||
r := RPCRoutes(c)
|
r := RPCRoutes(c)
|
||||||
|
|
||||||
// build the handler...
|
// build the handler...
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
rpc.RegisterRPCFuncs(mux, r, logger)
|
rpc.RegisterRPCFuncs(mux, r, cdc, logger)
|
||||||
|
|
||||||
wm := rpc.NewWebsocketManager(r, rpc.EventSubscriber(c))
|
wm := rpc.NewWebsocketManager(r, cdc, rpc.EventSubscriber(c))
|
||||||
wm.SetLogger(logger)
|
wm.SetLogger(logger)
|
||||||
core.SetLogger(logger)
|
core.SetLogger(logger)
|
||||||
mux.HandleFunc(wsEndpoint, wm.WebsocketHandler)
|
mux.HandleFunc(wsEndpoint, wm.WebsocketHandler)
|
||||||
|
@ -73,7 +73,7 @@ func benchmarkEventBus(numClients int, randQueries bool, randEvents bool, b *tes
|
|||||||
eventType = randEvent()
|
eventType = randEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.Publish(eventType, "Gamora")
|
eventBus.Publish(eventType, EventDataString("Gamora"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,15 +47,17 @@ func (_ EventDataTx) AssertIsTMEventData() {}
|
|||||||
func (_ EventDataRoundState) AssertIsTMEventData() {}
|
func (_ EventDataRoundState) AssertIsTMEventData() {}
|
||||||
func (_ EventDataVote) AssertIsTMEventData() {}
|
func (_ EventDataVote) AssertIsTMEventData() {}
|
||||||
func (_ EventDataProposalHeartbeat) AssertIsTMEventData() {}
|
func (_ EventDataProposalHeartbeat) AssertIsTMEventData() {}
|
||||||
|
func (_ EventDataString) AssertIsTMEventData() {}
|
||||||
|
|
||||||
func RegisterEventDatas(cdc *amino.Codec) {
|
func RegisterEventDatas(cdc *amino.Codec) {
|
||||||
cdc.RegisterInterface((*TMEventData)(nil), nil)
|
cdc.RegisterInterface((*TMEventData)(nil), nil)
|
||||||
cdc.RegisterConcrete(EventDataNewBlock{}, "tendermint/EventDataNameNewBlock", nil)
|
cdc.RegisterConcrete(EventDataNewBlock{}, "tendermint/event/NewBlock", nil)
|
||||||
cdc.RegisterConcrete(EventDataNewBlockHeader{}, "tendermint/EventDataNameNewBlockHeader", nil)
|
cdc.RegisterConcrete(EventDataNewBlockHeader{}, "tendermint/event/NewBlockHeader", nil)
|
||||||
cdc.RegisterConcrete(EventDataTx{}, "tendermint/EventDataNameTx", nil)
|
cdc.RegisterConcrete(EventDataTx{}, "tendermint/event/Tx", nil)
|
||||||
cdc.RegisterConcrete(EventDataRoundState{}, "tendermint/EventDataNameRoundState", nil)
|
cdc.RegisterConcrete(EventDataRoundState{}, "tendermint/event/RoundState", nil)
|
||||||
cdc.RegisterConcrete(EventDataVote{}, "tendermint/EventDataNameVote", nil)
|
cdc.RegisterConcrete(EventDataVote{}, "tendermint/event/Vote", nil)
|
||||||
cdc.RegisterConcrete(EventDataProposalHeartbeat{}, "tendermint/EventDataNameProposalHeartbeat", nil)
|
cdc.RegisterConcrete(EventDataProposalHeartbeat{}, "tendermint/event/ProposalHeartbeat", nil)
|
||||||
|
cdc.RegisterConcrete(EventDataString(""), "tendermint/event/ProposalString", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Most event messages are basic types (a block, a transaction)
|
// Most event messages are basic types (a block, a transaction)
|
||||||
@ -93,6 +95,8 @@ type EventDataVote struct {
|
|||||||
Vote *Vote
|
Vote *Vote
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EventDataString string
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// PUBSUB
|
// PUBSUB
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user