forked from artheranet/perftool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accs.go
43 lines (34 loc) · 905 Bytes
/
accs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"github.com/artheranet/arthera-node/params"
"math/big"
"os"
"path/filepath"
"github.com/ethereum/go-ethereum/accounts/keystore"
"gopkg.in/urfave/cli.v1"
)
var (
gasLimit = uint64(21000)
gasPrice = new(big.Int).Mul(params.DefaultEconomyRules().MinGasPrice, big.NewInt(3))
)
func makeKeyStore(ctx *cli.Context) (*keystore.KeyStore, error) {
keydir := ctx.GlobalString(KeyStoreDirFlag.Name)
keydir, err := filepath.Abs(keydir)
if err != nil {
return nil, err
}
err = os.MkdirAll(keydir, 0700)
if err != nil {
return nil, err
}
keyStore := keystore.NewPlaintextKeyStore(keydir)
return keyStore, nil
}
func openKeyStore(keydir string) (*keystore.KeyStore, error) {
keydir, err := filepath.Abs(keydir)
if err != nil {
return nil, err
}
keyStore := keystore.NewKeyStore(keydir, keystore.StandardScryptN, keystore.StandardScryptP)
return keyStore, nil
}