-
Notifications
You must be signed in to change notification settings - Fork 164
/
values.go
45 lines (40 loc) · 1.11 KB
/
values.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
44
45
package common
import (
"errors"
"os"
)
const (
// DefaultConfigAccountAliasesDirName fro accounts
DefaultConfigAccountAliasesDirName = "account-keys"
// DefaultPassphrase for accounts
DefaultPassphrase = ""
// Secp256k1PrivateKeyBytesLength privete key
Secp256k1PrivateKeyBytesLength = 32
// AmountDecimalPoint TRX decimal point
AmountDecimalPoint = 6
)
var (
// DefaultConfigDirName for wallets
DefaultConfigDirName = ".tronctl"
DebugGRPC = false
DebugTransaction = false
ErrNotAbsPath = errors.New("keypath is not absolute path")
ErrBadKeyLength = errors.New("Invalid private key (wrong length)")
ErrFoundNoPass = errors.New("found no passphrase file")
)
func init() {
if _, enabled := os.LookupEnv("TRONCTL_GRPC_DEBUG"); enabled != false {
DebugGRPC = true
}
if _, enabled := os.LookupEnv("TRONCTL_TX_DEBUG"); enabled != false {
DebugTransaction = true
}
if _, enabled := os.LookupEnv("TRONCTL_ALL_DEBUG"); enabled != false {
EnableAllVerbose()
}
}
// EnableAllVerbose sets debug vars to true
func EnableAllVerbose() {
DebugGRPC = true
DebugTransaction = true
}