Skip to content

Commit d6352f2

Browse files
committed
adds links and update bzz api, bump version
1 parent 75fca86 commit d6352f2

22 files changed

+96
-51
lines changed

docs/access-the-swarm/host-your-website.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Make sure you trust the gateway you are interacting with! To ensure that you are
4343

4444
First we will need to upload the website assets to Swarm in order to
4545
get its Swarm reference hash, see
46-
[uploading a directory](/docs/installation/upload-a-directory)
46+
[uploading a directory](/docs/access-the-swarm/upload-a-directory)
4747
for more information.
4848

4949
This time we will also include the `Swarm-Index-Document` header set to the `index.html`. This will cause Bee to serve each directories `index.html` file as default when browsing to the directory root `/` url. We will also provide a custom error page, using the `Swarm-Error-Document` header.

docs/access-the-swarm/pinning.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ There are two flavours of pinning, *local* and *global*.
2020
If a node operator wants to keep content so that it can be accessed only by local users of that node, via the [APIs](/docs/api-reference/api-reference) or Gateway, chunks can be *pinned* either during upload, or retrospectively using the Swarm reference.
2121

2222
:::caution
23-
Files pinned using local pinning will still not necessarily be available to the rest of the network. Read [global pinning](/docs/advanced/persistence#global-pinning) to find out how to keep your files available to the whole of the swarm.
23+
Files pinned using local pinning will still not necessarily be available to the rest of the network. Read [global pinning](/docs/access-the-swarm/pinning#global-pinning) to find out how to keep your files available to the whole of the swarm.
2424
:::
2525

2626
### Pin During Upload
@@ -87,7 +87,7 @@ The previous example showed how we can pin content upon upload. It is also possi
8787
To do so, we can send a `POST` request including the swarm reference to the files pinning endpoint.
8888

8989
```bash
90-
curl -XPOST http://localhost:1633/pin/files/7b344ea68c699b0eca8bb4cfb3a77eb24f5e4e8ab50d38165e0fb48368350e8f
90+
curl -XPOST http://localhost:1633/pin/7b344ea68c699b0eca8bb4cfb3a77eb24f5e4e8ab50d38165e0fb48368350e8f
9191
``
9292
9393
```json
@@ -112,7 +112,7 @@ While the pin operation will attempt to fetch content from the network if it is
112112
113113
## Global Pinning
114114
115-
[Local pinning](/docs/advanced/persistence#local-pinning) ensures that your own node does not delete uploaded files. But other nodes that store your
115+
[Local pinning](/docs/access-the-swarm/pinning#global-pinning) ensures that your own node does not delete uploaded files. But other nodes that store your
116116
chunks (because they fall within their *neighbourhood of responsibility*) may have deleted content
117117
that has not been accessed recently to make room for new chunks.
118118
@@ -137,7 +137,7 @@ bee start\
137137
Next, we pin our file locally, as shown above.
138138
139139
```bash
140-
curl -H "swarm-pin: true" --data-binary @bee.mp4 localhost:1633/files\?bee.mp4
140+
curl -H "swarm-pin: true" --data-binary @bee.mp4 localhost:1633/bzz\?bee.mp4
141141
```
142142
143143
```json
@@ -147,7 +147,7 @@ curl -H "swarm-pin: true" --data-binary @bee.mp4 localhost:1633/files\?bee.mp4
147147
Now, when we distribute links to our files, we must also specify the first two bytes of our
148148
overlay address as the *target*. If a chunk that has already been garbage collected by
149149
its storer nodes is requested, the storer node will send a message using
150-
[PSS](/docs/advanced/pss) to the Swarm neighbourhood defined by this prefix,
150+
[PSS](/docs/dapps-on-swarm/pss) to the Swarm neighbourhood defined by this prefix,
151151
of which our node is a member.
152152
153153
Let's use the addresses API endpoint to find out our target prefix.
@@ -163,7 +163,7 @@ curl -s http://localhost:1635/addresses | jq .overlay
163163
Finally, we take the first two bytes of our overlay address, `320e` and include this when referencing our chunk.
164164
165165
```bash
166-
curl http://localhost:1633/files/7b344ea68c699b0eca8bb4cfb3a77eb24f5e4e8ab50d38165e0fb48368350e8f?targets=320e
166+
curl http://localhost:1633/bzz/7b344ea68c699b0eca8bb4cfb3a77eb24f5e4e8ab50d38165e0fb48368350e8f?targets=320e
167167
```
168168
169169
Now, even if our chunks are deleted, they will be repaired in the network by our local Bee node and will always be available to the whole swarm!
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Store with Encryption
3+
id: store-with-encryption
4+
---
5+
6+
In Swarm, all data is public by default. To protect sensitive content, it must be encrypted so that only authorised users are able to decrypt and then view the plaintext content.
7+
8+
The Bee client provides a facility to encrypt files and directories while uploading which are only able to be read by users with access to the corresponding decryption key.
9+
10+
# Encrypt and Upload a File
11+
12+
To encrypt a file simply include the `Swarm-Encrypt: true` header with your HTTP request.
13+
14+
```bash
15+
curl -F file=@bee.jpg -H "Swarm-Encrypt: true" http://localhost:1633/files
16+
```
17+
18+
When successful, the Bee client will return a 64 byte reference, instead of the usual 32 bytes.
19+
20+
```json
21+
{"reference":"f7b1a45b70ee91d3dbfd98a2a692387f24db7279a9c96c447409e9205cf265baef29bf6aa294264762e33f6a18318562c86383dd8bfea2cec14fae08a8039bf3"}
22+
```
23+
24+
Here we see that, when using the Bee node's encryption function, the reference hash that is returned is 128 hex characters long. The first 64 characters of this are the familiar Swarm address - the reference that allows us to retrieve the data from the swarm - it is the same as the reference we would get uploading unencrypted files to using Bee it is safe to share.
25+
26+
The second second part of the reference is a 64 character decryption key which is required to decrypt the referenced content and view the original data in the clear, this is sensitive key material and must be kept private.
27+
28+
It is important that this data is not be sent in requests to a public gateway as this would mean that gateway would be able to decrypt your data. However, if you are running a node on your local machine, you may safely use the api bound to `localhost`. The key material is never exposed to the network so your data remains safe.
29+
30+
:::info
31+
Encryption is disabled by default on all Swarm Gateways to keep your data safe. [Install Bee on your computer](/docs/installation/quick-start) to use the encryption feature.
32+
:::
33+
34+
# Download and Decrypt a File
35+
36+
To retrieve your file, simply supply the full 64 byte string to the files endpoint, and the Bee client will download and decrypt all the relevant chunks and restore them to their original format.
37+
38+
```bash
39+
curl -OJ http://localhost:1633/files/f7b1a45b70ee91d3dbfd98a2a692387f24db7279a9c96c447409e9205cf265baef29bf6aa294264762e33f6a18318562c86383dd8bfea2cec14fae08a8039bf3
40+
```
41+
42+
:::danger
43+
Never use public gateways when requesting full encrypted references, the hash contains sensitive key information which should be kept private. Run [your own node](/docs/installation/quick-start) to get to use Bee's encryption features.
44+
:::

docs/access-the-swarm/upload-a-directory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Other files are served at their relative paths, e.g.
7676

7777
[http://localhost:1633/bzz/b25c89a...214917b/assets/style.css](http://localhost:1633/bzz/b25c89a401d9f26811680476619a1eb4a4e189e614bc6161cbfd8b343214917b/assets/style.css)
7878

79-
Once your data has been [fully processed into the network](/docs/advanced/tags), you will then be able to retrieve it from any Bee node.
79+
Once your data has been [fully processed into the network](/docs/access-the-swarm/syncing), you will then be able to retrieve it from any Bee node.
8080

8181
[https://gateway.ethswarm.org/bzz/b25c89a...214917b/index.html](https://gateway.ethswarm.org/bzz/b25c89a401d9f26811680476619a1eb4a4e189e614bc6161cbfd8b343214917b/)
8282

docs/access-the-swarm/upload-and-download.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ Once running, a file can be uploaded by making an HTTP POST request to the `file
3939
Here, you must specify your *batch id* in the Swarm-Postage-Batch-Id header as follows.
4040

4141
```bash
42-
curl -H "Swarm-Postage-Batch-Id: 78a26be9b42317fe6f0cbea3e47cbd0cf34f533db4e9c91cf92be40eb2968264" -F file=@bee.jpg http://localhost:1633/files
42+
curl -H "Swarm-Postage-Batch-Id: 78a26be9b42317fe6f0cbea3e47cbd0cf34f533db4e9c91cf92be40eb2968264" -F file=@bee.jpg http://localhost:1633/bzz
4343
```
4444

4545
We may also pass the appropriate mime type in the `Content-Type` header, and a file name to the `name` query parameter so that the file will be correctly handled by web browsers and other applications.
4646

4747
```bash
48-
curl --data-binary @bee.jpg -H "Swarm-Postage-Batch-Id: 78a26be9b42317fe6f0cbea3e47cbd0cf34f533db4e9c91cf92be40eb2968264" -H "Content-Type: video/jpg" "http://localhost:1633/files?name=bee.jpg"
48+
curl --data-binary @bee.jpg -H "Swarm-Postage-Batch-Id: 78a26be9b42317fe6f0cbea3e47cbd0cf34f533db4e9c91cf92be40eb2968264" -H "Content-Type: video/jpg" "http://localhost:1633/bzz?name=bee.jpg"
4949
```
5050

5151
:::danger
52-
Data uploaded to the swarm is always public. In Swarm, sensitive files must be [encrypted](/docs/installation/store-with-encryption) before uploading to ensure their contents always remains private.
52+
Data uploaded to the swarm is always public. In Swarm, sensitive files must be [encrypted](/docs/access-the-swarm/store-with-encryption) before uploading to ensure their contents always remains private.
5353
:::
5454

5555
When succesful, a json formatted response will be returned, containing a **swarm reference** or **hash** which is the *address* of the uploaded file, for example:
@@ -62,7 +62,7 @@ Keep this *address* safe, as we'll use it to retrieve our content later on.
6262
In Swarm, every piece of data has a unique *address* which is a unique and reproducible cryptographic hash digest. If you upload the same file twice, you will always receive the same hash. This makes working with data in Swarm super secure!
6363

6464
:::info
65-
If you are uploading a large file it is useful to track the status of your upload as it is processed into the network. Head over to the advanced usage section to learn how to [follow the status of your upload](/docs/advanced/tags).
65+
If you are uploading a large file it is useful to track the status of your upload as it is processed into the network. Head over to the advanced usage section to learn how to [follow the status of your upload](/docs/access-the-swarm/syncing).
6666

6767
Once your file has been **completely synced with the network**, you will be able to turn off your computer and other nodes will take over to serve the data for you!
6868
:::
@@ -74,17 +74,17 @@ Once your file is uploaded into Swarm, it can be retrieved with a simple HTTP GE
7474
Substitute the *hash* in the last part of the url to be the reference to your own data.
7575

7676
```bash
77-
curl -OJ http://localhost:1633/files/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4
77+
curl -OJ http://localhost:1633/bzz/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4
7878
```
7979

8080
You may even simply navigate to the URL in your browser:
8181

82-
[http://localhost:1633/files/042d4fe...2291dd4](http://localhost:1633/files/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4)
82+
[http://localhost:1633/bzz/042d4fe...2291dd4](http://localhost:1633/bzz/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4)
8383

8484
## Public Gateways
8585

8686
To share files with someone who isn't running a Bee node yet, simply change the host in the link to be one of our public gateways. Send the link to your friends, and they will be able to download the file too!
8787

88-
[https://gateway.ethswarm.org/files/042d4fe...2291dd4](https://gateway.ethswarm.org/files/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4)
88+
[https://gateway.ethswarm.org/bzz/042d4fe...2291dd4](https://gateway.ethswarm.org/bzzd/042d4fe94b946e2cb51196a8c136b8cc335156525bf1ad7e86356c2402291dd4)
8989

9090
<!-- If you are unable to download your file from a different Bee node, you may be experiencing connection issues, see [troubleshooting connectivity](/docs/troubleshooting/connectivitiy) for assistance. -->

docs/api-reference/api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Detailed information about Bee API endpoint can be found here:
2121
The debug-API is disabled by default but be enabled by setting the `enable-debug-api` configuration option to `true`. The debug-API exposes functionality to inspect the state of your Bee node while it is running, as well as some other features that should not be exposed to the public internet. The Debug API runs on port `:1635` by default.
2222

2323
:::info
24-
For a new installation of Bee, the debug API endpoint is not yet exposed for security reasons. To enable the debug API endpoints, set `debug-api-enable` to `true` in your [configuration file](/docs/installation/configuration#configuring-bee-installed-using-a-package-manager) and restart your Bee service.
24+
For a new installation of Bee, the debug API endpoint is not yet exposed for security reasons. To enable the debug API endpoints, set `debug-api-enable` to `true` in your [configuration file](/docs/working-with-bee/configuration) and restart your Bee service.
2525
:::
2626

2727
- <a href="/debug-api" target="_blank" rel="noopener noreferrer">Debug API reference.</a>,

docs/bee-developers/starting-a-test-network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Starting a Test Network
33
id: starting-a-test-network
44
---
55

6-
A test network can be used to test your applications in an isolated environment before you deploy to Swarm mainnet. It can be started by overriding the default configuration values of your Swarm node. Throughout this tutorial, we will make use of configuration files to configure the nodes but of course you can also do the same using flags or environment variables (see [Start your node](/docs/installation/configuration)).
6+
A test network can be used to test your applications in an isolated environment before you deploy to Swarm mainnet. It can be started by overriding the default configuration values of your Swarm node. Throughout this tutorial, we will make use of configuration files to configure the nodes but of course you can also do the same using flags or environment variables (see [Start your node](/docs/working-with-bee/configuration)).
77

88
## Start a network on your own computer
99
### Configuration

docs/bee-developers/useful-dev-info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Developers can gain an additional level of insight into the node by enabling `tr
4949
- Start jaeger:
5050
`docker run -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:latest`
5151

52-
- start locally two bee nodes (different data dirs and ports) and connect them (see "Start a test network" in the [advanced section](/docs/advanced/starting-a-test-network)) with `--tracing` flag provided for both nodes
52+
- start locally two bee nodes (different data dirs and ports) and connect them (see "Start a test network" in the [advanced section](/docs/bee-developers/starting-a-test-network)) with `--tracing` flag provided for both nodes
5353

5454
- Make a call to the PingPong API on one of the two nodes (`curl -XPOST localhost:1735/pingpong/<overlay address other node>`).
5555

docs/dapps-on-swarm/bee-js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ id: bee-js
55

66
Bee-js is Bee's complementary javascript library. It is the technology underpinning the [swarm-cli](/docs/working-with-bee/bee-tools) and [bee-dashboard](/docs/working-with-bee/bee-tools) tools and is a powerful tool for building completely decentralised apps.
77

8-
For more information on how to develop with Bee without blowing all your gBZZ, read [this guide](/docs/dapps-on-swarm/develop-on-swarm)
8+
For more information on how to develop with Bee without blowing all your gBZZ, read [this guide](/docs/dapps-on-swarm/develop-on-bee)
99

1010
See the [bee-js](https://bee-js.ethswarm.org/) documentation for detailed information on using and installing the library.
1111

docs/dapps-on-swarm/feeds.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ id: feeds
66
Swarm feeds cleverly combine [single owner chunks](/docs/dapps-on-swarm/chunk-types) into a data structure which enables you to have static addresses for your mutable content. This means that you can signpost your data for other Bees, and then update at will.
77

88
:::info
9-
Although it's possible to interact with feeds directly, it can be involve a little data juggling and crypto magic. For the easiest route, see [the bee-js feeds functionality](/docs/dapps-on-swarm/bee-js) and [swarm-cli](/docs/using-swarm/bee-tools), or for the super 1337, share your implementations in other languages in the [#develop-on-swarm](https://discord.gg/C6dgqpxZkU) channel of our [Discord Server](https://discord.gg/wdghaQsGq5).
9+
Although it's possible to interact with feeds directly, it can be involve a little data juggling and crypto magic. For the easiest route, see [the bee-js feeds functionality](/docs/dapps-on-swarm/bee-js) and [swarm-cli](/docs/working-with-bee/bee-tools), or for the super 1337, share your implementations in other languages in the [#develop-on-swarm](https://discord.gg/C6dgqpxZkU) channel of our [Discord Server](https://discord.gg/wdghaQsGq5).
1010
:::
1111

1212
### What are Feeds?
@@ -15,7 +15,7 @@ A feed is a collection of Single Owner Chunks with predicatable addresses. This
1515

1616
### Creating and Updating a Feed
1717

18-
In order to edit a feed, you will need to sign your chunks using an Ethereum keypair. For the intrepid, check out the [The Book of Swarm](https://gateway.ethswarm.org/bzz/latest.bookofswarm.eth/) on precise details on how to do this. For the rest of us, both [bee-js](/docs/dapps-on-swarm/bee-js) and [swarm-cli](/docs/using-swarm/bee-tools) provide facilities to achieve this using javascript and a node-js powered command line tool respectively.
18+
In order to edit a feed, you will need to sign your chunks using an Ethereum keypair. For the intrepid, check out the [The Book of Swarm](https://gateway.ethswarm.org/bzz/latest.bookofswarm.eth/) on precise details on how to do this. For the rest of us, both [bee-js](/docs/dapps-on-swarm/bee-js) and [swarm-cli](/docs/working-with-bee/bee-tools) provide facilities to achieve this using javascript and a node-js powered command line tool respectively.
1919

2020
### No More ENS Transaction Charges
2121

@@ -31,4 +31,4 @@ Use [bee-js](/docs/dapps-on-swarm/bee-js) to use feeds to store values as a simp
3131

3232
#### Store the History of a File
3333

34-
Use [swarm-cli](/docs/using-swarm/bee-tools) to store a file at the same location, and update whenever you like without changing the address.
34+
Use [swarm-cli](/docs/working-with-bee/bee-tools) to store a file at the same location, and update whenever you like without changing the address.

0 commit comments

Comments
 (0)