Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
98335d20
Commit
98335d20
authored
Jun 16, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.5.13'
parents
aa8a86f0
c1220e87
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
141 additions
and
35 deletions
+141
-35
README.md
README.md
+1
-1
debugger.qml
ethereal/assets/debugger/debugger.qml
+3
-3
wallet.qml
ethereal/assets/qml/wallet.qml
+94
-18
webapp.qml
ethereal/assets/qml/webapp.qml
+25
-1
config.go
ethereal/config.go
+4
-0
ethereum.go
ethereal/ethereum.go
+2
-5
gui.go
ethereal/ui/gui.go
+6
-2
config.go
ethereum/config.go
+4
-0
ethereum.go
ethereum/ethereum.go
+2
-5
No files found.
README.md
View file @
98335d20
...
@@ -5,7 +5,7 @@ Ethereum
...
@@ -5,7 +5,7 @@ Ethereum
Ethereum Go Client © 2014 Jeffrey Wilcke.
Ethereum Go Client © 2014 Jeffrey Wilcke.
Current state: Proof of Concept 5.0 RC1
2
.
Current state: Proof of Concept 5.0 RC1
3
.
For the development package please see the
[
eth-go package
](
https://github.com/ethereum/eth-go
)
.
For the development package please see the
[
eth-go package
](
https://github.com/ethereum/eth-go
)
.
...
...
ethereal/assets/debugger/debugger.qml
View file @
98335d20
...
@@ -135,7 +135,7 @@ ApplicationWindow {
...
@@ -135,7 +135,7 @@ ApplicationWindow {
}
}
height
:
parent
.
height
height
:
parent
.
height
width
:
300
width
:
300
TableViewColumn
{
role
:
"value"
;
title
:
"
Stack
"
;
width
:
200
}
TableViewColumn
{
role
:
"value"
;
title
:
"
Temp
"
;
width
:
200
}
model
:
stackModel
model
:
stackModel
}
}
...
@@ -224,8 +224,8 @@ ApplicationWindow {
...
@@ -224,8 +224,8 @@ ApplicationWindow {
}
}
function
setInstruction
(
num
)
{
function
setInstruction
(
num
)
{
//
asmTableView.selection.clear()
asmTableView
.
selection
.
clear
()
//
asmTableView.selection.select(num)
asmTableView
.
selection
.
select
(
num
)
}
}
function
setMem
(
mem
)
{
function
setMem
(
mem
)
{
...
...
ethereal/assets/qml/wallet.qml
View file @
98335d20
...
@@ -29,6 +29,7 @@ ApplicationWindow {
...
@@ -29,6 +29,7 @@ ApplicationWindow {
}
}
Menu
{
Menu
{
title
:
"Developer"
MenuItem
{
MenuItem
{
text
:
"Debugger"
text
:
"Debugger"
shortcut
:
"Ctrl+d"
shortcut
:
"Ctrl+d"
...
@@ -261,7 +262,7 @@ ApplicationWindow {
...
@@ -261,7 +262,7 @@ ApplicationWindow {
id
:
addressView
id
:
addressView
width
:
parent
.
width
-
200
width
:
parent
.
width
-
200
height
:
200
height
:
200
anchors.bottom
:
log
View
.
top
anchors.bottom
:
log
Layout
.
top
TableViewColumn
{
role
:
"name"
;
title
:
"name"
}
TableViewColumn
{
role
:
"name"
;
title
:
"name"
}
TableViewColumn
{
role
:
"address"
;
title
:
"address"
;
width
:
300
}
TableViewColumn
{
role
:
"address"
;
title
:
"address"
;
width
:
300
}
...
@@ -296,15 +297,49 @@ ApplicationWindow {
...
@@ -296,15 +297,49 @@ ApplicationWindow {
property
var
logModel
:
ListModel
{
property
var
logModel
:
ListModel
{
id
:
logModel
id
:
logModel
}
}
TableView
{
RowLayout
{
id
:
log
View
id
:
log
Layout
width
:
parent
.
width
width
:
parent
.
width
height
:
200
height
:
200
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
TableView
{
id
:
logView
headerVisible
:
false
anchors
{
right
:
logLevelSlider
.
left
left
:
parent
.
left
bottom
:
parent
.
bottom
top
:
parent
.
top
}
TableViewColumn
{
role
:
"description"
;
title
:
"log"
}
TableViewColumn
{
role
:
"description"
;
title
:
"log"
}
model
:
logModel
model
:
logModel
}
}
Slider
{
id
:
logLevelSlider
value
:
1
anchors
{
right
:
parent
.
right
top
:
parent
.
top
bottom
:
parent
.
bottom
rightMargin
:
5
leftMargin
:
5
topMargin
:
5
bottomMargin
:
5
}
orientation
:
Qt
.
Vertical
maximumValue
:
3
stepSize
:
1
onValueChanged
:
{
eth
.
setLogLevel
(
value
)
}
}
}
}
}
/*
/*
...
@@ -419,6 +454,7 @@ ApplicationWindow {
...
@@ -419,6 +454,7 @@ ApplicationWindow {
Text
{
text
:
'<b>Hash:</b> '
+
hash
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Hash:</b> '
+
hash
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Coinbase:</b> '
+
coinbase
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Coinbase:</b> '
+
coinbase
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Block found at:</b> '
+
prettyTime
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Block found at:</b> '
+
prettyTime
;
color
:
"#F2F2F2"
}
Text
{
text
:
'<b>Gas used:</b> '
+
gasUsed
+
" / "
+
gasLimit
;
color
:
"#F2F2F2"
}
}
}
}
}
}
}
...
@@ -642,16 +678,27 @@ ApplicationWindow {
...
@@ -642,16 +678,27 @@ ApplicationWindow {
}
}
if
(
initial
){
if
(
initial
){
blockModel
.
append
({
number
:
block
.
number
,
coinbase
:
block
.
coinbase
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
blockModel
.
append
({
number
:
block
.
number
,
gasLimit
:
block
.
gasLimit
,
gasUsed
:
block
.
gasUsed
,
coinbase
:
block
.
coinbase
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
}
else
{
}
else
{
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
coinbase
:
block
.
coinbase
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
gasLimit
:
block
.
gasLimit
,
gasUsed
:
block
.
gasUsed
,
coinbase
:
block
.
coinbase
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
}
}
}
}
function
addLog
(
str
)
{
function
addLog
(
str
)
{
// Remove first item once we've reached max log items
if
(
logModel
.
count
>
250
)
{
logModel
.
remove
(
0
)
}
if
(
str
.
len
!=
0
)
{
if
(
str
.
len
!=
0
)
{
logModel
.
insert
(
0
,
{
description
:
str
})
if
(
logView
.
flickableItem
.
atYEnd
)
{
logModel
.
append
({
description
:
str
})
logView
.
positionViewAtRow
(
logView
.
rowCount
-
1
,
ListView
.
Contain
)
}
else
{
logModel
.
append
({
description
:
str
})
}
}
}
}
}
function
setPeers
(
text
)
{
function
setPeers
(
text
)
{
...
@@ -767,6 +814,20 @@ ApplicationWindow {
...
@@ -767,6 +814,20 @@ ApplicationWindow {
anchors.leftMargin
:
5
anchors.leftMargin
:
5
anchors.topMargin
:
5
anchors.topMargin
:
5
ListModel
{
id
:
denomModel
ListElement
{
text
:
"Wei"
;
zeros
:
""
}
ListElement
{
text
:
"Ada"
;
zeros
:
"000"
}
ListElement
{
text
:
"Babbage"
;
zeros
:
"000000"
}
ListElement
{
text
:
"Shannon"
;
zeros
:
"000000000"
}
ListElement
{
text
:
"Szabo"
;
zeros
:
"000000000000"
}
ListElement
{
text
:
"Finney"
;
zeros
:
"000000000000000"
}
ListElement
{
text
:
"Ether"
;
zeros
:
"000000000000000000"
}
ListElement
{
text
:
"Einstein"
;
zeros
:
"000000000000000000000"
}
ListElement
{
text
:
"Douglas"
;
zeros
:
"000000000000000000000000000000000000000000"
}
}
TextField
{
TextField
{
id
:
txFuelRecipient
id
:
txFuelRecipient
placeholderText
:
"Address / Name or empty for contract"
placeholderText
:
"Address / Name or empty for contract"
...
@@ -774,6 +835,7 @@ ApplicationWindow {
...
@@ -774,6 +835,7 @@ ApplicationWindow {
width
:
400
width
:
400
}
}
RowLayout
{
TextField
{
TextField
{
id
:
txValue
id
:
txValue
width
:
222
width
:
222
...
@@ -784,6 +846,13 @@ ApplicationWindow {
...
@@ -784,6 +846,13 @@ ApplicationWindow {
}
}
}
}
ComboBox
{
id
:
valueDenom
currentIndex
:
6
model
:
denomModel
}
}
RowLayout
{
RowLayout
{
TextField
{
TextField
{
id
:
txGas
id
:
txGas
...
@@ -806,7 +875,7 @@ ApplicationWindow {
...
@@ -806,7 +875,7 @@ ApplicationWindow {
id
:
txGasPrice
id
:
txGasPrice
width
:
200
width
:
200
placeholderText
:
"Gas price"
placeholderText
:
"Gas price"
text
:
"10
00000
"
text
:
"10"
validator
:
RegExpValidator
{
regExp
:
/
\d
*/
}
validator
:
RegExpValidator
{
regExp
:
/
\d
*/
}
/*
/*
onTextChanged: {
onTextChanged: {
...
@@ -814,6 +883,12 @@ ApplicationWindow {
...
@@ -814,6 +883,12 @@ ApplicationWindow {
}
}
*/
*/
}
}
ComboBox
{
id
:
gasDenom
currentIndex
:
4
model
:
denomModel
}
}
}
Label
{
Label
{
...
@@ -847,8 +922,9 @@ ApplicationWindow {
...
@@ -847,8 +922,9 @@ ApplicationWindow {
]
]
text
:
"Send"
text
:
"Send"
onClicked
:
{
onClicked
:
{
//this.enabled = false
var
value
=
txValue
.
text
+
denomModel
.
get
(
valueDenom
.
currentIndex
).
zeros
;
var
res
=
eth
.
create
(
txFuelRecipient
.
text
,
txValue
.
text
,
txGas
.
text
,
txGasPrice
.
text
,
codeView
.
text
)
var
gasPrice
=
txGasPrice
.
text
+
denomModel
.
get
(
gasDenom
.
currentIndex
).
zeros
;
var
res
=
eth
.
create
(
txFuelRecipient
.
text
,
value
,
txGas
.
text
,
gasPrice
,
codeView
.
text
)
if
(
res
[
1
])
{
if
(
res
[
1
])
{
txResult
.
text
=
"Your contract <b>could not</b> be send over the network:
\n
<b>"
txResult
.
text
=
"Your contract <b>could not</b> be send over the network:
\n
<b>"
txResult
.
text
+=
res
[
1
].
error
()
txResult
.
text
+=
res
[
1
].
error
()
...
...
ethereal/assets/qml/webapp.qml
View file @
98335d20
...
@@ -170,6 +170,30 @@ ApplicationWindow {
...
@@ -170,6 +170,30 @@ ApplicationWindow {
postEvent
(
ev
,
[
storageObject
.
address
,
storageObject
.
value
])
postEvent
(
ev
,
[
storageObject
.
address
,
storageObject
.
value
])
}
}
}
}
Rectangle
{
id
:
toggleInspector
color
:
"#bcbcbc"
visible
:
true
height
:
12
width
:
12
anchors
{
right
:
root
.
right
}
MouseArea
{
onClicked
:
{
if
(
inspector
.
visible
==
true
){
inspector
.
visible
=
false
}
else
{
inspector
.
visible
=
true
}
}
onDoubleClicked
:
{
console
.
log
(
'refreshing'
)
webView
.
reload
()
}
anchors.fill
:
parent
}
}
Rectangle
{
Rectangle
{
id
:
sizeGrip
id
:
sizeGrip
...
@@ -193,7 +217,7 @@ ApplicationWindow {
...
@@ -193,7 +217,7 @@ ApplicationWindow {
WebView
{
WebView
{
id
:
inspector
id
:
inspector
visible
:
tru
e
visible
:
fals
e
url
:
webview
.
experimental
.
remoteInspectorUrl
url
:
webview
.
experimental
.
remoteInspectorUrl
anchors
{
anchors
{
left
:
root
.
left
left
:
root
.
left
...
...
ethereal/config.go
View file @
98335d20
...
@@ -20,6 +20,8 @@ var ImportKey string
...
@@ -20,6 +20,8 @@ var ImportKey string
var
ExportKey
bool
var
ExportKey
bool
var
AssetPath
string
var
AssetPath
string
var
Datadir
string
func
Init
()
{
func
Init
()
{
flag
.
StringVar
(
&
Identifier
,
"id"
,
""
,
"Custom client identifier"
)
flag
.
StringVar
(
&
Identifier
,
"id"
,
""
,
"Custom client identifier"
)
flag
.
StringVar
(
&
OutboundPort
,
"port"
,
"30303"
,
"listening port"
)
flag
.
StringVar
(
&
OutboundPort
,
"port"
,
"30303"
,
"listening port"
)
...
@@ -35,5 +37,7 @@ func Init() {
...
@@ -35,5 +37,7 @@ func Init() {
flag
.
BoolVar
(
&
ExportKey
,
"export"
,
false
,
"export private key"
)
flag
.
BoolVar
(
&
ExportKey
,
"export"
,
false
,
"export private key"
)
flag
.
StringVar
(
&
ImportKey
,
"import"
,
""
,
"imports the given private key (hex)"
)
flag
.
StringVar
(
&
ImportKey
,
"import"
,
""
,
"imports the given private key (hex)"
)
flag
.
StringVar
(
&
Datadir
,
"datadir"
,
".ethereal"
,
"specifies the datadir to use. Takes precedence over config file."
)
flag
.
Parse
()
flag
.
Parse
()
}
}
ethereal/ethereum.go
View file @
98335d20
...
@@ -3,7 +3,6 @@ package main
...
@@ -3,7 +3,6 @@ package main
import
(
import
(
"fmt"
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/utils"
...
@@ -40,17 +39,15 @@ func main() {
...
@@ -40,17 +39,15 @@ func main() {
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
runtime
.
GOMAXPROCS
(
runtime
.
NumCPU
())
ethchain
.
InitFees
()
g
,
err
:=
globalconf
.
NewWithOptions
(
&
globalconf
.
Options
{
g
,
err
:=
globalconf
.
NewWithOptions
(
&
globalconf
.
Options
{
Filename
:
path
.
Join
(
ethutil
.
ApplicationFolder
(
".ethereal"
),
"conf.ini"
),
Filename
:
path
.
Join
(
ethutil
.
ApplicationFolder
(
Datadir
),
"conf.ini"
),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
else
{
}
else
{
g
.
ParseAll
()
g
.
ParseAll
()
}
}
ethutil
.
ReadConfig
(
".ethereal"
,
ethutil
.
LogFile
|
ethutil
.
LogStd
,
g
,
Identifier
)
ethutil
.
ReadConfig
(
Datadir
,
ethutil
.
LogFile
|
ethutil
.
LogStd
,
g
,
Identifier
)
// Instantiated a eth stack
// Instantiated a eth stack
ethereum
,
err
:=
eth
.
New
(
eth
.
CapDefault
,
UseUPnP
)
ethereum
,
err
:=
eth
.
New
(
eth
.
CapDefault
,
UseUPnP
)
...
...
ethereal/ui/gui.go
View file @
98335d20
...
@@ -56,7 +56,7 @@ func New(ethereum *eth.Ethereum) *Gui {
...
@@ -56,7 +56,7 @@ func New(ethereum *eth.Ethereum) *Gui {
}
}
func
(
gui
*
Gui
)
Start
(
assetPath
string
)
{
func
(
gui
*
Gui
)
Start
(
assetPath
string
)
{
const
version
=
"0.5.0 RC1
2
"
const
version
=
"0.5.0 RC1
3
"
defer
gui
.
txDb
.
Close
()
defer
gui
.
txDb
.
Close
()
...
@@ -69,7 +69,7 @@ func (gui *Gui) Start(assetPath string) {
...
@@ -69,7 +69,7 @@ func (gui *Gui) Start(assetPath string) {
Init
:
func
(
p
*
ethpub
.
KeyVal
,
obj
qml
.
Object
)
{
p
.
Key
=
""
;
p
.
Value
=
""
},
Init
:
func
(
p
*
ethpub
.
KeyVal
,
obj
qml
.
Object
)
{
p
.
Key
=
""
;
p
.
Value
=
""
},
}})
}})
ethutil
.
Config
.
SetClientString
(
fmt
.
Sprintf
(
"/Ethereal v%s"
,
version
)
)
ethutil
.
Config
.
SetClientString
(
"Ethereal"
)
// Create a new QML engine
// Create a new QML engine
gui
.
engine
=
qml
.
NewEngine
()
gui
.
engine
=
qml
.
NewEngine
()
...
@@ -356,3 +356,7 @@ func (gui *Gui) ChangeClientId(id string) {
...
@@ -356,3 +356,7 @@ func (gui *Gui) ChangeClientId(id string) {
func
(
gui
*
Gui
)
ClientId
()
string
{
func
(
gui
*
Gui
)
ClientId
()
string
{
return
ethutil
.
Config
.
Identifier
return
ethutil
.
Config
.
Identifier
}
}
func
(
gui
*
Gui
)
SetLogLevel
(
level
int
)
{
ethutil
.
Config
.
Log
.
SetLevel
(
level
)
}
ethereum/config.go
View file @
98335d20
...
@@ -24,6 +24,8 @@ var NonInteractive bool
...
@@ -24,6 +24,8 @@ var NonInteractive bool
var
StartJsConsole
bool
var
StartJsConsole
bool
var
InputFile
string
var
InputFile
string
var
Datadir
string
func
Init
()
{
func
Init
()
{
flag
.
Usage
=
func
()
{
flag
.
Usage
=
func
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
"%s [options] [filename]:
\n
"
,
os
.
Args
[
0
])
fmt
.
Fprintf
(
os
.
Stderr
,
"%s [options] [filename]:
\n
"
,
os
.
Args
[
0
])
...
@@ -46,6 +48,8 @@ func Init() {
...
@@ -46,6 +48,8 @@ func Init() {
flag
.
StringVar
(
&
LogFile
,
"logfile"
,
""
,
"log file (defaults to standard output)"
)
flag
.
StringVar
(
&
LogFile
,
"logfile"
,
""
,
"log file (defaults to standard output)"
)
flag
.
StringVar
(
&
ImportKey
,
"import"
,
""
,
"imports the given private key (hex)"
)
flag
.
StringVar
(
&
ImportKey
,
"import"
,
""
,
"imports the given private key (hex)"
)
flag
.
StringVar
(
&
Datadir
,
"datadir"
,
".ethereum"
,
"specifies the datadir to use. Takes precedence over config file."
)
flag
.
Parse
()
flag
.
Parse
()
InputFile
=
flag
.
Arg
(
0
)
InputFile
=
flag
.
Arg
(
0
)
...
...
ethereum/ethereum.go
View file @
98335d20
...
@@ -3,7 +3,6 @@ package main
...
@@ -3,7 +3,6 @@ package main
import
(
import
(
"fmt"
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/go-ethereum/utils"
"github.com/rakyll/globalconf"
"github.com/rakyll/globalconf"
...
@@ -62,14 +61,14 @@ func main() {
...
@@ -62,14 +61,14 @@ func main() {
}
}
g
,
err
:=
globalconf
.
NewWithOptions
(
&
globalconf
.
Options
{
g
,
err
:=
globalconf
.
NewWithOptions
(
&
globalconf
.
Options
{
Filename
:
path
.
Join
(
ethutil
.
ApplicationFolder
(
".ethereum"
),
"conf.ini"
),
Filename
:
path
.
Join
(
ethutil
.
ApplicationFolder
(
Datadir
),
"conf.ini"
),
})
})
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
err
)
fmt
.
Println
(
err
)
}
else
{
}
else
{
g
.
ParseAll
()
g
.
ParseAll
()
}
}
ethutil
.
ReadConfig
(
".ethereum"
,
lt
,
g
,
Identifier
)
ethutil
.
ReadConfig
(
Datadir
,
lt
,
g
,
Identifier
)
logger
:=
ethutil
.
Config
.
Log
logger
:=
ethutil
.
Config
.
Log
...
@@ -86,8 +85,6 @@ func main() {
...
@@ -86,8 +85,6 @@ func main() {
logSys
=
log
.
New
(
os
.
Stdout
,
""
,
flags
)
logSys
=
log
.
New
(
os
.
Stdout
,
""
,
flags
)
}
}
ethchain
.
InitFees
()
// Instantiated a eth stack
// Instantiated a eth stack
ethereum
,
err
:=
eth
.
New
(
eth
.
CapDefault
,
UseUPnP
)
ethereum
,
err
:=
eth
.
New
(
eth
.
CapDefault
,
UseUPnP
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment