github.com/sberex/go-sberex@v1.8.2-0.20181113200658-ed96ac38f7d7/mobile/params.go (about) 1 // This file is part of the go-sberex library. The go-sberex library is 2 // free software: you can redistribute it and/or modify it under the terms 3 // of the GNU Lesser General Public License as published by the Free 4 // Software Foundation, either version 3 of the License, or (at your option) 5 // any later version. 6 // 7 // The go-sberex library is distributed in the hope that it will be useful, 8 // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 10 // General Public License <http://www.gnu.org/licenses/> for more details. 11 12 // Contains all the wrappers from the params package. 13 14 package geth 15 16 import ( 17 "encoding/json" 18 19 "github.com/Sberex/go-sberex/core" 20 "github.com/Sberex/go-sberex/p2p/discv5" 21 "github.com/Sberex/go-sberex/params" 22 ) 23 24 // MainnetGenesis returns the JSON spec to use for the main Sberex network. It 25 // is actually empty since that defaults to the hard coded binary genesis block. 26 func MainnetGenesis() string { 27 return "" 28 } 29 30 // TestnetGenesis returns the JSON spec to use for the Sberex test network. 31 func TestnetGenesis() string { 32 enc, err := json.Marshal(core.DefaultTestnetGenesisBlock()) 33 if err != nil { 34 panic(err) 35 } 36 return string(enc) 37 } 38 39 // RinkebyGenesis returns the JSON spec to use for the Rinkeby test network 40 func RinkebyGenesis() string { 41 enc, err := json.Marshal(core.DefaultRinkebyGenesisBlock()) 42 if err != nil { 43 panic(err) 44 } 45 return string(enc) 46 } 47 48 // FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated 49 // by the foundation running the V5 discovery protocol. 50 func FoundationBootnodes() *Enodes { 51 nodes := &Enodes{nodes: make([]*discv5.Node, len(params.DiscoveryV5Bootnodes))} 52 for i, url := range params.DiscoveryV5Bootnodes { 53 nodes.nodes[i] = discv5.MustParseNode(url) 54 } 55 return nodes 56 }