Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/documentation/buying-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ The lifetime of the batch starts counting down from the moment of purchase. The
Just as with buying storage, since storage comes only in [***discrete sizes***](/docs/storage/#batch-size-breakpoints), the actual amount of additional space when extending the storage size of an existing batch will typically be greater than specified.
:::

If we need to upload more data, then we can extend a batch's storage size using the `bee.extendStorageSize` method. Note that in order to increase the batch size using the `extendStorageSize` method, you must choose a size which is above the current [batch's size breakpoint](/docs/buying-storage/#batch-size-breakpoints).
If we need to upload more data, then we can extend a batch's storage size using the `bee.extendStorageSize` method. Note that in order to increase the batch size using the `extendStorageSize` method, you must choose a size which is above the current [batch's size breakpoint](/docs/storage/#batch-size-breakpoints).

:::tip
As mentioned [above](/docs/buying-storage/#batch-size-breakpoints), the per byte cost decreases as the storage size of a batch increases, so it's more cost effective to increase the storage size an existing batch rather than buying a new, smaller batch.
As mentioned [above](/docs/storage/#batch-size-breakpoints), the per byte cost decreases as the storage size of a batch increases, so it's more cost effective to increase the storage size an existing batch rather than buying a new, smaller batch.

The exception to this rule is if we no longer wish to store the previously uploaded data. In that case we SHOULD buy an all new postage batch, as extending the size of an existing batch would require us to continue paying for the already uploaded data which we no longer need.
:::
Expand Down Expand Up @@ -151,7 +151,7 @@ const result = await bee.extendStorageSize(batchId, newSize)
console.log(result)
```

We can check that we successfully extended the batch size by [checking batch status](/docs/buying-storage/#checking-storage-status):
We can check that we successfully extended the batch size by [checking batch status](/docs/storage/#checking-storage-status):

```javascript
[
Expand All @@ -178,7 +178,7 @@ We can check that we successfully extended the batch size by [checking batch sta

Here we can see that our batch `size` was successfully extended from ~4.93 GB to ~17.03 GB.

*See [above](/docs/buying-storage/#batch-size-breakpoints) to understand why `size` was extended to ~17.03 even though 5 GB was used as input.*
*See [above](/docs/storage/#batch-size-breakpoints) to understand why `size` was extended to ~17.03 even though 5 GB was used as input.*


### Extending Storage Duration
Expand Down Expand Up @@ -236,7 +236,7 @@ const result = await bee.extendStorageDuration(batchId, additionalDuration)
console.log(result)
```

We can verify that the extension was successful by [checking the batch status](/docs/buying-storage/#checking-storage-status). You'll notice the `duration` value on the batch will have increased, reflecting the newly extended storage time:
We can verify that the extension was successful by [checking the batch status](/docs/storage/#checking-storage-status). You'll notice the `duration` value on the batch will have increased, reflecting the newly extended storage time:

```javascript
[
Expand Down Expand Up @@ -305,7 +305,7 @@ console.log(cost)
This method helps you determine if it's more economical to **extend** an existing batch or **create a new one**, especially when both dimensions—storage and time—need to grow.

:::tip
If you're unsure whether to extend a batch or start fresh, compare the output of `getExtensionCost` with the cost of a new batch using the [Postage Stamp Pricing Guide](/docs/buying-storage/#batch-size-breakpoints). In many cases, extending is cheaper, especially for larger and longer-lived batches.
If you're unsure whether to extend a batch or start fresh, compare the output of `getExtensionCost` with the cost of a new batch using the [Postage Stamp Pricing Guide](/docs/storage/#batch-size-breakpoints). In many cases, extending is cheaper, especially for larger and longer-lived batches.
:::

If you're happy with the cost, you can then proceed to extend the **size** and **duration** individually by calling `extendStorageSize` and `extendStorageDuration` as shown in the previous sections.
Expand Down Expand Up @@ -363,7 +363,7 @@ We can disregard many of these values since they are only needed for advanced us
For an explanation of the remaining values, refer to the "Advanced" section below.

:::tip
Note that although 1 GB was specified as input for the `bee.buyStorage`, the `size` value is ~4.93 GB. Refer to the [section about batch sizes](/docs/buying-storage/#batch-size-breakpoints) above to understand why.
Note that although 1 GB was specified as input for the `bee.buyStorage`, the `size` value is ~4.93 GB. Refer to the [section about batch sizes](/docs/storage/#batch-size-breakpoints) above to understand why.
:::

### Selecting a Batch
Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ That said, the `bee-js` library itself works seamlessly within WSL. If you prefe
You can use [`create-swarm-app`](https://www.npmjs.com/package/create-swarm-app) to quickly set up scaffolding for a `bee-js` project with the following command:

```bash
npm init swarm-app@latest {app-name} {app-type}
npm init swarm-app@latest app-name app-type
```

Replace "{app-name}" with your app's name, and "{app-type}" with the type of app you want. Supported types are `node`, `node-esm`, `node-ts` and `vite-tsx`.
Replace "app-name" with your app's name, and "app-type" with the type of app you want. Supported types are `node`, `node-esm`, `node-ts` and `vite-tsx`.

Start a Swarm project using TypeScript:

Expand Down Expand Up @@ -131,6 +131,6 @@ tree .
└── tsconfig.json
```

The exact results will differ slightly depending on which `{app-type}` you use, but they will all include a `config.ts` or `config.js` file where the Bee node's API endpoint must be specified.
The exact results will differ slightly depending on which `app-type` you use, but they will all include a `config.ts` or `config.js` file where the Bee node's API endpoint must be specified.

The endpoint is set to the default Bee API endpoint of `http://localhost:1633`, if your node uses a different endpoint you will need to update it in the config file.
15 changes: 9 additions & 6 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ module.exports = {
baseUrl: "/",
trailingSlash: true,
plugins: [
[
'docusaurus-lunr-search',
{
languages: ['en'], // optional
},
],
],
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
Expand Down Expand Up @@ -83,6 +77,15 @@ module.exports = {
],
copyright: `Copyleft © ${new Date().getFullYear()}.`,
},
algolia: {
appId: "D7BASQ1ESY",

apiKey: "8a175ff0c34022d46b4b26cf6f02ad41",

indexName: "bee-js-docs-search",

contextualSearch: false,
},
},
presets: [
[
Expand Down
Loading