Skip to content

Commit

Permalink
removing probabilty and setting up new chainId and port
Browse files Browse the repository at this point in the history
  • Loading branch information
bret-fusion committed Jan 30, 2019
1 parent 3afd739 commit ccc3142
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

func main() {
var (
listenAddr = flag.String("addr", ":40401", "listen address")
listenAddr = flag.String("addr", ":40406", "listen address")
genKey = flag.String("genkey", "", "generate a node key")
writeAddr = flag.Bool("writeaddress", false, "write out the node's pubkey hash and quit")
nodeKeyFile = flag.String("nodekey", "", "private key filename")
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ var (
ListenPortFlag = cli.IntFlag{
Name: "port",
Usage: "Network listening port",
Value: 40403,
Value: 40409,
}
BootnodesFlag = cli.StringFlag{
Name: "bootnodes",
Expand Down
7 changes: 0 additions & 7 deletions consensus/datong/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,6 @@ func (dt *DaTong) selectTickets(tickets []*common.Ticket, parent *types.Header,

func (dt *DaTong) getProbability(distance *big.Int) *big.Int {
d := distance.Uint64()
if d > dt.config.Period {
d = d - dt.config.Period + 1
max := maxProb.Uint64()
temp := uint64(math.Pow(2, float64(d)))
value := max - max/temp
return new(big.Int).SetUint64(value)
}
return new(big.Int).SetUint64(uint64(math.Pow(2, float64(d))))
}

Expand Down
4 changes: 3 additions & 1 deletion core/genesis_alloc.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/vm/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Config struct {
func setDefaults(cfg *Config) {
if cfg.ChainConfig == nil {
cfg.ChainConfig = &params.ChainConfig{
ChainID: big.NewInt(99551),
ChainID: big.NewInt(99661),
HomesteadBlock: new(big.Int),
DAOForkBlock: new(big.Int),
DAOForkSupport: false,
Expand Down
18 changes: 9 additions & 9 deletions genesis.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"config": {
"chainId": 99551,
"chainId": 99661,
"homesteadBlock": 0,
"daoForkBlock": 0,
"daoForkSupport": false,
Expand Down Expand Up @@ -32,14 +32,14 @@

"0x9c48c796cb0bed51a14291bc8cc56dab5aed7b5c" : { "balance" : "0x00000000000000000000000000000000000000000000003635c9adc5dea00000" },

"0xd2452651834e8f0c19c9d85e0bf09fe99283dabc" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0x7da669ea4234473e224a8f5a5f6257729e6f03cd" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0x8e448859d7502b1ecf0c8d18008feeff89a30c60" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0x722c6716dad0d7f8c1adbfd3360edbe99813f3aa" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0x0e93335afe434a73e005cab8bd1b2dc153b73549" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0xe3db01c89dcdd68b80e7dfdf931b00a6335d72dd" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0xc4a9441afb052cb454240136cce71fb09316ea94" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0xfa37b7c3f21060458361ed5322be5af3740bce3c" : { "balance" : "0x00000000000000000000000000000000000000000000021e19e0c9bab2400000" },
"0xd2452651834e8f0c19c9d85e0bf09fe99283dabc" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0x7da669ea4234473e224a8f5a5f6257729e6f03cd" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0x8e448859d7502b1ecf0c8d18008feeff89a30c60" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0x722c6716dad0d7f8c1adbfd3360edbe99813f3aa" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0x0e93335afe434a73e005cab8bd1b2dc153b73549" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0xe3db01c89dcdd68b80e7dfdf931b00a6335d72dd" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0xc4a9441afb052cb454240136cce71fb09316ea94" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },
"0xfa37b7c3f21060458361ed5322be5af3740bce3c" : { "balance" : "0x00000000000000000000000000000000000000000000121e19e0c9bab2400000" },


"0x1bdf56c9593590122fd8750555d8148da2b80be8" : { "balance" : "0x00000000000000000000000000000000000000000000002d12b15ad7a65c1704" },
Expand Down
2 changes: 1 addition & 1 deletion node/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var DefaultConfig = Config{
WSPort: DefaultWSPort,
WSModules: []string{"net", "web3"},
P2P: p2p.Config{
ListenAddr: ":40403",
ListenAddr: ":40409",
MaxPeers: 25,
NAT: nat.Any(),
},
Expand Down
2 changes: 1 addition & 1 deletion p2p/discover/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const (

// RPC packet types
const (
pingPacket = iota + 10 // zero is 'reserved'
pingPacket = iota + 30 // zero is 'reserved'
pongPacket
findnodePacket
neighborsPacket
Expand Down
2 changes: 1 addition & 1 deletion params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
var (
// MainnetChainConfig is the chain parameters to run a node on the main network.
MainnetChainConfig = &ChainConfig{
ChainID: big.NewInt(99551),
ChainID: big.NewInt(99661),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: big.NewInt(0),
DAOForkSupport: false,
Expand Down

0 comments on commit ccc3142

Please sign in to comment.