modify chainID to mainnet=1

pull/1368/head
chao 5 years ago committed by Chao Ma
parent d1d3e23ee4
commit 7b9db27e99
  1. 2
      cmd/client/wallet/main.go
  2. 2
      core/blockchain.go
  3. 3
      internal/shardchain/shardchains.go
  4. 4
      node/node_genesis.go

@ -732,7 +732,7 @@ func processTransferCommand() {
fmt.Printf("Unlock account succeeded! '%v'\n", senderPass)
tx, err = ks.SignTx(account, tx, nil)
tx, err = ks.SignTx(account, tx, big.NewInt(1))
if err != nil {
fmt.Printf("SignTx Error: %v\n", err)
return

@ -407,7 +407,7 @@ func (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error {
// ShardID returns the shard Id of the blockchain.
func (bc *BlockChain) ShardID() uint32 {
return uint32(bc.chainConfig.ChainID.Int64())
return bc.CurrentBlock().ShardID()
}
// GasLimit returns the gas limit of the current HEAD block.

@ -105,7 +105,8 @@ func (sc *CollectionImpl) ShardChain(shardID uint32, networkType nodeconfig.Netw
chainConfig = *params.TestnetChainConfig
}
chainConfig.ChainID = big.NewInt(int64(shardID))
// TODO: use 1 as mainnet, change to networkID instead
chainConfig.ChainID = big.NewInt(1)
bc, err := core.NewBlockChain(
db, cacheConfig, &chainConfig, sc.engine, vm.Config{}, nil,

@ -93,8 +93,8 @@ func (node *Node) SetupGenesisBlock(db ethdb.Database, shardID uint32, myShardSt
}
// Initialize shard state
// TODO: add ShardIDs into chainconfig and change ChainID to NetworkID
chainConfig.ChainID = big.NewInt(int64(shardID)) // Use ChainID as piggybacked ShardIDs
// TODO: use 1 for now as mainnet, change to networkID instead
chainConfig.ChainID = big.NewInt(1)
gspec := core.Genesis{
Config: &chainConfig,

Loading…
Cancel
Save