github.com/noirx94/tendermintmp@v0.0.1/test/maverick/README.md (about)

     1  # Maverick
     2  
     3  ![](https://assets.rollingstone.com/assets/2015/article/tom-cruise-to-fight-drones-in-top-gun-sequel-20150629/201166/large_rect/1435581755/1401x788-Top-Gun-3.jpg)
     4  
     5  A byzantine node used to test Tendermint consensus against a plethora of different faulty misbehaviors. Designed to easily create new faulty misbehaviors to examine how a Tendermint network reacts to the misbehavior. Can also be used for fuzzy testing with different network arrangements.
     6  
     7  ## Misbehaviors
     8  
     9  A misbehavior allows control at the following stages as highlighted by the struct below
    10  
    11  ```go
    12  type Misbehavior struct {
    13  	String string
    14  
    15  	EnterPropose func(cs *State, height int64, round int32)
    16  
    17  	EnterPrevote func(cs *State, height int64, round int32)
    18  
    19  	EnterPrecommit func(cs *State, height int64, round int32)
    20  
    21  	ReceivePrevote func(cs *State, prevote *types.Vote)
    22  
    23  	ReceivePrecommit func(cs *State, precommit *types.Vote)
    24  
    25  	ReceiveProposal func(cs *State, proposal *types.Proposal) error
    26  }
    27  ```
    28  
    29  At each of these events, the node can exhibit a different misbehavior. To create a new misbehavior define a function that builds off the existing default misbehavior and then overrides one or more of these functions. Then append it to the misbehaviors list so the node recognizes it like so:
    30  
    31  ```go
    32  var MisbehaviorList = map[string]Misbehavior{
    33  	"double-prevote": DoublePrevoteMisbehavior(),
    34  }
    35  ```
    36  
    37  ## Setup
    38  
    39  The maverick node takes most of the functionality from the existing Tendermint CLI. To install this, in the directory of this readme, run:
    40  
    41  ```bash
    42  go build
    43  ```
    44  
    45  Use `maverick init` to initialize a single node and `maverick node` to run it. This will run it normally unless you use the misbehaviors flag as follows:
    46  
    47  ```bash
    48  maverick node --proxy_app persistent_kvstore --misbehaviors double-vote,10
    49  ```
    50  
    51  This would cause the node to vote twice in every round at height 10. To add more misbehaviors at different heights, append the next misbehavior and height after the first (with comma separation).