You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.7 KiB

  1. # Generating test data
  2. TODO: automate this process.
  3. The easiest way to generate this data is to copy `~/.tendermint_test/somedir/*` to `~/.tendermint`
  4. and to run a local node. Note the tests expect a wal for block 1.
  5. For `empty_block.cswal`, run the node and don't send any transactions.
  6. For `small_block1.cswal` and `small_block2.cswal`,
  7. use the `scripts/txs/random.sh 1000 36657` to start sending transactions before starting the node.
  8. `small_block1.cswal` uses the default large block part size, so the block should have one big part.
  9. For `small_block2.cswal`, set `block_part_size = 512` in the config.toml.
  10. Make sure to adjust the stepChanges in the testCases if the number of messages changes
  11. If you need to change the signatures, you can use a script as follows:
  12. The privBytes comes from `config/tendermint_test/...`:
  13. ```
  14. package main
  15. import (
  16. "encoding/hex"
  17. "fmt"
  18. "github.com/tendermint/go-crypto"
  19. )
  20. func main() {
  21. signBytes, err := hex.DecodeString("7B22636861696E5F6964223A2274656E6465726D696E745F74657374222C22766F7465223A7B22626C6F636B5F68617368223A2242453544373939433846353044354645383533364334333932464443384537423342313830373638222C22626C6F636B5F70617274735F686561646572223A506172745365747B543A31204236323237323535464632307D2C22686569676874223A312C22726F756E64223A302C2274797065223A327D7D")
  22. if err != nil {
  23. panic(err)
  24. }
  25. privBytes, err := hex.DecodeString("27F82582AEFAE7AB151CFB01C48BB6C1A0DA78F9BDDA979A9F70A84D074EB07D3B3069C422E19688B45CBFAE7BB009FC0FA1B1EA86593519318B7214853803C8")
  26. if err != nil {
  27. panic(err)
  28. }
  29. privKey := crypto.PrivKeyEd25519{}
  30. copy(privKey[:], privBytes)
  31. signature := privKey.Sign(signBytes)
  32. signatureEd25519 := signature.(crypto.SignatureEd25519)
  33. fmt.Printf("Signature Bytes: %X\n", signatureEd25519[:])
  34. }
  35. ```