github.com/yinchengtsinghua/golang-Eos-dpos-Ethereum@v0.0.0-20190121132951-92cc4225ed8e/whisper/whisperv6/doc.go (about) 1 2 //此源码被清华学神尹成大魔王专业翻译分析并修改 3 //尹成QQ77025077 4 //尹成微信18510341407 5 //尹成所在QQ群721929980 6 //尹成邮箱 yinc13@mails.tsinghua.edu.cn 7 //尹成毕业于清华大学,微软区块链领域全球最有价值专家 8 //https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 9 // 10 // 11 // 12 // 13 // 14 // 15 // 16 // 17 // 18 // 19 // 20 // 21 // 22 // 23 // 24 25 /* 26 27 28 29 30 31 32 33 34 35 36 37 */ 38 39 40 // 41 42 package whisperv6 43 44 import ( 45 "time" 46 ) 47 48 // 49 const ( 50 ProtocolVersion = uint64(6) // 51 ProtocolVersionStr = "6.0" // 52 ProtocolName = "shh" // 53 54 // 55 statusCode = 0 // 56 messagesCode = 1 // 57 powRequirementCode = 2 // 58 bloomFilterExCode = 3 // 59 p2pRequestCode = 126 // 60 p2pMessageCode = 127 // 61 NumberOfMessageCodes = 128 62 63 SizeMask = byte(3) // 64 signatureFlag = byte(4) 65 66 TopicLength = 4 // 67 signatureLength = 65 // 68 aesKeyLength = 32 // 69 aesNonceLength = 12 // 70 keyIDSize = 32 // 71 BloomFilterSize = 64 // 72 flagsLength = 1 73 74 EnvelopeHeaderLength = 20 75 76 MaxMessageSize = uint32(10 * 1024 * 1024) // 77 DefaultMaxMessageSize = uint32(1024 * 1024) 78 DefaultMinimumPoW = 0.2 79 80 padSizeLimit = 256 // 81 messageQueueLimit = 1024 82 83 expirationCycle = time.Second 84 transmissionCycle = 300 * time.Millisecond 85 86 DefaultTTL = 50 // 87 DefaultSyncAllowance = 10 // 88 ) 89 90 // 91 // 92 // 93 // 94 // 95 // 96 type MailServer interface { 97 Archive(env *Envelope) 98 DeliverMail(whisperPeer *Peer, request *Envelope) 99 }