|
|
@ -50,6 +50,8 @@ func main() { |
|
|
|
ethchain.InitFees() |
|
|
|
ethchain.InitFees() |
|
|
|
ethutil.ReadConfig() |
|
|
|
ethutil.ReadConfig() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.Printf("Starting Ethereum v%s\n", ethutil.Config.Ver) |
|
|
|
|
|
|
|
|
|
|
|
// Instantiated a eth stack
|
|
|
|
// Instantiated a eth stack
|
|
|
|
ethereum, err := eth.New() |
|
|
|
ethereum, err := eth.New() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -77,8 +79,6 @@ func main() { |
|
|
|
go console.Start() |
|
|
|
go console.Start() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.Println("Starting Ethereum") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RegisterInterupts(ethereum) |
|
|
|
RegisterInterupts(ethereum) |
|
|
|
|
|
|
|
|
|
|
|
ethereum.Start() |
|
|
|
ethereum.Start() |
|
|
@ -90,10 +90,11 @@ func main() { |
|
|
|
// Fake block mining. It broadcasts a new block every 5 seconds
|
|
|
|
// Fake block mining. It broadcasts a new block every 5 seconds
|
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
for { |
|
|
|
for { |
|
|
|
txs := ethereum.TxPool.Flush() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time.Sleep(blockTime * time.Second) |
|
|
|
time.Sleep(blockTime * time.Second) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
txs := ethereum.TxPool.Flush() |
|
|
|
|
|
|
|
|
|
|
|
block := ethchain.CreateBlock( |
|
|
|
block := ethchain.CreateBlock( |
|
|
|
ethereum.BlockManager.CurrentBlock.State().Root, |
|
|
|
ethereum.BlockManager.CurrentBlock.State().Root, |
|
|
|
ethereum.BlockManager.LastBlockHash, |
|
|
|
ethereum.BlockManager.LastBlockHash, |
|
|
|