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
Binary file added docs.zip
Binary file not shown.
59 changes: 56 additions & 3 deletions docs/bee/installation/connectivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ you still have problems, please join us in our [Discord
server](https://discord.gg/wdghaQsGq5) and we'll help you find the
way! 🐝 🐝 🐝 🐝 🐝

:::info
:::warning
To ensure your Bee has the best chance of participating in the swarm,
you must ensure your Bee is able to handle **both incoming and
outgoing connections from the global Internet to its p2p port
Expand All @@ -31,6 +31,8 @@ Internet! You may need to alter your Bee node's `nat-addr`
configuration. 🤓
:::



## Networking Basics

In a network, each computer is assigned an IP address. Each IP address
Expand Down Expand Up @@ -298,7 +300,58 @@ to your computer's MAC address. This will ensure that your Bee
seamlessly connects when you rejoin the network!
:::

### Debugging Connectivity
### Using multiple P2P transports (TCP, WS, WSS)

A Bee node can expose more than one transport for peer-to-peer communication. By default, nodes use the TCP-based libp2p transport, but Secure WebSocket (`WSS`) transport can also be enabled.

To enable WSS support, set:

```yaml
p2p-wss-enable: true
````

When enabled, Bee listens for Secure WebSocket connections on `p2p-wss-addr` (default `:1635`). In most cases the remaining WSS and AutoTLS options can be left at their default values:

```yaml
p2p-wss-addr: ":1635"
nat-wss-addr: ""

autotls-domain: libp2p.direct
autotls-registration-endpoint: https://registration.libp2p.direct
autotls-ca-endpoint: https://acme-v02.api.letsencrypt.org/directory
```

A configuration using both TCP and WSS transports may look like:

```yaml
p2p-addr: :1634
p2p-wss-enable: true
p2p-wss-addr: :1635

nat-addr: 1.2.3.4:1634
nat-wss-addr: node.example.com:443
```

In this example:

* `p2p-addr` defines the local TCP listening address.
* `p2p-wss-addr` defines the local Secure WebSocket listening address.
* `nat-addr` is the public address advertised to peers for TCP connections.
* `nat-wss-addr` is the public address advertised to peers for WSS connections.

If WSS is enabled, the WSS port must be reachable by peers. This means the port should be open in your firewall, exposed by your container or host configuration, and permitted by your network if outbound connections are restricted.

When specifying `nat-addr` or `nat-wss-addr`, the value must be a valid `host:port` pair. For example:

```yaml
nat-addr: 1.2.3.4:1634
nat-wss-addr: node.example.com:443
```

Values missing either the host or port or otherwise misformed addresses are considered invalid and will prevent the node from starting.


### Troubleshooting Connectivity

The above guide navigates your NAT, but there are still a few hurdles to overcome. To make sure there is a clear path from your computer to the outside world, let's follow our Bee's journey from the inside out.

Expand Down Expand Up @@ -379,7 +432,7 @@ the open Internet. Ensure that both TCP and UDP traffic are allowed.

Similarly, if you are connecting from within a private network, you
may find that the port is blocked by the router. Each router is
different, so consult your router's firware documentation to make
different, so consult your router's firmware documentation to make
sure there are no firewalls in place blocking traffic on your Bee's
designated p2p port.

Expand Down
5 changes: 3 additions & 2 deletions docs/bee/working-with-bee/bee-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,16 @@ From the results we can see that our node's neighborhood size and batch commitme
{
"radius": 15,
"storageRadius": 10,
"commitment": 134121783296
"commitment": 134121783296,
"reserveCapacityDoubling": 0
}
```

Let's take a look at each of these values:
* `"radius"` - Represents the maximum storage radius assuming all postage stamp batches are fully utilized.
* `"storageRadius"` - The radius of responsibility - the proximity order of chunks for which your node is responsible for storing. It should generally match the radius shown on [Swarmscan](https://swarmscan.io/neighborhoods).
* `"commitment"` - The total number of chunks which would be stored on the Swarm network if 100% of all postage batches were fully utilised.

* `"reserveCapacityDoubling"` - Indicates whether your node is currently using the reserve doubling mechanism. See [Reserve Doubling](/docs/bee/working-with-bee/staking#reserve-doubling) for details.
### _/chainstate_

This endpoint relates to your node's interactions with the Swarm Smart contracts on the Gnosis Chain.
Expand Down
42 changes: 33 additions & 9 deletions docs/bee/working-with-bee/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ However when Bee is started as a service with tools like `systemctl` or `brew se

### Command Line Arguments

Run `bee start --help` in your terminal to list the available command-line arguments:
Run `bee help printconfig` in your terminal to list the available command-line arguments and config option flags:

```bash
Ethereum Swarm Bee
Expand All @@ -34,7 +34,7 @@ Usage:

Available Commands:
start Start a Swarm node
dev Start a Swarm node in development mode
dev Start in dev mode. WARNING: This command will be deprecated soon.
init Initialise a Swarm node
deploy Deploy and fund the chequebook contract
version Print version number
Expand All @@ -49,15 +49,18 @@ Flags:
-h, --help help for bee

Use "bee [command] --help" for more information about a command.
root@noah-bee:~# docker exec bee-1 bee start --help
Start a Swarm node
root@noah-bee:~# docker exec -it bee-1 bee help printconfig
Print default or provided configuration in yaml format

Usage:
bee start [flags]
bee printconfig [flags]

Flags:
--allow-private-cidrs allow to advertise private CIDRs to the public network
--api-addr string HTTP API listen address (default "127.0.0.1:1633")
--autotls-ca-endpoint string autotls certificate authority endpoint (default "https://acme-v02.api.letsencrypt.org/directory")
--autotls-domain string autotls domain (default "libp2p.direct")
--autotls-registration-endpoint string autotls registration endpoint (default "https://registration.libp2p.direct")
--block-time uint chain block time (default 5)
--blockchain-rpc-endpoint string rpc blockchain endpoint
--bootnode strings initial nodes to connect to (default [/dnsaddr/mainnet.ethswarm.org])
Expand All @@ -72,14 +75,18 @@ Flags:
--db-open-files-limit uint number of open files allowed by database (default 200)
--db-write-buffer-size uint size of the database write buffer in bytes (default 33554432)
--full-node cause the node to start in full mode
-h, --help help for start
-h, --help help for printconfig
--mainnet triggers connect to main net bootnodes. (default true)
--minimum-gas-tip-cap uint minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
--minimum-storage-radius uint minimum radius storage threshold
--nat-addr string NAT exposed address
--nat-wss-addr string WSS NAT exposed address
--neighborhood-suggester string suggester for target neighborhood (default "https://api.swarmscan.io/v1/network/neighborhoods/suggestion")
--network-id uint ID of the Swarm network (default 1)
--p2p-addr string P2P listen address (default ":1634")
--p2p-ws-enable enable P2P WebSocket transport
--p2p-wss-addr string p2p wss address (default ":1635")
--p2p-wss-enable Enable Secure WebSocket P2P connections
--password string password for decrypting keys
--password-file string path to a file that contains password for decrypting keys
--payment-early-percent int percentage below the peers payment threshold when we initiate settlement (default 50)
Expand Down Expand Up @@ -148,11 +155,17 @@ bee printconfig
# allow to advertise private CIDRs to the public network
allow-private-cidrs: false
# HTTP API listen address
api-addr: :1633
api-addr: 0.0.0.0:1633
# autotls certificate authority endpoint
autotls-ca-endpoint: https://acme-v02.api.letsencrypt.org/directory
# autotls domain
autotls-domain: libp2p.direct
# autotls registration endpoint
autotls-registration-endpoint: https://registration.libp2p.direct
# chain block time
block-time: "5"
# rpc blockchain endpoint
blockchain-rpc-endpoint: https://xdai.fairdatasociety.org
blockchain-rpc-endpoint: https://rpc.gnosischain.com
# initial nodes to connect to
bootnode:
- /dnsaddr/mainnet.ethswarm.org
Expand Down Expand Up @@ -184,10 +197,14 @@ full-node: "true"
help: false
# triggers connect to main net bootnodes.
mainnet: "true"
# minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
minimum-gas-tip-cap: "0"
# minimum radius storage threshold
minimum-storage-radius: "0"
# NAT exposed address
nat-addr: ""
# WSS NAT exposed address
nat-wss-addr: ""
# suggester for target neighborhood
neighborhood-suggester: https://api.swarmscan.io/v1/network/neighborhoods/suggestion
# ID of the Swarm network
Expand All @@ -196,6 +213,10 @@ network-id: "1"
p2p-addr: :1634
# enable P2P WebSocket transport
p2p-ws-enable: false
# p2p wss address
p2p-wss-addr: :1635
# Enable Secure WebSocket P2P connections
p2p-wss-enable: false
# password for decrypting keys
password: 427067e9514e93613b861fef5561c6
# path to a file that contains password for decrypting keys
Expand All @@ -219,7 +240,7 @@ price-oracle-address: ""
# redistribution contract address
redistribution-address: ""
# reserve capacity doubling
reserve-capacity-doubling: "1"
reserve-capacity-doubling: "0"
# ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url
resolver-options: []
# forces the node to resync postage contract data
Expand Down Expand Up @@ -583,6 +604,9 @@ Then configure your node, including your p2p port (default 1634).
nat-addr: "123.123.123.123:1634"
```

Ensure `nat-addr` and `nat-wss-addr` if used are set to valid `host:port` values — invalid values prevent the node from starting.


## ENS Resolution (Optional)

The [ENS](https://ens.domains/) domain resolution system is used to host websites on Bee, and in order to use this your Bee must be connected to a mainnet Ethereum blockchain node. We recommend you run your own ethereum node. An option for resource restricted devices is geth+nimbus and a guide can be found [here](https://ethereum-on-arm-documentation.readthedocs.io/en/latest/). Other options include [dappnode](https://dappnode.io/), [nicenode](https://www.nicenode.xyz/), [stereum](https://stereum.net/) and [avado](https://ava.do/).
Expand Down
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading