aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethereum/main.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-12 00:37:17 +0800
committerobscuren <geffobscura@gmail.com>2015-03-12 00:37:17 +0800
commit239e17de126a3d7afa29da7ee423ffc79757877f (patch)
treee2f844a7b2a1ad88010745449863aa6f1cc14da4 /cmd/ethereum/main.go
parent61bf29be36a6678ba16c457229ca306339ea4ebc (diff)
parentc01d4c2f4c8704656e407ab4d80d9ec82e016731 (diff)
downloaddexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.gz
dexon-239e17de126a3d7afa29da7ee423ffc79757877f.tar.zst
dexon-239e17de126a3d7afa29da7ee423ffc79757877f.zip
Merge branch 'rpcfrontier' into develop
Diffstat (limited to 'cmd/ethereum/main.go')
-rw-r--r--cmd/ethereum/main.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 7b912cf6e..10d9c8fa4 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -26,6 +26,7 @@ import (
"os"
"runtime"
"strconv"
+ "strings"
"time"
"github.com/codegangsta/cli"
@@ -112,6 +113,7 @@ runtime will execute the file and exit.
},
}
app.Flags = []cli.Flag{
+ utils.UnlockedAccountFlag,
utils.BootnodesFlag,
utils.DataDirFlag,
utils.ListenPortFlag,
@@ -191,6 +193,21 @@ Please run 'ethereum account new' to create a new account.`)
func startEth(ctx *cli.Context, eth *eth.Ethereum) {
utils.StartEthereum(eth)
+
+ // Load startup keys. XXX we are going to need a different format
+ account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
+ if len(account) > 0 {
+ split := strings.Split(account, ":")
+ if len(split) != 2 {
+ utils.Fatalf("Illegal 'unlock' format (address:password)")
+ }
+ am := eth.AccountManager()
+ // Attempt to unlock the account
+ err := am.Unlock(ethutil.Hex2Bytes(split[0]), split[1])
+ if err != nil {
+ utils.Fatalf("Unlock account failed '%v'", err)
+ }
+ }
// Start auxiliary services if enabled.
if ctx.GlobalBool(utils.RPCEnabledFlag.Name) {
utils.StartRPC(eth, ctx)