Skip to content

Commit

Permalink
chore: wording
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Dec 6, 2024
1 parent 6437978 commit c7cbb91
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions src/command/utility/get-bee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { execSync } from 'child_process'
import { existsSync, writeFileSync } from 'fs'
import { LeafCommand } from 'furious-commander'
import fetch from 'node-fetch'
import { CommandLineError } from '../../utils/error'
import { RootCommand } from '../root-command'

const archTable = {
Expand Down Expand Up @@ -36,47 +35,41 @@ export class GetBee extends RootCommand implements LeafCommand {
await fetch(url)
.then(x => x.arrayBuffer())
.then(x => writeFileSync(`bee${suffixString}`, Buffer.from(x)))
this.console.info('Bee downloaded successfully')
this.console.log('Bee downloaded successfully')

if (process.platform !== 'win32') {
this.console.info(`Running chmod +x bee to make it executable`)
execSync('chmod +x bee')
}

this.console.info('')
const deployConfig = await this.console.confirm('Create a preset Bee config.yaml file?')
if (existsSync('config.yaml')) {
this.console.log('config.yaml already exists, done')

if (deployConfig) {
if (existsSync('config.yaml')) {
throw new CommandLineError('config.yaml already exists, stopping')
}
return
}

this.console.info('')
this.console.info('Ultra-light: Limited download capabilities, no requirements')
this.console.info('Light: Upload and download, requires xDAI to launch and xBZZ to upload')
this.console.info('')
this.console.info('Ultra-light: Limited download capabilities, no funding required.')
this.console.info('Light: Full functionality; requires xDAI to launch and xBZZ for uploading and retrieving data.')

const type = await this.console.promptList(['ultra-light', 'light'], 'Select the type of configuration to create')
writeFileSync(
'config.yaml',
`api-addr: 127.0.0.1:1633
const type = await this.console.promptList(['ultra-light', 'light'], 'Select the type of configuration to create')
writeFileSync(
'config.yaml',
`api-addr: 127.0.0.1:1633
blockchain-rpc-endpoint: "https://xdai.fairdatasociety.org"
cors-allowed-origins: ["*"]
data-dir: "${process.cwd()}/data-dir"
full-node: false
mainnet: true
resolver-options: ["https://cloudflare-eth.com"]
storage-incentives-enable: false
swap-enable: ${type === 'light' ? 'true' : 'false'}
password: "${Strings.randomAlphanumeric(20)}"`,
)
)

this.console.info('')
this.console.info('All set! Start Bee node by running:')
this.console.info('')
this.console.info('./bee start --config=config.yaml')
} else {
this.console.info('Verify the version of the downloaded Bee binary by running:')
this.console.info('')
this.console.info('./bee version')
}
this.console.info('')
this.console.log('All set! Start Bee node by running:')
this.console.info('')
this.console.log('./bee start --config=config.yaml')
}
}

0 comments on commit c7cbb91

Please sign in to comment.