You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide will help you install and run a Bee [light node](/docs/bee/working-with-bee/node-types) using the [shell script](/docs/bee/installation/shell-script-install) install method. After explaining how to install and start the node, the guide then explains how to use the [`swarm-cli` command line tool](/docs/bee/working-with-bee/swarm-cli) to find your node's address, fund your node, and buy a batch of postage stamps. Finally it explains how to upload data using a postage stamp batch and how to download that data.
6
+
This guide will help you install and run a Bee [light node](/docs/bee/working-with-bee/node-types) using the [shell script](/docs/bee/installation/shell-script-install) install method. After explaining how to install and start the node, the guide then explains how to use the [`swarm-cli` command line tool](/docs/bee/working-with-bee/swarm-cli) to find your node's address, fund your node, and fully initialize it so that it is ready interact with the network.
7
7
8
8
:::tip
9
9
A "light" node can download and upload data from Swarm but does not share its disk space with the network and does not earn rewards. [Learn more](/docs/bee/working-with-bee/node-types).
@@ -168,11 +168,11 @@ Learn how to [get xDAI and xBZZ](/docs/bee/installation/fund-your-node#getting-t
168
168
If you wait too long to fund your node it may shut itself down. In that case, simply use the same startup command to start the node again.
169
169
:::
170
170
171
-
## Wait to Sync (~30 Minutes)
171
+
## Wait to Sync (~5 Minutes)
172
172
173
173
After starting and funding a Bee light node for the first time, the node will automatically issue a [transaction](https://gnosisscan.io/tx/0xf8048c4e8020ccef842c9a901e6262e9c06d6f5926ff31bdb7dd9d7274dcf19c) on Gnosis Chain to deploy the node's [chequebook contract](/docs/concepts/incentives/bandwidth-incentives#chequebook-contract).
174
174
175
-
The node then needs to sync blockchain data before it can buy a postage stamp batch. The process may take ***half an hour or longer*** depending on your RPC provider and network speed.
175
+
The node then needs to sync blockchain data before it can buy a postage stamp batch. The process may take **~5 minutes** depending on your RPC provider and network speed.
176
176
177
177
You can check your node's syncing progress with the `swarm-cli status` command:
178
178
@@ -183,27 +183,16 @@ swarm-cli status
183
183
```bash
184
184
Bee
185
185
API: http://localhost:1633 [OK]
186
-
Version: 2.6.0-390a402e
186
+
Version: 2.6.0-d0aa8b93
187
187
Mode: light
188
188
189
-
Topology
190
-
Connected Peers: 143
191
-
Population: 6991
192
-
Depth: 11
193
-
194
-
Wallet
195
-
xBZZ: 0.0000000000000000
196
-
xDAI: 0.009829728398864856
197
-
198
189
Chainsync
199
-
Block: 33,515,656 / 38,855,407 (Δ 5,339,751)
190
+
Block: 39,566,742 / 41,710,807 (Δ 2,144,065)
200
191
201
-
Chequebook
202
-
Available xBZZ: 0.0000000000000000
203
-
Total xBZZ: 0.0000000000000000
192
+
Topology
193
+
ERROR Request failed with status code 503
204
194
205
-
Staking
206
-
Staked xBZZ: 0.0000000000000000
195
+
There may be additional information in the Bee logs.
207
196
```
208
197
209
198
The `Chainsync` section tells us how many blocks our node has synced so far out of the total Gnosis Chain blocks (and the number after the Δ symbol shows how many blocks still need to be synced):
@@ -213,137 +202,59 @@ Chainsync
213
202
Block: 33,515,656 / 38,855,407 (Δ 5,339,751)
214
203
```
215
204
216
-
Once our node is fully synced, we can move on to buying a batch of postage stamps.
217
-
218
-
## Buy a Batch of Postage Stamps
219
-
220
-
:::tip
221
-
If you try to purchase a batch of postage stamps before your node has fully synced, you will get a `503` error:
222
-
223
-
```bash
224
-
ERROR Request failed with status code 503
225
-
```
226
-
:::
227
-
228
-
Before uploading, you need a **postage stamp**. [Learn more](/docs/develop/access-the-swarm/buy-a-stamp-batch):
229
-
230
-
You can purchase a batch of stamps using the `swarm-cli create` command to specify how much data you wish to store and for how long:
231
-
232
-
```bash
233
-
swarm-cli stamp create
234
-
```
235
-
236
-
237
-
Example output:
238
-
239
-
```bash
240
-
Please provide the total capacity of the postage stamp batch
241
-
This represents the total size of data that can be uploaded
242
-
Example: 1GB
243
-
244
-
Please provide the time-to-live (TTL) of the postage stamps
245
-
Defines the duration after which the stamp will expire
246
-
Example: 1d, 1w, 1month
247
-
```
248
-
249
-
After running the command, you will be asked to specify how much data you wish to store and for how long. In our example we specified one day using `1d` and one gigabyte using `1gb`. The script then parses our input and chooses a ["depth" and "amount"](/docs/develop/access-the-swarm/buy-a-stamp-batch#setting-stamp-batch-parameters-and-options) for our batch, gives as an estimated cost, and prompts us to confirm if we wish to continue or not:
250
-
251
-
:::tip
252
-
The `amount` value determines how long your batch stays a live, while the `depth` value determines how much data it can store. There is a minimum depth of 17 and the `amount` value must be high enough for a batch with at least 24 hours of TTL (time to live). [Learn more](/docs/develop/access-the-swarm/buy-a-stamp-batch#setting-stamp-batch-parameters-and-options).
253
-
:::
254
-
255
-
```bash
256
-
You have provided the following parameters:
257
-
Capacity: 1.000 GB
258
-
TTL: 24 hours
259
-
260
-
Your parameters are now converted to Swarm's internal parameters:
261
-
Depth (capacity): 18
262
-
Amount (TTL): 581056344
263
-
264
-
Estimated cost: 0.015 xBZZ
265
-
Estimated capacity: 1.000 GB
266
-
Estimated TTL: 24 hours
267
-
Type: Immutable
268
-
? Confirm the purchase (Y/n)
269
-
```
270
-
271
-
:::info
272
-
The capacity and TTL are shown as estimates since the actual capacity and TTL are not deterministic. This is because of Swarm's [dynamic pricing model](/docs/concepts/incentives/price-oracle) and stamp batch [utilization mechanics](/docs/concepts/incentives/postage-stamps#batch-utilisation).
273
-
:::
274
-
275
-
We input `Y` to confirm our purchase, and then we wait a few moments for the script to issue a transaction on Gnosis Chain to purchase our batch. Finally the script will return a `Stamp ID`, which is the unique identifier for our postage stamp batch.
After purchasing a batch of postage stamps, we're ready to upload to Swarm. First create a sample file to upload. Open it with your text editor of choice and write a message:
205
+
The `Topology` section will show information about which other nodes your own node is connected with. It will display an `ERROR` until the node is fully initialized.
285
206
286
-
```bash
287
-
vi test.txt
288
-
cat test.txt
289
-
```
207
+
After several minutes, your node will be fully synced, and can now interact with the Swarm network - we can use `swarm-cli status` again to confirm:
290
208
291
209
```bash
292
-
Hello Swarm!
293
-
```
294
-
295
-
After saving your test file, use the `swarm-cli upload`command to upload your file:
296
-
297
-
```bash
298
-
swarm-cli upload test.txt
210
+
swarm-cli status
299
211
```
300
212
301
-
Then we will be prompted to choose a stamp batch ID, we only have a single batch so we just hit "Enter" to continue:
302
-
303
213
```bash
304
-
? Please selecta stamp for this action (Use arrow keys)
Capacity (immutable): 256.000 MB remaining out of 512.000 MB
317
-
```
219
+
Chainsync
220
+
Block: 41,710,955 / 41,710,962 (Δ 7)
318
221
319
-
The "Swarm hash" returned here is the unique reference for our upload.
222
+
Topology
223
+
Connected Peers: 151
224
+
Population: 2257
225
+
Depth: 10
320
226
321
-
You can share this hash with someone else and they can use it to download whatever you uploaded for as long as the stamp batch you used still has remaining TTL.
227
+
Wallet
228
+
xBZZ: 0.0000000000000000
229
+
xDAI: 0.009787142484816165
322
230
323
-
## Download a File
231
+
Chequebook
232
+
Available xBZZ: 0.0000000000000000
233
+
Total xBZZ: 0.0000000000000000
234
+
noah@NoahM16:~$ swarm-cli status
235
+
Bee
236
+
API: http://localhost:1633 [OK]
237
+
Version: 2.6.0-d0aa8b93
238
+
Mode: light
324
239
325
-
Use the `swarm-cli download`command with the hashfor our uploaded file to download it. We specify the output as the second argument, after the postage stamp hash, using "./" to ensure the file is downloaded into our current directory (otherwise it will create a new directory with the hash itself as the filename and the `test.txt` file we uploaded inside that directory):
This guide introduces you to Bee and Swarm, but omits advanced details for the sake of brevity.
259
+
With your node now fully synced, you're ready start [uploading and downloading](/docs/develop/access-the-swarm/upload-and-download) or start learning how to [develop on Swarm](/docs/develop/introduction).
348
260
349
-
To learn more about Bee (including other installation methods, configuration, node types, and more) read the complete***[Getting Started](/docs/bee/installation/getting-started)*** section.
0 commit comments