Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #27

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
UNAME = $(shell uname)

# Default is building
all:
go install

install:
# Linux build
ifeq ($(UNAME),Linux)
mkdir /usr/local/ethereal
files=(wallet.qml net.png network.png new.png tx.png)
for file in "${files[@]}"; do
cp $file /usr/share/ethereal
done
cp $GOPATH/bin/go-ethereum /usr/local/bin/ethereal
endif
# OS X build
ifeq ($(UNAME),Darwin)
# Execute py script
endif
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Ethereum

Ethereum Go Client (c) Jeffrey Wilcke

The current state is "Proof of Concept 3". For build instructions see
the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Edge).
The current state is "Proof of Concept 3".

For the development Go Package please see [eth-go package](https://github.com/ethereum/eth-go).

Expand Down
8 changes: 4 additions & 4 deletions dev_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ func (i *Console) ParseInput(input string) bool {
fmt.Println(value)
case "getaddr":
encoded, _ := hex.DecodeString(tokens[1])
addr := i.ethereum.BlockManager.BlockChain().CurrentBlock.GetAddr(encoded)
addr := i.ethereum.BlockChain().CurrentBlock.State().GetAccount(encoded)
fmt.Println("addr:", addr)
case "block":
encoded, _ := hex.DecodeString(tokens[1])
block := i.ethereum.BlockManager.BlockChain().GetBlock(encoded)
block := i.ethereum.BlockChain().GetBlock(encoded)
info := block.BlockInfo()
fmt.Printf("++++++++++ #%d ++++++++++\n%v\n", info.Number, block)
case "say":
Expand All @@ -182,7 +182,7 @@ func (i *Console) ParseInput(input string) bool {

key := ethutil.Config.Db.GetKeys()[0]
tx.Sign(key.PrivateKey)
i.ethereum.TxPool.QueueTransaction(tx)
i.ethereum.TxPool().QueueTransaction(tx)

fmt.Printf("%x\n", tx.Hash())
}
Expand All @@ -204,7 +204,7 @@ func (i *Console) ParseInput(input string) bool {
key := ethutil.Config.Db.GetKeys()[0]
contract.Sign(key.PrivateKey)

i.ethereum.TxPool.QueueTransaction(contract)
i.ethereum.TxPool().QueueTransaction(contract)

fmt.Printf("%x\n", contract.Hash()[12:])
case "exit", "quit", "q":
Expand Down
16 changes: 9 additions & 7 deletions ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func main() {
}

if ShowGenesis {
fmt.Println(ethereum.BlockManager.BlockChain().Genesis())
fmt.Println(ethereum.BlockChain().Genesis())
os.Exit(0)
}

Expand Down Expand Up @@ -183,22 +183,24 @@ func main() {
addr := keyRing.Get(1).Bytes()

for {
txs := ethereum.TxPool.Flush()
txs := ethereum.TxPool().Flush()
// Create a new block which we're going to mine
block := ethereum.BlockManager.BlockChain().NewBlock(addr, txs)
block := ethereum.BlockChain().NewBlock(addr, txs)
log.Println("Mining on new block. Includes", len(block.Transactions()), "transactions")
// Apply all transactions to the block
ethereum.BlockManager.ApplyTransactions(block, block.Transactions())
ethereum.StateManager().ApplyTransactions(block, block.Transactions())

ethereum.BlockManager.AccumelateRewards(block, block)
ethereum.StateManager().AccumelateRewards(block, block)

// Search the nonce
block.Nonce = pow.Search(block)
ethereum.Broadcast(ethwire.MsgBlockTy, []interface{}{block.Value().Val})
err := ethereum.BlockManager.ProcessBlock(block)
err := ethereum.StateManager().ProcessBlock(block)
if err != nil {
log.Println(err)
} else {
log.Println("\n+++++++ MINED BLK +++++++\n", ethereum.BlockManager.BlockChain().CurrentBlock)
//log.Println("\n+++++++ MINED BLK +++++++\n", ethereum.BlockChain().CurrentBlock)
log.Printf("🔨 Mined block %x\n", block.Hash())
}
}
}()
Expand Down
Binary file removed net.pxm
Binary file not shown.
File renamed without changes.
File renamed without changes.
Loading