Skip to content

Commit

Permalink
prettify logs and prepare new version
Browse files Browse the repository at this point in the history
  • Loading branch information
danil-lashin committed Jul 4, 2018
1 parent 6b8abd1 commit bcf9bb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## 0.0.5
*Jule 3rd, 2018*
*Jule 4rd, 2018*

BREAKING CHANGES

Expand Down
2 changes: 1 addition & 1 deletion cmd/minter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions core/minter/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -32,6 +32,7 @@ type Blockchain struct {
rewards *big.Int
activeValidators abciTypes.Validators
validatorsStatuses map[string]int8
logger log.Logger

BaseCoin types.CoinSymbol
}
Expand All @@ -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)

Expand All @@ -66,6 +67,7 @@ func NewMinterBlockchain() *Blockchain {
blockchain = &Blockchain{
db: db,
BaseCoin: types.GetBaseCoin(),
logger: logger,
}

blockchain.updateCurrentRootHash()
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions networks/testnet/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"validators": [
{
"pub_key": {
"type": "AC26791624DE60",
"type": "tendermint/PubKeyEd25519",
"value": "qu4d3zD/VMkHFdkotWZS/FEb7Tci5Ylz6O+Ub12uOXk="
},
"power": 100,
"power": "100",
"name": ""
}
],
Expand Down

0 comments on commit bcf9bb7

Please sign in to comment.