Skip to content

Commit 2cc2c6f

Browse files
authored
feat: improve onboarding flow (#556)
1 parent 23ad3a3 commit 2cc2c6f

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/command/stamp/create.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@ export class Create extends StampCommand implements LeafCommand {
1414

1515
@Option({
1616
key: 'capacity',
17-
description: 'Size of data, e.g. 100MB, 1GB',
17+
description: 'Size of data, e.g. 1GB',
1818
type: 'string',
1919
required: false,
2020
})
2121
public capacity!: string
2222

2323
@Option({
2424
key: 'ttl',
25-
description: 'Time to live of the postage stamp, e.g. 1d, 4w, "6 months", 1y',
25+
description: 'Time to live of the postage stamp, e.g. 1d, 1w, 1month',
2626
type: 'string',
2727
required: false,
2828
})
2929
public ttl!: string
3030

31-
@Option({ key: 'immutable', description: 'Disable stamp reuse', type: 'boolean', default: true })
31+
@Option({
32+
key: 'immutable',
33+
description: 'At full capacity, immutable prevents; mutable allows further uploads, overwriting old data',
34+
type: 'boolean',
35+
default: true,
36+
})
3237
public immutable!: boolean
3338

3439
@Option({ key: 'label', description: 'Label of the postage stamp' })
@@ -43,19 +48,19 @@ export class Create extends StampCommand implements LeafCommand {
4348
let ttlInMillis = 0
4449

4550
if (!this.capacity) {
46-
this.console.log('Please provide the capacity of the postage stamp')
47-
this.console.log('This is the size of the data that can be uploaded with this stamp')
48-
this.console.log('Example: 100MB, 1GB')
51+
this.console.log('Please provide the total capacity of the postage stamp batch')
52+
this.console.log('This represents the total size of data that can be uploaded')
53+
this.console.log('Example: 1GB')
4954
this.capacity = await this.console.askForValue('Capacity')
5055
this.console.log('')
5156
}
5257

5358
capacityInBytes = Numbers.makeStorage(this.capacity)
5459

5560
if (!this.ttl) {
56-
this.console.log('Please provide the time to live of the postage stamp')
57-
this.console.log('This is the time after which the stamp will expire')
58-
this.console.log('Example: 1h, 1d, 1w')
61+
this.console.log('Please provide the time-to-live (TTL) of the postage stamps')
62+
this.console.log('Defines the duration after which the stamp will expire')
63+
this.console.log('Example: 1d, 1w, 1month')
5964
this.ttl = await this.console.askForValue('TTL')
6065
this.console.log('')
6166
}
@@ -91,12 +96,6 @@ export class Create extends StampCommand implements LeafCommand {
9196
this.console.log(createKeyValue('Estimated TTL', Dates.secondsToHumanTime(estimatedTtl)))
9297
this.console.log(createKeyValue('Type', this.immutable ? 'Immutable' : 'Mutable'))
9398

94-
if (this.immutable) {
95-
this.console.info('At full capacity, an immutable stamp no longer allows new content uploads.')
96-
} else {
97-
this.console.info('At full capacity, a mutable stamp allows new content uploads, but overwrites old content.')
98-
}
99-
10099
if (!this.quiet && !this.yes) {
101100
this.yes = await this.console.confirm('Confirm the purchase')
102101
}

src/command/status.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BeeModes } from '@ethersphere/bee-js'
22
import { Numbers } from 'cafe-utility'
33
import chalk from 'chalk'
44
import { LeafCommand } from 'furious-commander'
5+
import { exit } from 'process'
56
import { createKeyValue } from '../utils/text'
67
import { RootCommand } from './root-command'
78

@@ -20,6 +21,8 @@ export class Status extends RootCommand implements LeafCommand {
2021
process.stdout.write(chalk.bold.green(' [OK]') + '\n')
2122
} catch {
2223
process.stdout.write(chalk.bold.red(' [FAILED]') + '\n')
24+
process.stdout.write('\nIs your Bee node running?\n')
25+
exit(1)
2326
}
2427
const versions = await this.bee.getVersions()
2528
this.console.all(createKeyValue('Version', versions.beeVersion))

src/command/utility/get-bee.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export class GetBee extends RootCommand implements LeafCommand {
4242
execSync('chmod +x bee')
4343
}
4444

45-
if (existsSync('config.yaml')) {
46-
this.console.log('config.yaml already exists, done')
45+
if (existsSync('bee.yaml')) {
46+
this.console.log('bee.yaml already exists, done')
4747

4848
return
4949
}
@@ -54,7 +54,7 @@ export class GetBee extends RootCommand implements LeafCommand {
5454

5555
const type = await this.console.promptList(['ultra-light', 'light'], 'Select the type of configuration to create')
5656
writeFileSync(
57-
'config.yaml',
57+
'bee.yaml',
5858
`api-addr: 127.0.0.1:1633
5959
blockchain-rpc-endpoint: "https://xdai.fairdatasociety.org"
6060
cors-allowed-origins: ["*"]
@@ -70,6 +70,6 @@ password: "${Strings.randomAlphanumeric(20)}"`,
7070
this.console.info('')
7171
this.console.log('All set! Start Bee node by running:')
7272
this.console.info('')
73-
this.console.log('./bee start --config=config.yaml')
73+
this.console.log('./bee start --config=bee.yaml')
7474
}
7575
}

0 commit comments

Comments
 (0)