Skip to content

Commit

Permalink
feat(dev-script): add private key to default config
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Jun 5, 2023
1 parent 0157f6e commit 2c4e939
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/builtin-tasks/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import path from 'node:path'
import fs from 'fs'
import { scheduler } from 'node:timers/promises'
import undici from 'undici'
import { DEFAULT_KUAI_PRIVATE_KEY } from '../constants'

interface Args {
port: number
Expand Down Expand Up @@ -70,7 +71,7 @@ subtask('node:start', 'start a ckb node')
builtInDirPath,
indexer: new Indexer(ckbDockerNetwork.url),
rpc: new RPC(ckbDockerNetwork.url),
privateKey: '0xfd686a48908e8caf97723578bf85f746e1e1d8956cb132f6a2e92e7234a2a245',
privateKey: env.config.kuaiArguments.privateKey ?? DEFAULT_KUAI_PRIVATE_KEY,
})
})

Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { NetworkConfig } from './type'
import { config } from '@ckb-lumos/lumos'
import envPaths from 'env-paths'

export const DEFAULT_KUAI_PRIVATE_KEY = '0xfd686a48908e8caf97723578bf85f746e1e1d8956cb132f6a2e92e7234a2a245'

export const DEFAULT_KUAI_ARGUMENTS = {
network: 'docker-node',
privateKey: DEFAULT_KUAI_PRIVATE_KEY,
}

export const DEFAULT_NETWORKDS: {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/type/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type TaskArguments = any
export interface KuaiArguments {
configPath?: string
network?: string
privateKey?: string
}

export interface KuaiConfig {
Expand Down

0 comments on commit 2c4e939

Please sign in to comment.