@@ -4,31 +4,20 @@ import (
4
4
"os"
5
5
"runtime"
6
6
7
+ "github.com/ethereum/eth-go"
7
8
"github.com/ethereum/eth-go/ethlog"
8
9
"github.com/ethereum/go-ethereum/utils"
9
- "github.com/go- qml/qml "
10
+ "gopkg.in/ qml.v1 "
10
11
)
11
12
12
13
const (
13
14
ClientIdentifier = "Ethereal"
14
15
Version = "0.6.1"
15
16
)
16
17
17
- func main () {
18
- runtime .GOMAXPROCS (runtime .NumCPU ())
19
-
20
- // This is a bit of a cheat, but ey!
21
- os .Setenv ("QTWEBKIT_INSPECTOR_SERVER" , "127.0.0.1:99999" )
22
-
23
- qml .Init (nil )
24
-
25
- var interrupted = false
26
- utils .RegisterInterrupt (func (os.Signal ) {
27
- interrupted = true
28
- })
29
-
30
- utils .HandleInterrupt ()
18
+ var ethereum * eth.Ethereum
31
19
20
+ func run () error {
32
21
// precedence: code-internal flag default < config file < environment variables < command line
33
22
Init () // parsing command line
34
23
@@ -47,7 +36,7 @@ func main() {
47
36
48
37
clientIdentity := utils .NewClientIdentity (ClientIdentifier , Version , Identifier )
49
38
50
- ethereum : = utils .NewEthereum (db , clientIdentity , keyManager , UseUPnP , OutboundPort , MaxPeer )
39
+ ethereum = utils .NewEthereum (db , clientIdentity , keyManager , UseUPnP , OutboundPort , MaxPeer )
51
40
52
41
if ShowGenesis {
53
42
utils .ShowGenesis (ethereum )
@@ -65,6 +54,26 @@ func main() {
65
54
utils .StartEthereum (ethereum , UseSeed )
66
55
// gui blocks the main thread
67
56
gui .Start (AssetPath )
57
+
58
+ return nil
59
+ }
60
+
61
+ func main () {
62
+ runtime .GOMAXPROCS (runtime .NumCPU ())
63
+
64
+ // This is a bit of a cheat, but ey!
65
+ os .Setenv ("QTWEBKIT_INSPECTOR_SERVER" , "127.0.0.1:99999" )
66
+
67
+ //qml.Init(nil)
68
+ qml .Run (run )
69
+
70
+ var interrupted = false
71
+ utils .RegisterInterrupt (func (os.Signal ) {
72
+ interrupted = true
73
+ })
74
+
75
+ utils .HandleInterrupt ()
76
+
68
77
// we need to run the interrupt callbacks in case gui is closed
69
78
// this skips if we got here by actual interrupt stopping the GUI
70
79
if ! interrupted {
0 commit comments