aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-10-05 19:01:34 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-09 04:01:39 +0800
commit1de796f10134bb4aa245591e0d8802e320892efb (patch)
treedff14c87d5c29b779ab1e4543acd66489ea55bb2 /eth
parent44fd3951410fb5923d7e578ac97942a7ea791e96 (diff)
downloadgo-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar.gz
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar.bz2
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar.lz
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar.xz
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.tar.zst
go-tangerine-1de796f10134bb4aa245591e0d8802e320892efb.zip
cmd, core, eth: added official testnet
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index a480b4931..83eefca5b 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -34,6 +34,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
@@ -69,12 +70,17 @@ var (
discover.MustParseNode("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303"),
}
+ defaultTestNetBootNodes = []*discover.Node{
+ discover.MustParseNode("enode://5374c1bff8df923d3706357eeb4983cd29a63be40a269aaa2296ee5f3b2119a8978c0ed68b8f6fc84aad0df18790417daadf91a4bfbb786a16c9b0a199fa254a@92.51.165.126:30303"),
+ }
+
staticNodes = "static-nodes.json" // Path within <datadir> to search for the static node list
trustedNodes = "trusted-nodes.json" // Path within <datadir> to search for the trusted node list
)
type Config struct {
DevMode bool
+ TestNet bool
Name string
NetworkId int
@@ -133,6 +139,10 @@ type Config struct {
func (cfg *Config) parseBootNodes() []*discover.Node {
if cfg.BootNodes == "" {
+ if cfg.TestNet {
+ return defaultTestNetBootNodes
+ }
+
return defaultBootNodes
}
var ns []*discover.Node
@@ -309,7 +319,13 @@ func New(config *Config) (*Ethereum, error) {
glog.V(logger.Error).Infoln("Starting Olympic network")
fallthrough
case config.DevMode:
- _, err := core.WriteTestNetGenesisBlock(chainDb, 42)
+ _, err := core.WriteOlympicGenesisBlock(chainDb, 42)
+ if err != nil {
+ return nil, err
+ }
+ case config.TestNet:
+ state.StartingNonce = 1048576 // (2**20)
+ _, err := core.WriteTestNetGenesisBlock(chainDb, 0x6d6f7264656e)
if err != nil {
return nil, err
}