aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/cmd.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-08-03 23:48:24 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-08-04 00:15:48 +0800
commitdcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d (patch)
tree6c3e0c5b59ce2ec6515b4ce96d84421b9b635d94 /cmd/utils/cmd.go
parente7f4232b10034d291d1757b96e6277908618223c (diff)
downloadgo-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.gz
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.bz2
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.lz
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.xz
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.zst
go-tangerine-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.zip
cmd, core, eth: support for the olympic network
Added a --olympic flag which initialiser the olympic protocol settings
Diffstat (limited to 'cmd/utils/cmd.go')
-rw-r--r--cmd/utils/cmd.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index d9c4b6da5..f8f7f6376 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -21,6 +21,7 @@ import (
"bufio"
"fmt"
"io"
+ "math/big"
"os"
"os/signal"
"regexp"
@@ -32,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
+ "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
"github.com/peterh/liner"
)
@@ -143,6 +145,15 @@ func StartEthereum(ethereum *eth.Ethereum) {
}()
}
+func InitOlympic() {
+ params.DurationLimit = big.NewInt(8)
+ params.GenesisGasLimit = big.NewInt(3141592)
+ params.MinGasLimit = big.NewInt(125000)
+ params.MaximumExtraDataSize = big.NewInt(1024)
+ NetworkIdFlag.Value = 0
+ core.BlockReward = big.NewInt(1.5e+18)
+}
+
func FormatTransactionData(data string) []byte {
d := common.StringToByteFunc(data, func(s string) (ret []byte) {
slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000)
@@ -203,6 +214,11 @@ func ImportChain(chain *core.ChainManager, fn string) error {
} else if err != nil {
return fmt.Errorf("at block %d: %v", n, err)
}
+ // don't import first block
+ if b.NumberU64() == 0 {
+ i--
+ continue
+ }
blocks[i] = &b
n++
}
@@ -218,6 +234,7 @@ func ImportChain(chain *core.ChainManager, fn string) error {
batch, blocks[0].Hash().Bytes()[:4], blocks[i-1].Hash().Bytes()[:4])
continue
}
+
if _, err := chain.InsertChain(blocks[:i]); err != nil {
return fmt.Errorf("invalid block %d: %v", n, err)
}