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.

34 lines
918 B

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