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.

42 lines
1.1 KiB

  1. package p2p_test
  2. import (
  3. "context"
  4. "github.com/tendermint/tendermint/crypto"
  5. "github.com/tendermint/tendermint/crypto/ed25519"
  6. "github.com/tendermint/tendermint/internal/p2p"
  7. "github.com/tendermint/tendermint/types"
  8. )
  9. // Common setup for P2P tests.
  10. var (
  11. ctx = context.Background()
  12. chID = p2p.ChannelID(1)
  13. chDesc = p2p.ChannelDescriptor{
  14. ID: byte(chID),
  15. Priority: 5,
  16. SendQueueCapacity: 10,
  17. RecvMessageCapacity: 10,
  18. MaxSendBytes: 1000,
  19. }
  20. selfKey crypto.PrivKey = ed25519.GenPrivKeyFromSecret([]byte{0xf9, 0x1b, 0x08, 0xaa, 0x38, 0xee, 0x34, 0xdd})
  21. selfID = types.NodeIDFromPubKey(selfKey.PubKey())
  22. selfInfo = types.NodeInfo{
  23. NodeID: selfID,
  24. ListenAddr: "0.0.0.0:0",
  25. Network: "test",
  26. Moniker: string(selfID),
  27. }
  28. peerKey crypto.PrivKey = ed25519.GenPrivKeyFromSecret([]byte{0x84, 0xd7, 0x01, 0xbf, 0x83, 0x20, 0x1c, 0xfe})
  29. peerID = types.NodeIDFromPubKey(peerKey.PubKey())
  30. peerInfo = types.NodeInfo{
  31. NodeID: peerID,
  32. ListenAddr: "0.0.0.0:0",
  33. Network: "test",
  34. Moniker: string(peerID),
  35. }
  36. )