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.
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!