CosmosSDK, first application with scaffold

scaffold

This tool is used to generate skeleton code for an Application blockchain running on CosmosSDK. Internally, it depends on go-bindata which is a package which could embeds binary data into a go program.

scaffold app [lvl] [user] [repo]

where the lvl could be:

  • lvl-1, Auth, Bank, Distribution, Genutil, Genaccounts, Params, Slashing, Staking, Supply
  • lvl-max, Auth, Bank, Crisis, Distribution, Evidence, Genutil, Genaccounts, Gov, Mint, Params, Slashing, Staking, Supply, Upgrade

Generated Code

App generated looks this:
APP skeleton

  • app, app code
  • cmd, cli and daemon entry point

App

Data Structure


// NewApp extended ABCI application
type NewApp struct {
  *bam.BaseApp
  cdc *codec.Codec

  invCheckPeriod uint

  // keys to access the substores
  keys  map[string]*sdk.KVStoreKey
  tKeys map[string]*sdk.TransientStoreKey

  // subspaces
  subspaces map[string]params.Subspace

  // keepers
  accountKeeper  auth.AccountKeeper
  bankKeeper     bank.Keeper
  supplyKeeper   supply.Keeper
  stakingKeeper  staking.Keeper
  slashingKeeper slashing.Keeper
  mintKeeper     mint.Keeper
  distrKeeper    distr.Keeper
  govKeeper      gov.Keeper
  crisisKeeper   crisis.Keeper
  paramsKeeper   params.Keeper
  upgradeKeeper  upgrade.Keeper
  evidenceKeeper evidence.Keeper
  // TODO: Add your module(s)

  // Module Manager
  mm *module.Manager

  // simulation manager
  sm *module.SimulationManager
}

Interfaces

NewAPP has to implement simapp.App interface, which has several common methods for a Cosmos SDK-based application

// App implements the common methods for a Cosmos SDK-based application
// specific blockchain.
type App interface {
	// The assigned name of the app.
	Name() string

	// The application types codec.
	// NOTE: This shoult be sealed before being returned.
	Codec() *codec.Codec

	// Application updates every begin block.
	BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

	// Application updates every end block.
	EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

	// Application update at chain (i.e app) initialization.
	InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

	// Loads the app at a given height.
	LoadHeight(height int64) error

	// Exports the state of the application for a genesis file.
	ExportAppStateAndValidators(
		forZeroHeight bool, jailWhiteList []string,
	) (json.RawMessage, []tmtypes.GenesisValidator, error)

	// All the registered module account addreses.
	ModuleAccountAddrs() map[string]bool

	// Helper for the simulation framework.
	SimulationManager() *module.SimulationManager
}

BaseApp

NewApp accormodates a *bam.BaseApp which actually implements the terdermint ABCI interface:

// Application is an interface that enables any finite, deterministic state machine
// to be driven by a blockchain-based replication engine via the ABCI.
// All methods take a RequestXxx argument and return a ResponseXxx argument,
// except CheckTx/DeliverTx, which take tx []byte, and Commit, which takes nothing.
type Application interface {
// Info/Query Connection
Info(RequestInfo) ResponseInfo // Return application info
SetOption(RequestSetOption) ResponseSetOption // Set application option
Query(RequestQuery) ResponseQuery // Query for state

// Mempool Connection
CheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool

// Consensus Connection
InitChain(RequestInitChain) ResponseInitChain    // Initialize blockchain w validators/other info from TendermintCore
BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block
DeliverTx(RequestDeliverTx) ResponseDeliverTx    // Deliver a tx for full processing
EndBlock(RequestEndBlock) ResponseEndBlock       // Signals the end of a block, returns changes to the validator set
Commit() ResponseCommit                          // Commit the state and return the application Merkle root hash

}



```go

// BaseApp reflects the ABCI application implementation.
type BaseApp struct { // nolint: maligned
	// initialized on creation
	logger      log.Logger
	name        string               // application name from abci.Info
	db          dbm.DB               // common DB backend
	cms         sdk.CommitMultiStore // Main (uncached) state
	storeLoader StoreLoader          // function to handle store loading, may be overridden with SetStoreLoader()
	router      sdk.Router           // handle any kind of message
	queryRouter sdk.QueryRouter      // router for redirecting query calls
	txDecoder   sdk.TxDecoder        // unmarshal []byte into sdk.Tx

	// set upon LoadVersion or LoadLatestVersion.
	baseKey *sdk.KVStoreKey // Main KVStore in cms

	anteHandler    sdk.AnteHandler  // ante handler for fee and auth
	initChainer    sdk.InitChainer  // initialize state with validators and state blob
	beginBlocker   sdk.BeginBlocker // logic to run before any txs
	endBlocker     sdk.EndBlocker   // logic to run after all txs, and to determine valset changes
	addrPeerFilter sdk.PeerFilter   // filter peers by address and port
	idPeerFilter   sdk.PeerFilter   // filter peers by node ID
	fauxMerkleMode bool             // if true, IAVL MountStores uses MountStoresDB for simulation speed.

	// volatile states:
	//
	// checkState is set on InitChain and reset on Commit
	// deliverState is set on InitChain and BeginBlock and set to nil on Commit
	checkState   *state // for CheckTx
	deliverState *state // for DeliverTx

	// an inter-block write-through cache provided to the context during deliverState
	interBlockCache sdk.MultiStorePersistentCache

	// absent validators from begin block
	voteInfos []abci.VoteInfo

	// consensus params
	// TODO: Move this in the future to baseapp param store on main store.
	consensusParams *abci.ConsensusParams

	// The minimum gas prices a validator is willing to accept for processing a
	// transaction. This is mainly used for DoS and spam prevention.
	minGasPrices sdk.DecCoins

	// flag for sealing options and parameters to a BaseApp
	sealed bool

	// block height at which to halt the chain and gracefully shutdown
	haltHeight uint64

	// minimum block time (in Unix seconds) at which to halt the chain and gracefully shutdown
	haltTime uint64

	// application's version string
	appVersion string
}

Appd & Appcli

Appd represents the blockchain node and appcli is the client which is the command line interface for interacting with appd.

Init and Start

  1. To make the config and genesis:

appd init --chain-id test

  1. Create the validator in keystore. On Windows, this will create an account in Credential Manager by default

appcli keys add validator

  name: validator
  type: local
  address: cosmos13n5y7pynxdxy6rezwuyuv98zcgaweg7xypjexd
  pubkey: cosmospub1addwnpepqgmrkvuuxae9wq8z65x5hj4ykmymj5pm2qn3q6klk2z9xqhw4se8
wdqqn6t
  mnemonic: ""
  threshold: 0
  pubkeys: []
cosmosvaloper13n5y7pynxdxy6rezwuyuv98zcgaweg7xp4xv27

**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

time point flat gaze quit control chest dog inch tongue keen furnace area rural
section hollow shrug topple social waste mean club transfer all
  1. Create an account in Genesis

appd add-genesis-account cosmos13n5y7pynxdxy6rezwuyuv98zcgaweg7xypjexd 100000000stake

  1. Generate a TX

appd gentx --name validator --amount 1000000stake

  1. Add TX to Genesis

appd collect-gentxs

Therefore, the genesis will be added with a new account and a TX which will make the account a validator.

  1. start the node

appd start

Note The validator must be set to have 10e6 stake or more, so that it could have enough power.

See code:

		// if we get to a zero-power validator (which we don't bond),
		// there are no more possible bonded validators
		if validator.PotentialConsensusPower() == 0 {
			break
		}
// PowerReduction is the amount of staking tokens required for 1 unit of consensus-engine power
var PowerReduction = NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil))

Start as a remote server

It can be started as a remote server by specifying --with_tendermint=0

appd start --with_tendermint=0

In this case, it will start a socket/grpc(grpc seems not implemented yet) server and try to accept any incoming request from terdermint.

github.com/tendermint/tendermint/abci/server.(*SocketServer).OnStart at socket_server.go:46
github.com/tendermint/tendermint/libs/service.(*BaseService).Start at service.go:139
github.com/cosmos/cosmos-sdk/server.startStandAlone at start.go:115
github.com/cosmos/cosmos-sdk/server.StartCmd.func1 at start.go:62
github.com/spf13/cobra.(*Command).execute at command.go:840
github.com/spf13/cobra.(*Command).ExecuteC at command.go:945
github.com/spf13/cobra.(*Command).Execute at command.go:885
github.com/tendermint/tendermint/libs/cli.Executor.Execute at setup.go:89
main.main at main.go:70
runtime.main at proc.go:203
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
runtime.rt0_go at asm_amd64.s:220

func (s *SocketServer) acceptConnectionsRoutine() {
	for {
		// Accept a connection
		s.Logger.Info("Waiting for new connection...")
		conn, err := s.listener.Accept()
		if err != nil {
			if !s.IsRunning() {
				return // Ignore error from listener closing.
			}
			s.Logger.Error("Failed to accept connection: " + err.Error())
			continue
		}

		s.Logger.Info("Accepted a new connection")

		connID := s.addConn(conn)

		closeConn := make(chan error, 2)              // Push to signal connection closed
		responses := make(chan *types.Response, 1000) // A channel to buffer responses

		// Read requests from conn and deal with them
		go s.handleRequests(closeConn, conn, responses)
		// Pull responses from 'responses' and write them to conn.
		go s.handleResponses(closeConn, conn, responses)

		// Wait until signal to close connection
		go s.waitForClose(closeConn, connID)
	}
}

And appd Server and terdermint remote client will be talking like this:

func (s *SocketServer) handleRequest(req *types.Request, responses chan<- *types.Response) {
	switch r := req.Value.(type) {
	case *types.Request_Echo:
		responses <- types.ToResponseEcho(r.Echo.Message)
	case *types.Request_Flush:
		responses <- types.ToResponseFlush()
	case *types.Request_Info:
		res := s.app.Info(*r.Info)
		responses <- types.ToResponseInfo(res)
	case *types.Request_SetOption:
		res := s.app.SetOption(*r.SetOption)
		responses <- types.ToResponseSetOption(res)
	case *types.Request_DeliverTx:
		res := s.app.DeliverTx(*r.DeliverTx)
		responses <- types.ToResponseDeliverTx(res)
	case *types.Request_CheckTx:
		res := s.app.CheckTx(*r.CheckTx)
		responses <- types.ToResponseCheckTx(res)
	case *types.Request_Commit:
		res := s.app.Commit()
		responses <- types.ToResponseCommit(res)
	case *types.Request_Query:
		res := s.app.Query(*r.Query)
		responses <- types.ToResponseQuery(res)
	case *types.Request_InitChain:
		res := s.app.InitChain(*r.InitChain)
		responses <- types.ToResponseInitChain(res)
	case *types.Request_BeginBlock:
		res := s.app.BeginBlock(*r.BeginBlock)
		responses <- types.ToResponseBeginBlock(res)
	case *types.Request_EndBlock:
		res := s.app.EndBlock(*r.EndBlock)
		responses <- types.ToResponseEndBlock(res)
	default:
		responses <- types.ToResponseException("Unknown request")
	}
}

This is actually the ABCI via socket.

Start as a in-process server

This is the default mode. It will create the tendermint node and then start it directly.

github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake at replay.go:244
github.com/tendermint/tendermint/node.doHandshake at node.go:281
github.com/tendermint/tendermint/node.NewNode at node.go:597
github.com/cosmos/cosmos-sdk/server.startInProcess at start.go:157
github.com/cosmos/cosmos-sdk/server.StartCmd.func1 at start.go:67
github.com/spf13/cobra.(*Command).execute at command.go:840
github.com/spf13/cobra.(*Command).ExecuteC at command.go:945
github.com/spf13/cobra.(*Command).Execute at command.go:885
github.com/tendermint/tendermint/libs/cli.Executor.Execute at setup.go:89
main.main at main.go:70
runtime.main at proc.go:203
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
runtime.rt0_go at asm_amd64.s:220

Full log of starting a in-process server:

GOROOT=C:\Go #gosetup
GOPATH=D:\work #gosetup
C:\Go\bin\go.exe build -o C:\Users\Administrator\AppData\Local\Temp\___go_build_github_com_xjw_ttt_cmd_appd.exe -gcflags "all=-N -l" github.com/xjw/ttt/cmd/appd #gosetup
"C:\Program Files\JetBrains\GoLand 2019.3\plugins\go\lib\dlv\windows\dlv.exe" --listen=localhost:57245 --headless=true --api-version=2 --check-go-version=false exec C:\Users\Administrator\AppData\Local\Temp\___go_build_github_com_xjw_ttt_cmd_appd.exe -- start --with-tendermint=1 --log_level debug #gosetup
API server listening at: 127.0.0.1:57245
I[2020-05-23|15:19:53.647] starting ABCI with Tendermint                module=main 
I[2020-05-23|15:19:54.306] Starting multiAppConn                        module=proxy impl=multiAppConn
I[2020-05-23|15:19:54.306] Starting localClient                         module=abci-client connection=query impl=localClient
I[2020-05-23|15:19:54.306] Starting localClient                         module=abci-client connection=mempool impl=localClient
I[2020-05-23|15:19:54.306] Starting localClient                         module=abci-client connection=consensus impl=localClient
I[2020-05-23|15:19:54.306] Starting EventBus                            module=events impl=EventBus
I[2020-05-23|15:19:54.306] Starting PubSub                              module=pubsub impl=PubSub
I[2020-05-23|15:19:54.457] Starting IndexerService                      module=txindex impl=IndexerService
I[2020-05-23|15:20:00.356] ABCI Handshake App Info                      module=consensus height=100 hash=721E295BC059DC63725EA768EBCF168D9BA50B88C8FD76394D216C7D1AA31CE1 software-version= protocol-version=0
I[2020-05-23|15:20:00.356] ABCI Replay Blocks                           module=consensus appHeight=100 storeHeight=104 stateHeight=104
I[2020-05-23|15:20:00.356] Applying block                               module=consensus height=101
I[2020-05-23|15:20:00.364] minted 2stake from mint module account       module=x/supply 
I[2020-05-23|15:20:00.371] Executed block                               module=consensus height=101 validTxs=0 invalidTxs=0
D[2020-05-23|15:20:00.374] Commit synced                                module=main commit=436F6D6D697449447B5B313134203139332032313320323530203335203136312039372032333620313930203820323020313436203920353620323434203836203138392032313220313120353120343620343620353620323235203737203232352031363820323030203134302031343420323434203235305D3A36357D
I[2020-05-23|15:20:00.374] Applying block                               module=consensus height=102
I[2020-05-23|15:20:00.375] minted 2stake from mint module account       module=x/supply 
I[2020-05-23|15:20:00.377] Executed block                               module=consensus height=102 validTxs=0 invalidTxs=0
D[2020-05-23|15:20:00.378] Commit synced                                module=main commit=436F6D6D697449447B5B3230312033342032323320313539203137352031303120323020323520313020323320333220323230203138322031343620313034203232203731203137352034332031393820393020313930203333203133352031383920373620313320323220313435203833203136203138315D3A36367D
I[2020-05-23|15:20:00.378] Applying block                               module=consensus height=103
I[2020-05-23|15:20:00.379] minted 2stake from mint module account       module=x/supply 
I[2020-05-23|15:20:00.380] Executed block                               module=consensus height=103 validTxs=0 invalidTxs=0
D[2020-05-23|15:20:00.381] Commit synced                                module=main commit=436F6D6D697449447B5B3231312032362037302031353620333620313133203133352038322032323720393020353820313933203133312031383720313831203735203138332031323920363620313834203132312032343820323039203938203137312031343820313233203232203820353920313535203230395D3A36377D
I[2020-05-23|15:20:00.381] Applying block                               module=consensus height=104
I[2020-05-23|15:20:00.383] minted 2stake from mint module account       module=x/supply 
I[2020-05-23|15:20:00.384] Executed block                               module=consensus height=104 validTxs=0 invalidTxs=0
D[2020-05-23|15:20:00.385] Commit synced                                module=main commit=436F6D6D697449447B5B3232332031333120323037203131392036372031303120323431203135302037342031333220323432203130382032343420323320313132203133332034342035372036362031353820323136203132302032343320323132203133322037203233382036392031393520323136203531203131305D3A36387D
I[2020-05-23|15:20:00.386] Completed ABCI Handshake - Tendermint and App are synced module=consensus appHeight=100 appHash=721E295BC059DC63725EA768EBCF168D9BA50B88C8FD76394D216C7D1AA31CE1
I[2020-05-23|15:20:00.386] Version info                                 module=node software=0.33.2 block=10 p2p=7
I[2020-05-23|15:20:00.386] This node is a validator                     module=consensus addr=0E6A1A0063CA0EC7C0B811FEAA8620FA13AFC60F pubKey=PubKeyEd25519{047024062243CA5C92A821C1DCE927295E84F6E55F0E5DC7551ED35F5E45A265}
I[2020-05-23|15:20:00.583] P2P Node ID                                  module=p2p ID=6ef2cd377c26dc14e5598fb3bdc3f255f0da0299 file=\.appd\config\node_key.json
I[2020-05-23|15:20:00.584] Adding persistent peers                      module=p2p addrs=[]
I[2020-05-23|15:20:00.584] Adding unconditional peer ids                module=p2p ids=[]
I[2020-05-23|15:20:00.585] Add our address to book                      module=p2p book=\.appd\config\addrbook.json addr=[email protected]:26656
I[2020-05-23|15:20:15.303] Starting Node                                module=node impl=Node
I[2020-05-23|15:20:15.306] Starting P2P Switch                          module=p2p impl="P2P Switch"
I[2020-05-23|15:20:15.306] Starting Reactor                             module=mempool impl=Reactor
I[2020-05-23|15:20:15.306] Starting BlockchainReactor                   module=blockchain impl=BlockchainReactor
I[2020-05-23|15:20:15.306] Starting Reactor                             module=consensus impl=ConsensusReactor
I[2020-05-23|15:20:15.306] Reactor                                      module=consensus fastSync=false
I[2020-05-23|15:20:15.306] Starting State                               module=consensus impl=ConsensusState
I[2020-05-23|15:20:15.306] Starting baseWAL                             module=consensus wal=\.appd\data\cs.wal\wal impl=baseWAL
I[2020-05-23|15:20:15.307] Starting Group                               module=consensus wal=\.appd\data\cs.wal\wal impl=Group
I[2020-05-23|15:20:15.307] Starting TimeoutTicker                       module=consensus impl=TimeoutTicker
I[2020-05-23|15:20:15.307] Searching for height                         module=consensus wal=\.appd\data\cs.wal\wal height=105 min=0 max=0
I[2020-05-23|15:20:15.315] Searching for height                         module=consensus wal=\.appd\data\cs.wal\wal height=104 min=0 max=0
I[2020-05-23|15:20:15.321] Starting RPC HTTP server on 127.0.0.1:26657  module=rpc-server 
I[2020-05-23|15:20:15.322] Found                                        module=consensus wal=\.appd\data\cs.wal\wal height=104 index=0
I[2020-05-23|15:20:15.325] Catchup by replaying consensus messages      module=consensus height=105
I[2020-05-23|15:20:15.325] Replay: New Step                             module=consensus height=105 round=0 step=RoundStepNewHeight
I[2020-05-23|15:20:15.325] Replay: Done                                 module=consensus 
I[2020-05-23|15:20:15.325] Starting Reactor                             module=evidence impl=Reactor
I[2020-05-23|15:20:15.325] Starting Reactor                             module=pex impl=Reactor
I[2020-05-23|15:20:15.325] Starting AddrBook                            module=p2p book=\.appd\config\addrbook.json impl=AddrBook
D[2020-05-23|15:20:15.326] Starting timeout routine                     module=consensus 
D[2020-05-23|15:20:15.326] Received tick                                module=consensus old_ti="{Duration:0s Height:0 Round:0 Step:RoundStepUnknown}" new_ti="{Duration:-9.745s Height:105 Round:0 Step:RoundStepNewHeight}"
D[2020-05-23|15:20:15.326] Timer already stopped                        module=consensus 
D[2020-05-23|15:20:15.326] Scheduled timeout                            module=consensus dur=-9.745s height=105 round=0 step=RoundStepNewHeight
I[2020-05-23|15:20:15.326] Saving AddrBook to file                      module=p2p book=\.appd\config\addrbook.json size=0
I[2020-05-23|15:20:15.327] Ensure peers                                 module=pex numOutPeers=0 numInPeers=0 numDialing=0 numToDial=10
I[2020-05-23|15:20:15.328] No addresses to dial. Falling back to seeds  module=pex 
I[2020-05-23|15:20:15.328] Timed out                                    module=consensus dur=-9.745s height=105 round=0 step=RoundStepNewHeight
D[2020-05-23|15:20:15.328] Received tock                                module=consensus timeout=-9.745s height=105 round=0 step=RoundStepNewHeight
I[2020-05-23|15:20:15.328] enterNewRound(105/0). Current: 105/0/RoundStepNewHeight module=consensus height=105 round=0
I[2020-05-23|15:20:15.329] enterPropose(105/0). Current: 105/0/RoundStepNewRound module=consensus height=105 round=0
D[2020-05-23|15:20:15.329] This node is a validator                     module=consensus height=105 round=0
I[2020-05-23|15:20:15.329] enterPropose: Our turn to propose            module=consensus height=105 round=0 proposer=0E6A1A0063CA0EC7C0B811FEAA8620FA13AFC60F privValidator="PrivValidator{0E6A1A0063CA0EC7C0B811FEAA8620FA13AFC60F LH:104, LR:0, LS:3}"
D[2020-05-23|15:20:15.329] Received tick                                module=consensus old_ti="{Duration:-9.745s Height:105 Round:0 Step:RoundStepNewHeight}" new_ti="{Duration:3s Height:105 Round:0 Step:RoundStepPropose}"
D[2020-05-23|15:20:15.329] Timer already stopped                        module=consensus 
D[2020-05-23|15:20:15.329] Scheduled timeout                            module=consensus dur=3s height=105 round=0 step=RoundStepPropose
I[2020-05-23|15:20:15.427] Signed proposal                              module=consensus height=105 round=0 proposal="Proposal{105/0 (95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F:1:21572962A91D, -1) EA0182DF200C @ 2020-05-23T07:20:15.4230086Z}"
D[2020-05-23|15:20:15.428] Signed proposal block: Block{
  Header{
    Version:        {10 0}
    ChainID:        test-chain-ayBsUa
    Height:         105
    Time:           2020-05-23 07:12:40.7930086 +0000 UTC
    LastBlockID:    4C2A28F9FC4739016F5E2F8E902799037A07F723A8E4B185A6DE213A97566054:1:4331F49A041C
    LastCommit:     23F2239162A66DBCF87FE300E0EFD5AE0606FCC188B0369281EDF8087248D58E
    Data:           
    Validators:     A41277944380A956CE3BCC1FF62187D01EB4CD5B948039EFAA1394DC4E2ECECA
    NextValidators: A41277944380A956CE3BCC1FF62187D01EB4CD5B948039EFAA1394DC4E2ECECA
    App:            DF83CF774365F1964A84F26CF41770852C39429ED878F3D48407EE45C3D8336E
    Consensus:      048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F
    Results:        
    Evidence:       
    Proposer:       0E6A1A0063CA0EC7C0B811FEAA8620FA13AFC60F
  }#95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F
  Data{
    
  }#
  EvidenceData{
    
  }#
  Commit{
    Height:     104
    Round:      0
    BlockID:    4C2A28F9FC4739016F5E2F8E902799037A07F723A8E4B185A6DE213A97566054:1:4331F49A041C
    Signatures:
      CommitSig{2D3496E1B653 by 0E6A1A0063CA on 2 @ 2020-05-23T07:12:40.7930086Z}
  }#23F2239162A66DBCF87FE300E0EFD5AE0606FCC188B0369281EDF8087248D58E
}#95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F module=consensus 
D[2020-05-23|15:20:15.428] Broadcast                                    module=p2p channel=32 msgBytes=C96A6FA8086918032009
I[2020-05-23|15:20:15.534] Received proposal                            module=consensus proposal="Proposal{105/0 (95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F:1:21572962A91D, -1) EA0182DF200C @ 2020-05-23T07:20:15.4230086Z}"
I[2020-05-23|15:20:15.590] Received complete proposal block             module=consensus height=105 hash=95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F
I[2020-05-23|15:20:15.590] enterPrevote(105/0). Current: 105/0/RoundStepPropose module=consensus 
I[2020-05-23|15:20:15.591] enterPrevote: ProposalBlock is valid         module=consensus height=105 round=0
I[2020-05-23|15:20:15.594] Signed and pushed vote                       module=consensus height=105 round=0 vote="Vote{0:0E6A1A0063CA 105/00/1(Prevote) 95CC6C61BBD1 7CBFB77DE4D7 @ 2020-05-23T07:20:15.5920086Z}" err=null
D[2020-05-23|15:20:15.594] Broadcast                                    module=p2p channel=32 msgBytes=C96A6FA808691804200A
D[2020-05-23|15:20:15.594] Attempt to update stats for non-existent peer module=consensus peer=
D[2020-05-23|15:20:15.703] addVote                                      module=consensus voteHeight=105 voteType=1 valIndex=0 csHeight=105
D[2020-05-23|15:20:15.705] Broadcast                                    module=p2p channel=32 msgBytes=1919B3D508691801
I[2020-05-23|15:20:15.705] Added to prevote                             module=consensus vote="Vote{0:0E6A1A0063CA 105/00/1(Prevote) 95CC6C61BBD1 7CBFB77DE4D7 @ 2020-05-23T07:20:15.5920086Z}" prevotes="VoteSet{H:105 R:0 T:1 +2/3:95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F:1:21572962A91D(1) BA{1:x} map[]}"
I[2020-05-23|15:20:15.705] Updating ValidBlock because of POL.          module=consensus validRound=-1 POLRound=0
D[2020-05-23|15:20:15.706] Broadcast                                    module=p2p channel=32 msgBytes=87E347CB08691A240801122021572962A91D425E757DBBBC90198F75DB23AF3A0474FA3563B7D6A12499810D22050801120101
I[2020-05-23|15:20:15.706] enterPrecommit(105/0). Current: 105/0/RoundStepPrevote module=consensus height=105 round=0
I[2020-05-23|15:20:15.706] enterPrecommit: +2/3 prevoted proposal block. Locking module=consensus height=105 round=0 hash=95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F
I[2020-05-23|15:20:15.712] Signed and pushed vote                       module=consensus height=105 round=0 vote="Vote{0:0E6A1A0063CA 105/00/2(Precommit) 95CC6C61BBD1 A2793749B9BE @ 2020-05-23T07:20:15.7080086Z}" err=null
D[2020-05-23|15:20:15.713] Broadcast                                    module=p2p channel=32 msgBytes=C96A6FA808691806200A
D[2020-05-23|15:20:15.713] Attempt to update stats for non-existent peer module=consensus peer=
D[2020-05-23|15:20:15.795] addVote                                      module=consensus voteHeight=105 voteType=2 valIndex=0 csHeight=105
D[2020-05-23|15:20:15.796] Broadcast                                    module=p2p channel=32 msgBytes=1919B3D508691802
I[2020-05-23|15:20:15.796] Added to precommit                           module=consensus vote="Vote{0:0E6A1A0063CA 105/00/2(Precommit) 95CC6C61BBD1 A2793749B9BE @ 2020-05-23T07:20:15.7080086Z}" precommits="VoteSet{H:105 R:0 T:2 +2/3:95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F:1:21572962A91D(1) BA{1:x} map[]}"
D[2020-05-23|15:20:15.796] enterNewRound(105/0): Invalid args. Current step: 105/0/RoundStepPrecommit module=consensus height=105 round=0
D[2020-05-23|15:20:15.796] enterPrecommit(105/0): Invalid args. Current step: 105/0/RoundStepPrecommit module=consensus height=105 round=0
I[2020-05-23|15:20:15.796] enterCommit(105/0). Current: 105/0/RoundStepPrecommit module=consensus height=105 commitRound=0
I[2020-05-23|15:20:15.796] Commit is for locked block. Set ProposalBlock=LockedBlock module=consensus height=105 commitRound=0 blockHash=95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F
D[2020-05-23|15:20:15.796] Broadcast                                    module=p2p channel=32 msgBytes=C96A6FA808691808200A
I[2020-05-23|15:20:15.797] Finalizing commit of block with N txs        module=consensus height=105 hash=95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F root=DF83CF774365F1964A84F26CF41770852C39429ED878F3D48407EE45C3D8336E N=0
I[2020-05-23|15:20:15.798] Block{
  Header{
    Version:        {10 0}
    ChainID:        test-chain-ayBsUa
    Height:         105
    Time:           2020-05-23 07:12:40.7930086 +0000 UTC
    LastBlockID:    4C2A28F9FC4739016F5E2F8E902799037A07F723A8E4B185A6DE213A97566054:1:4331F49A041C
    LastCommit:     23F2239162A66DBCF87FE300E0EFD5AE0606FCC188B0369281EDF8087248D58E
    Data:           
    Validators:     A41277944380A956CE3BCC1FF62187D01EB4CD5B948039EFAA1394DC4E2ECECA
    NextValidators: A41277944380A956CE3BCC1FF62187D01EB4CD5B948039EFAA1394DC4E2ECECA
    App:            DF83CF774365F1964A84F26CF41770852C39429ED878F3D48407EE45C3D8336E
    Consensus:      048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F
    Results:        
    Evidence:       
    Proposer:       0E6A1A0063CA0EC7C0B811FEAA8620FA13AFC60F
  }#95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F
  Data{
    
  }#
  EvidenceData{
    
  }#
  Commit{
    Height:     104
    Round:      0
    BlockID:    4C2A28F9FC4739016F5E2F8E902799037A07F723A8E4B185A6DE213A97566054:1:4331F49A041C
    Signatures:
      CommitSig{2D3496E1B653 by 0E6A1A0063CA on 2 @ 2020-05-23T07:12:40.7930086Z}
  }#23F2239162A66DBCF87FE300E0EFD5AE0606FCC188B0369281EDF8087248D58E
}#95CC6C61BBD1B776C8F8B87994D7C8EE85ECCE33C9B821A53DCF438BAA07772F module=consensus 
I[2020-05-23|15:20:16.023] minted 2stake from mint module account       module=x/supply 
I[2020-05-23|15:20:16.025] Executed block                               module=state height=105 validTxs=0 invalidTxs=0
D[2020-05-23|15:20:16.079] Commit synced                                module=main commit=436F6D6D697449447B5B323433203130332034322031313720363920313031203235342031373620313930203138362032203137392031333820313031203231352032353520323334203234352031333820323338203520363220392032342031323920383020313820332031383520333120313830203132355D3A36397D
I[2020-05-23|15:20:16.079] Committed state                              module=state height=105 txs=0 appHash=F3672A754565FEB0BEBA02B38A65D7FFEAF58AEE053E091881501203B91FB47D
I[2020-05-23|15:20:16.162] Indexed block                                module=txindex height=105
D[2020-05-23|15:20:16.162] Broadcast                                    module=p2p channel=32 msgBytes=C96A6FA8086A180120FCFFFFFFFFFFFFFFFF01
D[2020-05-23|15:20:16.162] Attempt to update stats for non-existent peer module=consensus peer=
D[2020-05-23|15:20:16.162] Received tick                                module=consensus old_ti="{Duration:3s Height:105 Round:0 Step:RoundStepPropose}" new_ti="{Duration:4.634s Height:106 Round:0 Step:RoundStepNewHeight}"
D[2020-05-23|15:20:16.162] Scheduled timeout                            module=consensus dur=4.634s height=106 round=0 step=RoundStepNewHeight

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章