From bcf9bb7adf3d6e0b0cb0a9290bbc6eb71aa06dba Mon Sep 17 00:00:00 2001 From: Daniil Lashin Date: Wed, 4 Jul 2018 10:04:07 +0300 Subject: [PATCH] prettify logs and prepare new version --- CHANGELOG.md | 2 +- cmd/minter/main.go | 2 +- core/minter/minter.go | 8 +++++--- networks/testnet/genesis.json | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b84b4339..9fed4ffc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## 0.0.5 -*Jule 3rd, 2018* +*Jule 4rd, 2018* BREAKING CHANGES diff --git a/cmd/minter/main.go b/cmd/minter/main.go index 43ad983f9..97c7c1f11 100644 --- a/cmd/minter/main.go +++ b/cmd/minter/main.go @@ -13,7 +13,7 @@ import ( func main() { logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) - app := minter.NewMinterBlockchain() + app := minter.NewMinterBlockchain(logger) // Start the listener srv, err := server.NewServer(*utils.MinterAppAddrFlag, "socket", app) diff --git a/core/minter/minter.go b/core/minter/minter.go index dc6ac7b43..74b29ea0f 100644 --- a/core/minter/minter.go +++ b/core/minter/minter.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/binary" "encoding/json" - "fmt" "github.com/MinterTeam/minter-go-node/cmd/utils" "github.com/MinterTeam/minter-go-node/core/code" "github.com/MinterTeam/minter-go-node/core/rewards" @@ -16,6 +15,7 @@ import ( "github.com/MinterTeam/minter-go-node/helpers" "github.com/MinterTeam/minter-go-node/mintdb" abciTypes "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/rpc/core/types" "github.com/tendermint/tendermint/rpc/lib/client" "math/big" @@ -32,6 +32,7 @@ type Blockchain struct { rewards *big.Int activeValidators abciTypes.Validators validatorsStatuses map[string]int8 + logger log.Logger BaseCoin types.CoinSymbol } @@ -55,7 +56,7 @@ var ( airdropAddress = types.HexToAddress("Mxa93163fdf10724dc4785ff5cbfb9ac0b5949409f") ) -func NewMinterBlockchain() *Blockchain { +func NewMinterBlockchain(logger log.Logger) *Blockchain { db, err := mintdb.NewLDBDatabase(utils.GetMinterHome()+"/data", 1000, 1000) @@ -66,6 +67,7 @@ func NewMinterBlockchain() *Blockchain { blockchain = &Blockchain{ db: db, BaseCoin: types.GetBaseCoin(), + logger: logger, } blockchain.updateCurrentRootHash() @@ -261,7 +263,7 @@ func (app *Blockchain) DeliverTx(rawTx []byte) abciTypes.ResponseDeliverTx { Log: "TX service data length is over 128 bytes"} } - fmt.Println("deliver", tx) + app.logger.Info("Deliver tx", "tx", tx.String()) response := transaction.RunTx(app.stateDeliver, false, tx, app.rewards, app.height) diff --git a/networks/testnet/genesis.json b/networks/testnet/genesis.json index c3dc06be8..c074f16b5 100644 --- a/networks/testnet/genesis.json +++ b/networks/testnet/genesis.json @@ -4,10 +4,10 @@ "validators": [ { "pub_key": { - "type": "AC26791624DE60", + "type": "tendermint/PubKeyEd25519", "value": "qu4d3zD/VMkHFdkotWZS/FEb7Tci5Ylz6O+Ub12uOXk=" }, - "power": 100, + "power": "100", "name": "" } ],