Documentation ¶
Index ¶
- Variables
- func CheckValidForkDigest(input_string string) (string, bool)
- func Eth2TopicPretty(eth2topic string) string
- func GenerateEth2Topics(forkDigest string, messageTypeName string) string
- func ReturnAllTopics(inputForkDigest string) []string
- func ReturnTopics(forkDigest string, messageTypeName []string) []string
Constants ¶
This section is empty.
Variables ¶
var ( // new ForkDigestPrefix string = "0x" ForkDigestSize int = 8 // without the ForkDigestPrefix BlockchainName string = "eth2" MainnetKey string = "Mainnet" AltairKey string = "Altair" ForkDigests = map[string]string{ MainnetKey: "b5303f2a", AltairKey: "afcaaba0", } DefaultForkDigest string = ForkDigests[AltairKey] MessageTypes = []string{ "beacon_block", "beacon_aggregate_and_proof", "voluntary_exit", "proposer_slashing", "attester_slashing", } Encoding string = "ssz_snappy" )
Functions ¶
func CheckValidForkDigest ¶
CheckValidForkDigest: This method will check if Fork Digest exists in the corresponding map (ForkDigests). @return the fork digest of the given network. @return a boolean (true for valid, false for not valid).
func Eth2TopicPretty ¶
Eth2TopicPretty: This method returns the topic based on it's message type in a pretty version of it. It would return "beacon_block" out of the given "/eth2/b5303f2a/beacon_block/ssz_snappy" topic @param eth2topic:the entire composed eth2 topic with fork digest and compression. @return topic pretty.
func GenerateEth2Topics ¶
GenerateEth2Topics: This method returns the built topic out of the given arguments. You may check the commented examples above. @param forkDigest: the forDigest key in the map. You may use the Key constants. @param topic: the message type we want to use in the topic. You may use the Key constants.
func ReturnAllTopics ¶
ReturnAllTopics: This method will iterate over the mesagetype map and return any possible topic for the given fork digest. @return the array of topics.
func ReturnTopics ¶
ReturnTopics: Returns topics for the given parameters. @param forkDigest: the forkDigest to use in the topic. @param messageTypeName: the type of topic. @return the list of generated topics with the given parameters (several messageTypes).
Types ¶
This section is empty.