When the `defaultBootstrap` parameter is set to `true`, your node will be bootstrapped using the [default bootstrap method](/build/javascript/configure-discovery#default-bootstrap-method). Have a look at the [Bootstrap Nodes and Discover Peers](/build/javascript/configure-discovery) guide to learn more methods to bootstrap nodes.
In this example, users send and receive messages on a shared content topic. However, real applications may have users broadcasting messages while others listen or only have 1:1 exchanges. Waku supports all these use cases.
:::
## Listen for connection status
The Waku node will emit `health` events to help you know whether the node is connected to the network.
This can be useful to give feedback to the user, or stop some action (e.g. sending messages) when offline:
The reliable channel provides sync status events to help you understand whether the channel is fully synchronized with all participants. This is useful for showing loading states, alerting users about missing messages, or detecting permanently lost messages.
### Understanding sync states
The channel can be in one of two states:
- **`synced`**: The channel is not aware of any missing messages that can still be retrieved. Note that some messages may have been permanently lost (see `lost` in the status detail).
- **`syncing`**: The channel is aware of missing messages and is attempting to retrieve them.
### Status detail structure
Each sync status event includes a `StatusDetail` object with:
- **`received`**: Number of messages successfully received
- **`missing`**: Number of messages that are missing but may still be retrievable
- **`lost`**: Number of messages considered permanently lost (irretrievable). Messages are marked as lost when they cannot be retrieved within a time constraint.
console.log(`Syncing: ${missing} messages are being retrieved...`);
// Show loading spinner, "syncing" indicator, etc.
});
```
:::warning
When messages are marked as permanently lost, there is currently no automatic recovery mechanism available. You can inform users about the loss, but the messages cannot be retrieved. As we continue to improve the Reliable Channel feature, we may add additional recovery mechanisms in the future.
// Message acknowledged by other participants, show '✔✔' to the user, etc
}
})
```
:::tip Congratulations!
You have successfully sent and received messages over the Waku Network using our reliable protocols such as Scalable Data Sync (SDS) and P2P Reliability.