mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-21 17:01:35 +00:00
Config names have no dots, are under_scored.
This commit is contained in:
@ -15,16 +15,16 @@ var alertCountSince int = 0
|
|||||||
func Alert(message string) {
|
func Alert(message string) {
|
||||||
log.Error("<!> ALERT <!>\n" + message)
|
log.Error("<!> ALERT <!>\n" + message)
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
if now-lastAlertUnix > int64(config.App().GetInt("Alert.MinInterval")) {
|
if now-lastAlertUnix > int64(config.App().GetInt("alert_min_interval")) {
|
||||||
message = fmt.Sprintf("%v:%v", config.App().GetString("Network"), message)
|
message = fmt.Sprintf("%v:%v", config.App().GetString("network"), message)
|
||||||
if alertCountSince > 0 {
|
if alertCountSince > 0 {
|
||||||
message = fmt.Sprintf("%v (+%v more since)", message, alertCountSince)
|
message = fmt.Sprintf("%v (+%v more since)", message, alertCountSince)
|
||||||
alertCountSince = 0
|
alertCountSince = 0
|
||||||
}
|
}
|
||||||
if len(config.App().GetString("Alert.TwilioSid")) > 0 {
|
if len(config.App().GetString("alert_twilio_sid")) > 0 {
|
||||||
go sendTwilio(message)
|
go sendTwilio(message)
|
||||||
}
|
}
|
||||||
if len(config.App().GetString("Alert.EmailRecipients")) > 0 {
|
if len(config.App().GetString("alert_email_recipients")) > 0 {
|
||||||
go sendEmail(message)
|
go sendEmail(message)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -41,8 +41,8 @@ func sendTwilio(message string) {
|
|||||||
if len(message) > 50 {
|
if len(message) > 50 {
|
||||||
message = message[:50]
|
message = message[:50]
|
||||||
}
|
}
|
||||||
twilio := gotwilio.NewTwilioClient(config.App().GetString("Alert.TwilioSid"), config.App().GetString("Alert.TwilioToken"))
|
twilio := gotwilio.NewTwilioClient(config.App().GetString("alert_twilio_sid"), config.App().GetString("alert_twilio_token"))
|
||||||
res, exp, err := twilio.SendSMS(config.App().GetString("Alert.TwilioFrom"), config.App().GetString("Alert.TwilioTo"), message, "", "")
|
res, exp, err := twilio.SendSMS(config.App().GetString("alert_twilio_from"), config.App().GetString("alert_twilio_to"), message, "", "")
|
||||||
if exp != nil || err != nil {
|
if exp != nil || err != nil {
|
||||||
log.Error("sendTwilio error", "res", res, "exp", exp, "error", err)
|
log.Error("sendTwilio error", "res", res, "exp", exp, "error", err)
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ func sendEmail(message string) {
|
|||||||
if len(subject) > 80 {
|
if len(subject) > 80 {
|
||||||
subject = subject[:80]
|
subject = subject[:80]
|
||||||
}
|
}
|
||||||
err := SendEmail(subject, message, config.App().GetStringSlice("Alert.EmailRecipients"))
|
err := SendEmail(subject, message, config.App().GetStringSlice("alert_email_recipients"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("sendEmail error", "error", err, "message", message)
|
log.Error("sendEmail error", "error", err, "message", message)
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
// Convenience function
|
// Convenience function
|
||||||
func SendEmail(subject, body string, tos []string) error {
|
func SendEmail(subject, body string, tos []string) error {
|
||||||
email := Compose(subject, body)
|
email := Compose(subject, body)
|
||||||
email.From = config.App().GetString("SMTP.User")
|
email.From = config.App().GetString("smtp_user")
|
||||||
email.ContentType = "text/html; charset=utf-8"
|
email.ContentType = "text/html; charset=utf-8"
|
||||||
email.AddRecipients(tos...)
|
email.AddRecipients(tos...)
|
||||||
err := email.Send()
|
err := email.Send()
|
||||||
@ -86,12 +86,12 @@ func (e *Email) Send() error {
|
|||||||
|
|
||||||
auth := smtp.PlainAuth(
|
auth := smtp.PlainAuth(
|
||||||
"",
|
"",
|
||||||
config.App().GetString("SMTP.User"),
|
config.App().GetString("smtp_user"),
|
||||||
config.App().GetString("SMTP.Password"),
|
config.App().GetString("smtp_password"),
|
||||||
config.App().GetString("SMTP.Host"),
|
config.App().GetString("smtp_host"),
|
||||||
)
|
)
|
||||||
|
|
||||||
conn, err := smtp.Dial(fmt.Sprintf("%v:%v", config.App().GetString("SMTP.Host"), config.App().GetString("SMTP.Port")))
|
conn, err := smtp.Dial(fmt.Sprintf("%v:%v", config.App().GetString("smtp_host"), config.App().GetString("smtp_port")))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ Paste the following JSON into your %v file
|
|||||||
%v
|
%v
|
||||||
|
|
||||||
`,
|
`,
|
||||||
config.App().GetString("PrivValidatorFile"),
|
config.App().GetString("priv_validator_file"),
|
||||||
string(privValidatorJSONBytes),
|
string(privValidatorJSONBytes),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
func reset_priv_validator() {
|
func reset_priv_validator() {
|
||||||
// Get PrivValidator
|
// Get PrivValidator
|
||||||
var privValidator *sm.PrivValidator
|
var privValidator *sm.PrivValidator
|
||||||
privValidatorFile := config.App().GetString("PrivValidatorFile")
|
privValidatorFile := config.App().GetString("priv_validator_file")
|
||||||
if _, err := os.Stat(privValidatorFile); err == nil {
|
if _, err := os.Stat(privValidatorFile); err == nil {
|
||||||
privValidator = sm.LoadPrivValidator(privValidatorFile)
|
privValidator = sm.LoadPrivValidator(privValidatorFile)
|
||||||
privValidator.LastHeight = 0
|
privValidator.LastHeight = 0
|
||||||
|
@ -35,33 +35,14 @@ func SetApp(a *confer.Config) {
|
|||||||
var defaultConfig = `# This is a TOML config file.
|
var defaultConfig = `# This is a TOML config file.
|
||||||
# For more information, see https://github.com/toml-lang/toml
|
# For more information, see https://github.com/toml-lang/toml
|
||||||
|
|
||||||
Moniker = "anonymous"
|
network = "tendermint_testnet_5"
|
||||||
Network = "tendermint_testnet4.2"
|
moniker = "anonymous"
|
||||||
ListenAddr = "0.0.0.0:46656"
|
node_laddr = "0.0.0.0:46656"
|
||||||
# First node to connect to. Command-line overridable.
|
seeds = "goldenalchemist.chaintest.net:46656"
|
||||||
SeedNode = ""
|
fast_sync = true
|
||||||
# Pool of seeds. Best to use these, and specify one on command line
|
db_backend = "leveldb"
|
||||||
# if needed to override
|
log_level = "debug"
|
||||||
SeedNodes = ["navytoad.chaintest.net:46656", "whiteferret.chaintest.net:46656", "magentagriffin.chaintest.net:46656", "greensalamander.chaintest.net:46656", "blackshadow.chaintest.net:46656", "purpleanteater.chaintest.net:46656", "pinkpenguin.chaintest.net:46656", "polkapig.chaintest.net:46656", "128.199.230.153:8080"]
|
rpc_laddr = "0.0.0.0:46657"
|
||||||
|
|
||||||
|
|
||||||
[DB]
|
|
||||||
# The only other available backend is "memdb"
|
|
||||||
Backend = "leveldb"
|
|
||||||
# Dir = "~/.tendermint/data"
|
|
||||||
|
|
||||||
[Log.Stdout]
|
|
||||||
Level = "debug"
|
|
||||||
|
|
||||||
[RPC.HTTP]
|
|
||||||
# For the RPC API HTTP server. Port required.
|
|
||||||
ListenAddr = "0.0.0.0:46657"
|
|
||||||
|
|
||||||
[Alert]
|
|
||||||
# TODO: Document options
|
|
||||||
|
|
||||||
[SMTP]
|
|
||||||
# TODO: Document options
|
|
||||||
`
|
`
|
||||||
|
|
||||||
var DefaultGenesis = `{
|
var DefaultGenesis = `{
|
||||||
@ -141,19 +122,18 @@ var DefaultGenesis = `{
|
|||||||
|
|
||||||
// NOTE: If you change this, maybe also change defaultConfig
|
// NOTE: If you change this, maybe also change defaultConfig
|
||||||
func initDefaults(rootDir string) {
|
func initDefaults(rootDir string) {
|
||||||
app.SetDefault("Moniker", "anonymous")
|
app.SetDefault("network", "tendermint_testnet0")
|
||||||
app.SetDefault("Network", "tendermint_testnet0")
|
app.SetDefault("genesis_file", rootDir+"/genesis.json")
|
||||||
app.SetDefault("ListenAddr", "0.0.0.0:46656")
|
app.SetDefault("moniker", "anonymous")
|
||||||
app.SetDefault("DB.Backend", "leveldb")
|
app.SetDefault("node_laddr", "0.0.0.0:46656")
|
||||||
app.SetDefault("DB.Dir", rootDir+"/data")
|
app.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
|
||||||
app.SetDefault("Log.Stdout.Level", "info")
|
app.SetDefault("fast_sync", true)
|
||||||
app.SetDefault("RPC.HTTP.ListenAddr", "0.0.0.0:46657")
|
app.SetDefault("addrbook_file", rootDir+"/addrbook.json")
|
||||||
|
app.SetDefault("priv_validator_file", rootDir+"/priv_validator.json")
|
||||||
app.SetDefault("GenesisFile", rootDir+"/genesis.json")
|
app.SetDefault("db_backend", "leveldb")
|
||||||
app.SetDefault("AddrBookFile", rootDir+"/addrbook.json")
|
app.SetDefault("db_dir", rootDir+"/data")
|
||||||
app.SetDefault("PrivValidatorfile", rootDir+"/priv_validator.json")
|
app.SetDefault("log_level", "info")
|
||||||
|
app.SetDefault("rpc_laddr", "0.0.0.0:46657")
|
||||||
app.SetDefault("FastSync", false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init(rootDir string) {
|
func Init(rootDir string) {
|
||||||
@ -209,11 +189,12 @@ func ParseFlags(args []string) {
|
|||||||
|
|
||||||
// Declare flags
|
// Declare flags
|
||||||
flags.BoolVar(&printHelp, "help", false, "Print this help message.")
|
flags.BoolVar(&printHelp, "help", false, "Print this help message.")
|
||||||
flags.String("listen_addr", app.GetString("ListenAddr"), "Listen address. (0.0.0.0:0 means any interface, any port)")
|
flags.String("moniker", app.GetString("moniker"), "Node Name")
|
||||||
flags.String("seed_node", app.GetString("SeedNode"), "Address of seed nodes")
|
flags.String("node_laddr", app.GetString("node_laddr"), "Node listen address. (0.0.0.0:0 means any interface, any port)")
|
||||||
flags.String("rpc_http_listen_addr", app.GetString("RPC.HTTP.ListenAddr"), "RPC listen address. Port required")
|
flags.String("seeds", app.GetString("seeds"), "Comma delimited seed nodes")
|
||||||
flags.Bool("fast_sync", app.GetBool("FastSync"), "Fast blockchain syncing")
|
flags.Bool("fast_sync", app.GetBool("fast_sync"), "Fast blockchain syncing")
|
||||||
flags.String("log_stdout_level", app.GetString("Log.Stdout.Level"), "Stdout log level")
|
flags.String("rpc_laddr", app.GetString("rpc_laddr"), "RPC listen address. Port required")
|
||||||
|
flags.String("log_level", app.GetString("log_level"), "Log level")
|
||||||
flags.Parse(args)
|
flags.Parse(args)
|
||||||
if printHelp {
|
if printHelp {
|
||||||
flags.PrintDefaults()
|
flags.PrintDefaults()
|
||||||
@ -221,11 +202,12 @@ func ParseFlags(args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Merge parsed flag values onto app.
|
// Merge parsed flag values onto app.
|
||||||
app.BindPFlag("ListenAddr", flags.Lookup("listen_addr"))
|
app.BindPFlag("moniker", flags.Lookup("moniker"))
|
||||||
app.BindPFlag("SeedNode", flags.Lookup("seed_node"))
|
app.BindPFlag("node_laddr", flags.Lookup("node_laddr"))
|
||||||
app.BindPFlag("FastSync", flags.Lookup("fast_sync"))
|
app.BindPFlag("seeds", flags.Lookup("seeds"))
|
||||||
app.BindPFlag("RPC.HTTP.ListenAddr", flags.Lookup("rpc_http_listen_addr"))
|
app.BindPFlag("fast_sync", flags.Lookup("fast_sync"))
|
||||||
app.BindPFlag("Log.Stdout.Level", flags.Lookup("log_stdout_level"))
|
app.BindPFlag("rpc_laddr", flags.Lookup("rpc_laddr"))
|
||||||
|
app.BindPFlag("log_level", flags.Lookup("log_level"))
|
||||||
|
|
||||||
// Confused?
|
// Confused?
|
||||||
//app.Debug()
|
//app.Debug()
|
||||||
|
@ -657,7 +657,7 @@ func (cs *ConsensusState) RunActionPropose(height uint, round uint) {
|
|||||||
txs := cs.mempoolReactor.Mempool.GetProposalTxs()
|
txs := cs.mempoolReactor.Mempool.GetProposalTxs()
|
||||||
block = &types.Block{
|
block = &types.Block{
|
||||||
Header: &types.Header{
|
Header: &types.Header{
|
||||||
Network: config.App().GetString("Network"),
|
Network: config.App().GetString("network"),
|
||||||
Height: cs.Height,
|
Height: cs.Height,
|
||||||
Time: time.Now(),
|
Time: time.Now(),
|
||||||
Fees: 0, // TODO fees
|
Fees: 0, // TODO fees
|
||||||
|
@ -41,7 +41,7 @@ func (p *Proposal) String() string {
|
|||||||
|
|
||||||
func (p *Proposal) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (p *Proposal) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(`,"proposal":{"block_parts":`), w, n, err)
|
binary.WriteTo([]byte(`,"proposal":{"block_parts":`), w, n, err)
|
||||||
p.BlockParts.WriteSignBytes(w, n, err)
|
p.BlockParts.WriteSignBytes(w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"height":%v,"pol_parts":`, p.Height)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"height":%v,"pol_parts":`, p.Height)), w, n, err)
|
||||||
|
@ -20,7 +20,7 @@ func TestProposalSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(proposal)
|
signBytes := account.SignBytes(proposal)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","proposal":{"block_parts":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_parts":{"hash":"706F6C7061727473","total":222},"round":23456}}`,
|
expected := Fmt(`{"network":"%X","proposal":{"block_parts":{"hash":"626C6F636B7061727473","total":111},"height":12345,"pol_parts":{"hash":"706F6C7061727473","total":222},"round":23456}}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||||
}
|
}
|
||||||
|
6
db/db.go
6
db/db.go
@ -32,19 +32,19 @@ func GetDB(name string) DB {
|
|||||||
if db != nil {
|
if db != nil {
|
||||||
return db.(DB)
|
return db.(DB)
|
||||||
}
|
}
|
||||||
switch config.App().GetString("DB.Backend") {
|
switch config.App().GetString("db_backend") {
|
||||||
case DBBackendMemDB:
|
case DBBackendMemDB:
|
||||||
db := NewMemDB()
|
db := NewMemDB()
|
||||||
dbs.Set(name, db)
|
dbs.Set(name, db)
|
||||||
return db
|
return db
|
||||||
case DBBackendLevelDB:
|
case DBBackendLevelDB:
|
||||||
db, err := NewLevelDB(path.Join(config.App().GetString("DB.Dir"), name+".db"))
|
db, err := NewLevelDB(path.Join(config.App().GetString("db_dir"), name+".db"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
dbs.Set(name, db)
|
dbs.Set(name, db)
|
||||||
return db
|
return db
|
||||||
default:
|
default:
|
||||||
panic(Fmt("Unknown DB backend: %v", config.App().GetString("DB.Backend")))
|
panic(Fmt("Unknown DB backend: %v", config.App().GetString("db_backend")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ func Reset() {
|
|||||||
|
|
||||||
// stdout handler
|
// stdout handler
|
||||||
stdoutHandler := log15.LvlFilterHandler(
|
stdoutHandler := log15.LvlFilterHandler(
|
||||||
getLevel(config.App().GetString("Log.Stdout.Level")),
|
getLevel(config.App().GetString("log_level")),
|
||||||
log15.StreamHandler(os.Stdout, log15.TerminalFormat()),
|
log15.StreamHandler(os.Stdout, log15.TerminalFormat()),
|
||||||
)
|
)
|
||||||
handlers = append(handlers, stdoutHandler)
|
handlers = append(handlers, stdoutHandler)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Maybe also write to a file.
|
// Maybe also write to a file.
|
||||||
if _logFileDir := config.App().GetString("Log.File.Dir"); _logFileDir != "" {
|
if _logFileDir := config.App().GetString("log_file_dir"); _logFileDir != "" {
|
||||||
// Create log dir if it doesn't exist
|
// Create log dir if it doesn't exist
|
||||||
err := os.MkdirAll(_logFileDir, 0700)
|
err := os.MkdirAll(_logFileDir, 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -36,7 +36,7 @@ func Reset() {
|
|||||||
}
|
}
|
||||||
// File handler
|
// File handler
|
||||||
handlers = append(handlers, log15.LvlFilterHandler(
|
handlers = append(handlers, log15.LvlFilterHandler(
|
||||||
getLevel(config.App().GetString("Log.File.Level")),
|
getLevel(config.App().GetString("log_file_level")),
|
||||||
log15.Must.FileHandler(_logFileDir+"/tendermint.log", log15.LogfmtFormat()),
|
log15.Must.FileHandler(_logFileDir+"/tendermint.log", log15.LogfmtFormat()),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
37
node/node.go
37
node/node.go
@ -7,6 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
bc "github.com/tendermint/tendermint/blockchain"
|
bc "github.com/tendermint/tendermint/blockchain"
|
||||||
@ -53,13 +54,13 @@ func NewNode() *Node {
|
|||||||
stateDB := dbm.GetDB("state")
|
stateDB := dbm.GetDB("state")
|
||||||
state := sm.LoadState(stateDB)
|
state := sm.LoadState(stateDB)
|
||||||
if state == nil {
|
if state == nil {
|
||||||
state = sm.MakeGenesisStateFromFile(stateDB, config.App().GetString("GenesisFile"))
|
state = sm.MakeGenesisStateFromFile(stateDB, config.App().GetString("genesis_file"))
|
||||||
state.Save()
|
state.Save()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get PrivValidator
|
// Get PrivValidator
|
||||||
var privValidator *sm.PrivValidator
|
var privValidator *sm.PrivValidator
|
||||||
privValidatorFile := config.App().GetString("PrivValidatorFile")
|
privValidatorFile := config.App().GetString("priv_validator_file")
|
||||||
if _, err := os.Stat(privValidatorFile); err == nil {
|
if _, err := os.Stat(privValidatorFile); err == nil {
|
||||||
privValidator = sm.LoadPrivValidator(privValidatorFile)
|
privValidator = sm.LoadPrivValidator(privValidatorFile)
|
||||||
log.Info("Loaded PrivValidator",
|
log.Info("Loaded PrivValidator",
|
||||||
@ -75,11 +76,11 @@ func NewNode() *Node {
|
|||||||
eventSwitch.Start()
|
eventSwitch.Start()
|
||||||
|
|
||||||
// Get PEXReactor
|
// Get PEXReactor
|
||||||
book := p2p.NewAddrBook(config.App().GetString("AddrBookFile"))
|
book := p2p.NewAddrBook(config.App().GetString("addrbook_file"))
|
||||||
pexReactor := p2p.NewPEXReactor(book)
|
pexReactor := p2p.NewPEXReactor(book)
|
||||||
|
|
||||||
// Get BlockchainReactor
|
// Get BlockchainReactor
|
||||||
bcReactor := bc.NewBlockchainReactor(state, blockStore, config.App().GetBool("FastSync"))
|
bcReactor := bc.NewBlockchainReactor(state, blockStore, config.App().GetBool("fast_sync"))
|
||||||
|
|
||||||
// Get MempoolReactor
|
// Get MempoolReactor
|
||||||
mempool := mempl.NewMempool(state.Copy())
|
mempool := mempl.NewMempool(state.Copy())
|
||||||
@ -93,7 +94,7 @@ func NewNode() *Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// so the consensus reactor won't do anything until we're synced
|
// so the consensus reactor won't do anything until we're synced
|
||||||
if config.App().GetBool("FastSync") {
|
if config.App().GetBool("fast_sync") {
|
||||||
consensusReactor.SetSyncing(true)
|
consensusReactor.SetSyncing(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,16 +156,8 @@ func (n *Node) AddListener(l p2p.Listener) {
|
|||||||
|
|
||||||
// NOTE: Blocking
|
// NOTE: Blocking
|
||||||
func (n *Node) DialSeed() {
|
func (n *Node) DialSeed() {
|
||||||
// if the single seed node is available, use only it
|
|
||||||
prioritySeed := config.App().GetString("SeedNode")
|
|
||||||
if prioritySeed != "" {
|
|
||||||
addr := p2p.NewNetAddressString(prioritySeed)
|
|
||||||
n.dialSeed(addr)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// permute the list, dial them in random order.
|
// permute the list, dial them in random order.
|
||||||
seeds := config.App().GetStringSlice("SeedNodes")
|
seeds := strings.Split(config.App().GetString("seeds"), ",")
|
||||||
perm := rand.Perm(len(seeds))
|
perm := rand.Perm(len(seeds))
|
||||||
for i := 0; i < len(perm); i++ {
|
for i := 0; i < len(perm); i++ {
|
||||||
go func(i int) {
|
go func(i int) {
|
||||||
@ -195,7 +188,7 @@ func (n *Node) StartRPC() {
|
|||||||
core.SetMempoolReactor(n.mempoolReactor)
|
core.SetMempoolReactor(n.mempoolReactor)
|
||||||
core.SetSwitch(n.sw)
|
core.SetSwitch(n.sw)
|
||||||
|
|
||||||
listenAddr := config.App().GetString("RPC.HTTP.ListenAddr")
|
listenAddr := config.App().GetString("rpc_laddr")
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
rpc.RegisterEventsHandler(mux, n.evsw)
|
rpc.RegisterEventsHandler(mux, n.evsw)
|
||||||
rpc.RegisterRPCFuncs(mux, core.Routes)
|
rpc.RegisterRPCFuncs(mux, core.Routes)
|
||||||
@ -220,8 +213,8 @@ func (n *Node) EventSwitch() *events.EventSwitch {
|
|||||||
|
|
||||||
func makeNodeInfo(sw *p2p.Switch) *types.NodeInfo {
|
func makeNodeInfo(sw *p2p.Switch) *types.NodeInfo {
|
||||||
nodeInfo := &types.NodeInfo{
|
nodeInfo := &types.NodeInfo{
|
||||||
Moniker: config.App().GetString("Moniker"),
|
Network: config.App().GetString("network"),
|
||||||
Network: config.App().GetString("Network"),
|
Moniker: config.App().GetString("moniker"),
|
||||||
Version: "0.2.0", // Everything is in Big Endian.
|
Version: "0.2.0", // Everything is in Big Endian.
|
||||||
}
|
}
|
||||||
if !sw.IsListening() {
|
if !sw.IsListening() {
|
||||||
@ -230,11 +223,11 @@ func makeNodeInfo(sw *p2p.Switch) *types.NodeInfo {
|
|||||||
p2pListener := sw.Listeners()[0]
|
p2pListener := sw.Listeners()[0]
|
||||||
p2pHost := p2pListener.ExternalAddress().IP.String()
|
p2pHost := p2pListener.ExternalAddress().IP.String()
|
||||||
p2pPort := p2pListener.ExternalAddress().Port
|
p2pPort := p2pListener.ExternalAddress().Port
|
||||||
rpcListenAddr := config.App().GetString("RPC.HTTP.ListenAddr")
|
rpcListenAddr := config.App().GetString("rpc_laddr")
|
||||||
_, rpcPortStr, _ := net.SplitHostPort(rpcListenAddr)
|
_, rpcPortStr, _ := net.SplitHostPort(rpcListenAddr)
|
||||||
rpcPort, err := strconv.Atoi(rpcPortStr)
|
rpcPort, err := strconv.Atoi(rpcPortStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(Fmt("Expected numeric RPC.HTTP.ListenAddr port but got %v", rpcPortStr))
|
panic(Fmt("Expected numeric RPC.ListenAddr port but got %v", rpcPortStr))
|
||||||
}
|
}
|
||||||
|
|
||||||
// We assume that the rpcListener has the same ExternalAddress.
|
// We assume that the rpcListener has the same ExternalAddress.
|
||||||
@ -250,17 +243,17 @@ func makeNodeInfo(sw *p2p.Switch) *types.NodeInfo {
|
|||||||
func RunNode() {
|
func RunNode() {
|
||||||
// Create & start node
|
// Create & start node
|
||||||
n := NewNode()
|
n := NewNode()
|
||||||
l := p2p.NewDefaultListener("tcp", config.App().GetString("ListenAddr"), false)
|
l := p2p.NewDefaultListener("tcp", config.App().GetString("node_laddr"), false)
|
||||||
n.AddListener(l)
|
n.AddListener(l)
|
||||||
n.Start()
|
n.Start()
|
||||||
|
|
||||||
// If seedNode is provided by config, dial out.
|
// If seedNode is provided by config, dial out.
|
||||||
if config.App().GetString("SeedNode") != "" || len(config.App().GetStringSlice("SeedNodes")) != 0 {
|
if len(config.App().GetStringSlice("seeds")) != 0 {
|
||||||
n.DialSeed()
|
n.DialSeed()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the RPC server.
|
// Run the RPC server.
|
||||||
if config.App().GetString("RPC.HTTP.ListenAddr") != "" {
|
if config.App().GetString("rpc_laddr") != "" {
|
||||||
n.StartRPC()
|
n.StartRPC()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
func Status() (*ctypes.ResponseStatus, error) {
|
func Status() (*ctypes.ResponseStatus, error) {
|
||||||
db := dbm.NewMemDB()
|
db := dbm.NewMemDB()
|
||||||
genesisState := sm.MakeGenesisStateFromFile(db, config.App().GetString("GenesisFile"))
|
genesisState := sm.MakeGenesisStateFromFile(db, config.App().GetString("genesis_file"))
|
||||||
genesisHash := genesisState.Hash()
|
genesisHash := genesisState.Hash()
|
||||||
latestHeight := blockStore.Height()
|
latestHeight := blockStore.Height()
|
||||||
var (
|
var (
|
||||||
@ -26,15 +26,15 @@ func Status() (*ctypes.ResponseStatus, error) {
|
|||||||
latestBlockTime = latestBlockMeta.Header.Time.UnixNano()
|
latestBlockTime = latestBlockMeta.Header.Time.UnixNano()
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ctypes.ResponseStatus{genesisHash, config.App().GetString("Network"), latestBlockHash, latestHeight, latestBlockTime}, nil
|
return &ctypes.ResponseStatus{genesisHash, config.App().GetString("network"), latestBlockHash, latestHeight, latestBlockTime}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
||||||
listening := p2pSwitch.IsListening()
|
listening := p2pSwitch.IsListening()
|
||||||
moniker := config.App().GetString("Moniker")
|
moniker := config.App().GetString("moniker")
|
||||||
network := config.App().GetString("Network")
|
network := config.App().GetString("network")
|
||||||
listeners := []string{}
|
listeners := []string{}
|
||||||
for _, listener := range p2pSwitch.Listeners() {
|
for _, listener := range p2pSwitch.Listeners() {
|
||||||
listeners = append(listeners, listener.String())
|
listeners = append(listeners, listener.String())
|
||||||
|
@ -61,7 +61,7 @@ func decodeHex(hexStr string) []byte {
|
|||||||
func newNode(ready chan struct{}) {
|
func newNode(ready chan struct{}) {
|
||||||
// Create & start node
|
// Create & start node
|
||||||
node = nm.NewNode()
|
node = nm.NewNode()
|
||||||
l := p2p.NewDefaultListener("tcp", config.App().GetString("ListenAddr"), false)
|
l := p2p.NewDefaultListener("tcp", config.App().GetString("node_laddr"), false)
|
||||||
node.AddListener(l)
|
node.AddListener(l)
|
||||||
node.Start()
|
node.Start()
|
||||||
|
|
||||||
@ -79,12 +79,12 @@ func init() {
|
|||||||
rootDir := ".tendermint"
|
rootDir := ".tendermint"
|
||||||
config.Init(rootDir)
|
config.Init(rootDir)
|
||||||
app := config.App()
|
app := config.App()
|
||||||
app.Set("SeedNode", "")
|
app.Set("genesis_file", rootDir+"/genesis.json")
|
||||||
app.Set("DB.Backend", "memdb")
|
app.Set("seeds", "")
|
||||||
app.Set("RPC.HTTP.ListenAddr", rpcAddr)
|
app.Set("priv_validator_file", rootDir+"/priv_validator.json")
|
||||||
app.Set("GenesisFile", rootDir+"/genesis.json")
|
app.Set("db_backend", "memdb")
|
||||||
app.Set("PrivValidatorFile", rootDir+"/priv_validator.json")
|
app.Set("rpc_laddr", rpcAddr)
|
||||||
app.Set("Log.Stdout.Level", "debug")
|
app.Set("log_level", "debug")
|
||||||
config.SetApp(app)
|
config.SetApp(app)
|
||||||
logger.Reset()
|
logger.Reset()
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ func testStatus(t *testing.T, typ string) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if resp.Network != config.App().GetString("Network") {
|
if resp.Network != config.App().GetString("network") {
|
||||||
t.Fatal(fmt.Errorf("Network mismatch: got %s expected %s",
|
t.Fatal(fmt.Errorf("Network mismatch: got %s expected %s",
|
||||||
resp.Network, config.App().Get("Network")))
|
resp.Network, config.App().Get("network")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ func GenPrivValidator() *PrivValidator {
|
|||||||
LastHeight: 0,
|
LastHeight: 0,
|
||||||
LastRound: 0,
|
LastRound: 0,
|
||||||
LastStep: stepNone,
|
LastStep: stepNone,
|
||||||
filename: config.App().GetString("PrivValidatorFile"),
|
filename: config.App().GetString("priv_validator_file"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ func TestCopyState(t *testing.T) {
|
|||||||
func makeBlock(t *testing.T, state *State, commits []types.Commit, txs []types.Tx) *types.Block {
|
func makeBlock(t *testing.T, state *State, commits []types.Commit, txs []types.Tx) *types.Block {
|
||||||
block := &types.Block{
|
block := &types.Block{
|
||||||
Header: &types.Header{
|
Header: &types.Header{
|
||||||
Network: config.App().GetString("Network"),
|
Network: config.App().GetString("network"),
|
||||||
Height: state.LastBlockHeight + 1,
|
Height: state.LastBlockHeight + 1,
|
||||||
Time: state.LastBlockTime.Add(time.Minute),
|
Time: state.LastBlockTime.Add(time.Minute),
|
||||||
Fees: 0,
|
Fees: 0,
|
||||||
|
@ -24,7 +24,7 @@ type Block struct {
|
|||||||
// Basic validation that doesn't involve state data.
|
// Basic validation that doesn't involve state data.
|
||||||
func (b *Block) ValidateBasic(lastBlockHeight uint, lastBlockHash []byte,
|
func (b *Block) ValidateBasic(lastBlockHeight uint, lastBlockHash []byte,
|
||||||
lastBlockParts PartSetHeader, lastBlockTime time.Time) error {
|
lastBlockParts PartSetHeader, lastBlockTime time.Time) error {
|
||||||
if b.Network != config.App().GetString("Network") {
|
if b.Network != config.App().GetString("network") {
|
||||||
return errors.New("Wrong Block.Header.Network")
|
return errors.New("Wrong Block.Header.Network")
|
||||||
}
|
}
|
||||||
if b.Height != lastBlockHeight+1 {
|
if b.Height != lastBlockHeight+1 {
|
||||||
|
10
types/tx.go
10
types/tx.go
@ -132,7 +132,7 @@ type SendTx struct {
|
|||||||
|
|
||||||
func (tx *SendTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (tx *SendTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeSend)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeSend)), w, n, err)
|
||||||
for i, in := range tx.Inputs {
|
for i, in := range tx.Inputs {
|
||||||
in.WriteSignBytes(w, n, err)
|
in.WriteSignBytes(w, n, err)
|
||||||
@ -166,7 +166,7 @@ type CallTx struct {
|
|||||||
|
|
||||||
func (tx *CallTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (tx *CallTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","data":"%X"`, TxTypeCall, tx.Address, tx.Data)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","data":"%X"`, TxTypeCall, tx.Address, tx.Data)), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"fee":%v,"gas_limit":%v,"input":`, tx.Fee, tx.GasLimit)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"fee":%v,"gas_limit":%v,"input":`, tx.Fee, tx.GasLimit)), w, n, err)
|
||||||
tx.Input.WriteSignBytes(w, n, err)
|
tx.Input.WriteSignBytes(w, n, err)
|
||||||
@ -187,7 +187,7 @@ type BondTx struct {
|
|||||||
|
|
||||||
func (tx *BondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (tx *BondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeBond)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"inputs":[`, TxTypeBond)), w, n, err)
|
||||||
for i, in := range tx.Inputs {
|
for i, in := range tx.Inputs {
|
||||||
in.WriteSignBytes(w, n, err)
|
in.WriteSignBytes(w, n, err)
|
||||||
@ -221,7 +221,7 @@ type UnbondTx struct {
|
|||||||
|
|
||||||
func (tx *UnbondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (tx *UnbondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeUnbond, tx.Address, tx.Height)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeUnbond, tx.Address, tx.Height)), w, n, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ type RebondTx struct {
|
|||||||
|
|
||||||
func (tx *RebondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (tx *RebondTx) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeRebond, tx.Address, tx.Height)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"tx":[%v,{"address":"%X","height":%v}]}`, TxTypeRebond, tx.Address, tx.Height)), w, n, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func TestSendTxSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(sendTx)
|
signBytes := account.SignBytes(sendTx)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","tx":[1,{"inputs":[{"address":"696E70757431","amount":12345,"sequence":67890},{"address":"696E70757432","amount":111,"sequence":222}],"outputs":[{"address":"6F757470757431","amount":333},{"address":"6F757470757432","amount":444}]}]}`,
|
expected := Fmt(`{"network":"%X","tx":[1,{"inputs":[{"address":"696E70757431","amount":12345,"sequence":67890},{"address":"696E70757432","amount":111,"sequence":222}],"outputs":[{"address":"6F757470757431","amount":333},{"address":"6F757470757432","amount":444}]}]}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
t.Errorf("Got unexpected sign string for SendTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ func TestCallTxSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(callTx)
|
signBytes := account.SignBytes(callTx)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","tx":[2,{"address":"636F6E747261637431","data":"6461746131","fee":222,"gas_limit":111,"input":{"address":"696E70757431","amount":12345,"sequence":67890}}]}`,
|
expected := Fmt(`{"network":"%X","tx":[2,{"address":"636F6E747261637431","data":"6461746131","fee":222,"gas_limit":111,"input":{"address":"696E70757431","amount":12345,"sequence":67890}}]}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for CallTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
t.Errorf("Got unexpected sign string for CallTx. Expected:\n%v\nGot:\n%v", expected, signStr)
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ func TestBondTxSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(bondTx)
|
signBytes := account.SignBytes(bondTx)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","tx":[17,{"inputs":[{"address":"696E70757431","amount":12345,"sequence":67890},{"address":"696E70757432","amount":111,"sequence":222}],"pub_key":[1,"3B6A27BCCEB6A42D62A3A8D02A6F0D73653215771DE243A63AC048A18B59DA29"],"unbond_to":[{"address":"6F757470757431","amount":333},{"address":"6F757470757432","amount":444}]}]}`,
|
expected := Fmt(`{"network":"%X","tx":[17,{"inputs":[{"address":"696E70757431","amount":12345,"sequence":67890},{"address":"696E70757432","amount":111,"sequence":222}],"pub_key":[1,"3B6A27BCCEB6A42D62A3A8D02A6F0D73653215771DE243A63AC048A18B59DA29"],"unbond_to":[{"address":"6F757470757431","amount":333},{"address":"6F757470757432","amount":444}]}]}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for BondTx")
|
t.Errorf("Got unexpected sign string for BondTx")
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ func TestUnbondTxSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(unbondTx)
|
signBytes := account.SignBytes(unbondTx)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","tx":[18,{"address":"6164647265737331","height":111}]}`,
|
expected := Fmt(`{"network":"%X","tx":[18,{"address":"6164647265737331","height":111}]}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for UnbondTx")
|
t.Errorf("Got unexpected sign string for UnbondTx")
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ func TestRebondTxSignable(t *testing.T) {
|
|||||||
signBytes := account.SignBytes(rebondTx)
|
signBytes := account.SignBytes(rebondTx)
|
||||||
signStr := string(signBytes)
|
signStr := string(signBytes)
|
||||||
expected := Fmt(`{"network":"%X","tx":[19,{"address":"6164647265737331","height":111}]}`,
|
expected := Fmt(`{"network":"%X","tx":[19,{"address":"6164647265737331","height":111}]}`,
|
||||||
config.App().GetString("Network"))
|
config.App().GetString("network"))
|
||||||
if signStr != expected {
|
if signStr != expected {
|
||||||
t.Errorf("Got unexpected sign string for RebondTx")
|
t.Errorf("Got unexpected sign string for RebondTx")
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ const (
|
|||||||
|
|
||||||
func (vote *Vote) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
func (vote *Vote) WriteSignBytes(w io.Writer, n *int64, err *error) {
|
||||||
// We hex encode the network name so we don't deal with escaping issues.
|
// We hex encode the network name so we don't deal with escaping issues.
|
||||||
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("Network"))), w, n, err)
|
binary.WriteTo([]byte(Fmt(`{"network":"%X"`, config.App().GetString("network"))), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"vote":{"block_hash":"%X","block_parts":%v`, vote.BlockHash, vote.BlockParts)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"vote":{"block_hash":"%X","block_parts":%v`, vote.BlockHash, vote.BlockParts)), w, n, err)
|
||||||
binary.WriteTo([]byte(Fmt(`,"height":%v,"round":%v,"type":%v}}`, vote.Height, vote.Round, vote.Type)), w, n, err)
|
binary.WriteTo([]byte(Fmt(`,"height":%v,"round":%v,"type":%v}}`, vote.Height, vote.Round, vote.Type)), w, n, err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user