Skip to content

Commit

Permalink
Add typing for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Oct 3, 2023
1 parent 5e1b171 commit 349dc2b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ import { execSync } from 'child_process'
import { RPCManager } from './rpc/rpc.js'
import { SignableENR } from '@chainsafe/discv5'
import { Enr } from './rpc/schema/types.js'
import { ClientOpts } from './types.js'

const args: any = yargs(hideBin(process.argv))
const args: ClientOpts = yargs(hideBin(process.argv))
.parserConfiguration({
'dot-notation': false,
})
.option('pk', {
describe: 'base64 string encoded protobuf serialized private key',
optional: true,
string: true,
})
.option('bootnode', {
Expand Down Expand Up @@ -80,7 +85,9 @@ const args: any = yargs(hideBin(process.argv))
describe: 'a trusted blockroot to start light client syncing of the beacon chain',
string: true,
optional: true,
}).argv
})
.strict()
.parseSync().argv as unknown as ClientOpts

const register = new PromClient.Registry()

Expand Down Expand Up @@ -123,6 +130,7 @@ const main = async () => {
bindAddrs: {
ip4: initMa,
},
trustedBlockRoot: args.trustedBlockRoot,
} as any
let networks: ProtocolId[] = []
if (args.networks) {
Expand Down Expand Up @@ -150,7 +158,7 @@ const main = async () => {
db,
metrics,
supportedProtocols: networks,
dataDir: args.datadir,
dataDir: args.dataDir,
})
portal.discv5.enableLogs()

Expand Down

0 comments on commit 349dc2b

Please sign in to comment.