-
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 #290 from EpicsDAO/feature
Add Geyser/Firedancer Setup Option
- Loading branch information
Showing
34 changed files
with
693 additions
and
188 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,17 @@ | ||
--- | ||
'@epics-dao/solv': minor | ||
--- | ||
|
||
Add Geyser/Firedancer Setup Option | ||
|
||
## Setup Geyser Yellowstone | ||
|
||
``` | ||
solv setup --geyser | ||
``` | ||
|
||
## Setup Firedancer (Frankendancer) | ||
|
||
``` | ||
solv setup --firedancer | ||
``` |
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 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { VERSION_FIREDANCER } from '@/config/versionConfig' | ||
import { spawnSync } from 'child_process' | ||
import startFiredancerScript from './startFiredancerScript' | ||
import firedancerService from '../template/firedancer/firedancerService' | ||
import configToml from '../template/firedancer/configToml' | ||
|
||
const setupFiredancer = async () => { | ||
spawnSync( | ||
`git clone --recurse-submodules https://github.com/firedancer-io/firedancer.git`, | ||
{ shell: true, stdio: 'inherit' }, | ||
) | ||
spawnSync(`git checkout v${VERSION_FIREDANCER}`, { | ||
shell: true, | ||
stdio: 'inherit', | ||
cwd: '/home/solv/firedancer', | ||
}) | ||
spawnSync(`./deps.sh`, { | ||
shell: true, | ||
stdio: 'inherit', | ||
cwd: '/home/solv/firedancer', | ||
}) | ||
spawnSync(`make -j fdctl solana`, { | ||
shell: true, | ||
stdio: 'inherit', | ||
cwd: '/home/solv/firedancer', | ||
}) | ||
spawnSync( | ||
`sudo ln -s /home/solv/firedancer/build/native/gcc/bin/fdctl /usr/local/bin/fdctl`, | ||
{ | ||
shell: true, | ||
stdio: 'inherit', | ||
}, | ||
) | ||
const { filePath, body } = startFiredancerScript() | ||
spawnSync(`echo "${body}" | sudo tee ${filePath} > /dev/null`, { | ||
shell: true, | ||
stdio: 'inherit', | ||
}) | ||
spawnSync(`chmod +x ${filePath}`, { shell: true, stdio: 'inherit' }) | ||
const fdService = firedancerService() | ||
spawnSync( | ||
`echo "${fdService.body}" | sudo tee ${fdService.filePath} > /dev/null`, | ||
{ | ||
shell: true, | ||
stdio: 'inherit', | ||
}, | ||
) | ||
|
||
spawnSync(`sudo systemctl daemon-reload`, { shell: true }) | ||
const toml = configToml() | ||
spawnSync(`echo "${toml.body}" | sudo tee ${toml.filePath} > /dev/null`, { | ||
shell: true, | ||
stdio: 'inherit', | ||
}) | ||
} | ||
|
||
export default setupFiredancer |
12 changes: 12 additions & 0 deletions
12
packages/solv/src/cli/setup/firedancer/startFiredancerScript.ts
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,12 @@ | ||
const startFiredancerScript = () => { | ||
const filePath = '/home/solv/start-firedancer.sh' | ||
const body = `#!/usr/bin/env bash | ||
sudo fdctl configure init all --config /home/solv/firedancer/config.toml | ||
sudo fdctl run --config /home/solv/firedancer/config.toml` | ||
return { | ||
filePath, | ||
body, | ||
} | ||
} | ||
|
||
export default startFiredancerScript |
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
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
Oops, something went wrong.