-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from EpicsDAO/debug
Update - solv restart
- Loading branch information
Showing
9 changed files
with
45 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'@epics-dao/solv': patch | ||
--- | ||
|
||
Update - solv restart | ||
|
||
```bash | ||
$ solv restart | ||
``` | ||
|
||
This command will do this command below; | ||
|
||
```bash | ||
solana-validator --ledger /mnt/ledger exit --max-delinquent-stake 5 | ||
``` | ||
|
||
You can change `--max-delinquent-stake` value as you edit the `solv` configuration file. | ||
|
||
`/home/solv/solv.config.json` | ||
|
||
```json | ||
{ | ||
,... | ||
"maxDelinquentStake": 5 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,16 @@ | ||
import { program } from '@/index' | ||
import { ConfigParams } from '@/lib/readOrCreateDefaultConfig' | ||
import { restartFetch } from './restartFetch' | ||
import { restartSolv } from './restartSolv' | ||
|
||
type RestartOptions = { | ||
snapshot: boolean | ||
} | ||
import { spawnSync } from 'node:child_process' | ||
import { MT_PATHS } from '@/config/config' | ||
|
||
export const restartCommand = (solvConfig: ConfigParams) => { | ||
const { cmds } = solvConfig.locale | ||
program | ||
.command('restart') | ||
.description(cmds.restart) | ||
.option('--snapshot', 'Restart Solana Validator with fetch snapshot', false) | ||
.action(async (options: RestartOptions) => { | ||
try { | ||
if (options.snapshot) { | ||
await restartFetch(solvConfig) | ||
} else { | ||
// TODO: Uncomment this line and update the createSnapshot function when The Solana team releases the new instructions | ||
// Comment out for the usual restart | ||
// createSnapshot(solvConfig) | ||
await restartSolv(solvConfig) | ||
} | ||
} catch (error) { | ||
console.log( | ||
`If you failed to create a snapshot, please try - $ solv restart --snapshot`, | ||
) | ||
} | ||
.action(async () => { | ||
const config = solvConfig.config | ||
const cmd = `solana-validator --ledger ${MT_PATHS.LEDGER} exit --max-delinquent-stake ${config.MAINNET_DELINQUENT_STAKE}` | ||
spawnSync(cmd, { shell: true, stdio: 'inherit' }) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { spawnSync } from 'child_process' | ||
|
||
export const updateSolv = () => { | ||
spawnSync('pnpm add -g pnpm', { shell: true, stdio: 'inherit' }) | ||
const cmd = `pnpm add -g @epics-dao/solv` | ||
spawnSync(cmd, { shell: true, stdio: 'inherit' }) | ||
} |