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
8419ba0e
Commit
8419ba0e
authored
May 22, 2014
by
Maran
Browse files
Options
Browse Files
Download
Plain Diff
Fix merge conflicts
parents
93d79bab
01b83314
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
3 deletions
+73
-3
wallet.qml
ethereal/assets/qml/wallet.qml
+1
-0
webapp.qml
ethereal/assets/qml/webapp.qml
+1
-1
javascript_runtime.go
ethereum/javascript_runtime.go
+14
-1
repl_darwin.go
ethereum/repl_darwin.go
+27
-1
cmd.go
utils/cmd.go
+30
-0
No files found.
ethereal/assets/qml/wallet.qml
View file @
8419ba0e
...
@@ -6,6 +6,7 @@ import QtQuick.Window 2.1;
...
@@ -6,6 +6,7 @@ import QtQuick.Window 2.1;
import
QtQuick
.
Controls
.
Styles
1.1
import
QtQuick
.
Controls
.
Styles
1.1
import
Ethereum
1.0
import
Ethereum
1.0
ApplicationWindow
{
ApplicationWindow
{
id
:
root
id
:
root
...
...
ethereal/assets/qml/webapp.qml
View file @
8419ba0e
...
@@ -188,7 +188,7 @@ ApplicationWindow {
...
@@ -188,7 +188,7 @@ ApplicationWindow {
WebView
{
WebView
{
id
:
inspector
id
:
inspector
visible
:
fals
e
visible
:
tru
e
url
:
webview
.
experimental
.
remoteInspectorUrl
url
:
webview
.
experimental
.
remoteInspectorUrl
anchors
{
anchors
{
left
:
root
.
left
left
:
root
.
left
...
...
ethereum/javascript_runtime.go
View file @
8419ba0e
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/go-ethereum/utils"
"github.com/obscuren/otto"
"github.com/obscuren/otto"
"io/ioutil"
"io/ioutil"
"os"
"os"
...
@@ -116,14 +117,26 @@ func (self *JSRE) initStdFuncs() {
...
@@ -116,14 +117,26 @@ func (self *JSRE) initStdFuncs() {
eth
.
Set
(
"watch"
,
self
.
watch
)
eth
.
Set
(
"watch"
,
self
.
watch
)
eth
.
Set
(
"addPeer"
,
self
.
addPeer
)
eth
.
Set
(
"addPeer"
,
self
.
addPeer
)
eth
.
Set
(
"require"
,
self
.
require
)
eth
.
Set
(
"require"
,
self
.
require
)
eth
.
Set
(
"stopMining"
,
self
.
stopMining
)
eth
.
Set
(
"startMining"
,
self
.
startMining
)
}
}
/*
/*
* The following methods are natively implemented javascript functions
* The following methods are natively implemented javascript functions
*/
*/
func
(
self
*
JSRE
)
stopMining
(
call
otto
.
FunctionCall
)
otto
.
Value
{
v
,
_
:=
self
.
vm
.
ToValue
(
utils
.
StopMining
(
self
.
ethereum
))
return
v
}
func
(
self
*
JSRE
)
startMining
(
call
otto
.
FunctionCall
)
otto
.
Value
{
v
,
_
:=
self
.
vm
.
ToValue
(
utils
.
StartMining
(
self
.
ethereum
))
return
v
}
// eth.watch
// eth.watch
func
(
self
JSRE
)
watch
(
call
otto
.
FunctionCall
)
otto
.
Value
{
func
(
self
*
JSRE
)
watch
(
call
otto
.
FunctionCall
)
otto
.
Value
{
addr
,
_
:=
call
.
Argument
(
0
)
.
ToString
()
addr
,
_
:=
call
.
Argument
(
0
)
.
ToString
()
var
storageAddr
string
var
storageAddr
string
var
cb
otto
.
Value
var
cb
otto
.
Value
...
...
ethereum/repl_darwin.go
View file @
8419ba0e
package
main
package
main
// #cgo darwin CFLAGS: -I/usr/local/opt/readline/include
// #cgo darwin LDFLAGS: -L/usr/local/opt/readline/lib
// #cgo LDFLAGS: -lreadline
// #cgo LDFLAGS: -lreadline
// #include <stdio.h>
// #include <stdio.h>
// #include <stdlib.h>
// #include <stdlib.h>
// #include <readline/readline.h>
// #include <readline/readline.h>
// #include <readline/history.h>
// #include <readline/history.h>
import
"C"
import
"C"
import
(
import
(
"os"
"os/signal"
"strings"
"strings"
"syscall"
"unsafe"
"unsafe"
)
)
func
initReadLine
()
{
C
.
rl_catch_sigwinch
=
0
C
.
rl_catch_signals
=
0
c
:=
make
(
chan
os
.
Signal
,
1
)
signal
.
Notify
(
c
,
syscall
.
SIGWINCH
)
signal
.
Notify
(
c
,
os
.
Interrupt
)
go
func
()
{
for
sig
:=
range
c
{
switch
sig
{
case
syscall
.
SIGWINCH
:
C
.
rl_resize_terminal
()
case
os
.
Interrupt
:
C
.
rl_cleanup_after_signal
()
default
:
}
}
}()
}
func
readLine
(
prompt
*
string
)
*
string
{
func
readLine
(
prompt
*
string
)
*
string
{
var
p
*
C
.
char
var
p
*
C
.
char
...
@@ -59,6 +84,7 @@ func (self *JSRepl) setIndent() {
...
@@ -59,6 +84,7 @@ func (self *JSRepl) setIndent() {
}
}
func
(
self
*
JSRepl
)
read
()
{
func
(
self
*
JSRepl
)
read
()
{
initReadLine
()
L
:
L
:
for
{
for
{
switch
result
:=
readLine
(
&
self
.
prompt
);
true
{
switch
result
:=
readLine
(
&
self
.
prompt
);
true
{
...
...
utils/cmd.go
View file @
8419ba0e
...
@@ -19,6 +19,8 @@ func DoRpc(ethereum *eth.Ethereum, RpcPort int) {
...
@@ -19,6 +19,8 @@ func DoRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
}
}
var
miner
ethminer
.
Miner
func
DoMining
(
ethereum
*
eth
.
Ethereum
)
{
func
DoMining
(
ethereum
*
eth
.
Ethereum
)
{
// Set Mining status
// Set Mining status
ethereum
.
Mining
=
true
ethereum
.
Mining
=
true
...
@@ -31,6 +33,10 @@ func DoMining(ethereum *eth.Ethereum) {
...
@@ -31,6 +33,10 @@ func DoMining(ethereum *eth.Ethereum) {
addr
:=
keyPair
.
Address
()
addr
:=
keyPair
.
Address
()
go
func
()
{
go
func
()
{
ethutil
.
Config
.
Log
.
Infoln
(
"Miner started"
)
miner
=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
// Give it some time to connect with peers
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
time
.
Sleep
(
3
*
time
.
Second
)
...
@@ -44,3 +50,27 @@ func DoMining(ethereum *eth.Ethereum) {
...
@@ -44,3 +50,27 @@ func DoMining(ethereum *eth.Ethereum) {
miner
.
Start
()
miner
.
Start
()
}()
}()
}
}
func
StopMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
ethereum
.
Mining
{
miner
.
Stop
()
ethutil
.
Config
.
Log
.
Infoln
(
"Miner stopped"
)
ethereum
.
Mining
=
false
return
true
}
return
false
}
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
!
ethereum
.
Mining
{
DoMining
(
ethereum
)
return
true
}
return
false
}
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