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.

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