Module 5: Networking and API Connectivity

Teaches how to configure and test both local and external connectivity for Bee Factory nodes. Students will learn how to use command-line tools like curl to interact with the Bee APIs and verify network operations.

Once the Bee node has been funded, the chequebook deployed, and postage stamp batch store synced, its HTTP API will start listening at localhost:1633.

1.0 Check API (localhost)

  • To check everything is working as expected, send a GET request to localhost port 1633.
curl localhost:1633
  • Which should give the following output:
Ethereum Swarm Bee
  • Great! Our API is listening!

2.0 Check Number of Connected Peers

  • Next, let's see if we have connected with any peers by querying our Debug API. Note that the debug api listens at port 1635 by default (localhost:1635).
2.1 Requirements: jq
apt install jq
  • Once jq is setup, we can check the number of peers:
curl -s localhost:1635/peers | jq ".peers | length" 4
  • We get 4 because we have 4 bee nodes running within the docker. If we were on the real swarm network, this would show how many bee nodes we are connected to.

3.0 Check API External Connection

  • We can then test the same though from the internet:
curl swarmserverIP:1633 Which should output: Ethereum Swarm Bee So we are able to connect to our bee network and API externally! Its alive!

Questionnarie

You need to join society to be able to do this

- How do you check if the bee API is working locally?

- How do you check if the bee API is working externally?