77 "path/filepath"
88 "runtime"
99
10- //"github.com/urfave/cli"
1110 "github.com/urfave/cli/v2"
1211)
1312
5958 Name : "config" ,
6059 Usage : "TOML configuration file" ,
6160 }
61+ // RPCHost defines the host on which the RPC server should listen.
62+ RPCHost = & cli.StringFlag {
63+ Name : "rpc-host" ,
64+ Usage : "Host on which the RPC server should listen" ,
65+ }
66+ // RPCPort defines a beacon node RPC port to open.
67+ RPCPort = & cli.StringFlag {
68+ Name : "rpc-port" ,
69+ Usage : "RPC port exposed by GoDBLedger" ,
70+ }
71+ // CertFlag defines a flag for the node's TLS CA certificate.
72+ CACertFlag = & cli.StringFlag {
73+ Name : "ca-cert" ,
74+ Usage : "Certificate Authority certificate for secure gRPC. Pass this and the tls-key flag in order to use gRPC securely." ,
75+ }
76+ // CertFlag defines a flag for the node's TLS certificate.
77+ CertFlag = & cli.StringFlag {
78+ Name : "tls-cert" ,
79+ Usage : "Certificate for secure gRPC. Pass this and the tls-key flag in order to use gRPC securely." ,
80+ }
81+ // KeyFlag defines a flag for the node's TLS key.
82+ KeyFlag = & cli.StringFlag {
83+ Name : "tls-key" ,
84+ Usage : "Key for secure gRPC. Pass this and the tls-cert flag in order to use gRPC securely." ,
85+ }
86+ // LogFileName specifies the log output file name.
87+ LogFileName = & cli.StringFlag {
88+ Name : "log-file" ,
89+ Usage : "Specify log file name, relative or absolute" ,
90+ }
91+ // DatabaseType specifies the backend for GoDBLedger
92+ DatabaseTypeFlag = & cli.StringFlag {
93+ Name : "database" ,
94+ Usage : "Specify database type, sqlite3 or mysql" ,
95+ }
96+ // DatabaseLocation specifies file location for Sqlite or connection string for MySQL
97+ DatabaseLocationFlag = & cli.StringFlag {
98+ Name : "database-location" ,
99+ Usage : "location of database file or connection string" ,
100+ }
62101)
63102
64103func setConfig (ctx * cli.Context , cfg * LedgerConfig ) {
@@ -72,4 +111,25 @@ func setConfig(ctx *cli.Context, cfg *LedgerConfig) {
72111 if ctx .IsSet (DataDirFlag .Name ) {
73112 cfg .ConfigFile = ctx .String (DataDirFlag .Name )
74113 }
114+ if ctx .IsSet (RPCHost .Name ) {
115+ cfg .Host = ctx .String (RPCHost .Name )
116+ }
117+ if ctx .IsSet (RPCPort .Name ) {
118+ cfg .RPCPort = ctx .String (RPCPort .Name )
119+ }
120+ if ctx .IsSet (CACertFlag .Name ) {
121+ cfg .CACert = ctx .String (CACertFlag .Name )
122+ }
123+ if ctx .IsSet (CertFlag .Name ) {
124+ cfg .Cert = ctx .String (CertFlag .Name )
125+ }
126+ if ctx .IsSet (KeyFlag .Name ) {
127+ cfg .Key = ctx .String (KeyFlag .Name )
128+ }
129+ if ctx .IsSet (DatabaseTypeFlag .Name ) {
130+ cfg .DatabaseType = ctx .String (DatabaseTypeFlag .Name )
131+ }
132+ if ctx .IsSet (DatabaseLocationFlag .Name ) {
133+ cfg .DatabaseLocation = ctx .String (DatabaseLocationFlag .Name )
134+ }
75135}
0 commit comments