Skip to content

Commit

Permalink
fix: Fix add block hash into ckb-indexer path. Restart ckb-indexer af…
Browse files Browse the repository at this point in the history
…ter restart ckb-node (#2444)
  • Loading branch information
yanguoyu authored Jul 8, 2022
1 parent 4d079ff commit 332de8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/neuron-wallet/src/controllers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ export default class ApiController {

handle('set-ckb-node-data-path', (_, dataPath: string) => {
SettingsService.getInstance().ckbDataPath = dataPath
startMonitor('ckb', true)
stopMonitor('ckb-indexer')
startMonitor(undefined, true)
return {
status: ResponseCode.Success,
result: SettingsService.getInstance().ckbDataPath
Expand All @@ -483,7 +484,7 @@ export default class ApiController {
startMonitor('ckb-indexer', true)
return {
status: ResponseCode.Success,
result: SettingsService.getInstance().ckbDataPath
result: SettingsService.getInstance().indexerDataPath
}
})

Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/src/services/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ export default class IndexerService {
#getDataPath = (network: Network): string => {
let indexerDataPath = SettingsService.getInstance().indexerDataPath
if (!indexerDataPath) {
indexerDataPath = path.resolve(env.fileBasePath, IndexerService.indexerDataFolder, 'data', `${network.genesisHash}`)
indexerDataPath = path.resolve(env.fileBasePath, IndexerService.indexerDataFolder, 'data')
SettingsService.getInstance().indexerDataPath = indexerDataPath
}
return indexerDataPath
return path.resolve(indexerDataPath, `${network.genesisHash}`)
}
}

1 comment on commit 332de8b

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 2634874547

Please sign in to comment.