Skip to content

Commit

Permalink
refactor: cleanup daemon stdout
Browse files Browse the repository at this point in the history
- removed (readonly) from gateway (less confusing that having that and
  Gateway.NoFetch:true at the same time)
- RPC API instead of plain API
  • Loading branch information
lidel authored and hacdias committed Mar 27, 2023
1 parent fc48ae7 commit f5a61b6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error

for _, listener := range listeners {
// we might have listened to /tcp/0 - let's see what we are listing on
fmt.Printf("API server listening on %s\n", listener.Multiaddr())
fmt.Printf("RPC API server listening on %s\n", listener.Multiaddr())
// Browsers require TCP.
switch listener.Addr().Network() {
case "tcp", "tcp4", "tcp6":
Expand Down
2 changes: 1 addition & 1 deletion core/corehttp/corehttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func ListenAndServe(n *core.IpfsNode, listeningMultiAddr string, options ...Serv

// we might have listened to /tcp/0 - let's see what we are listing on
addr = list.Multiaddr()
fmt.Printf("API server listening on %s\n", addr)
fmt.Printf("RPC API server listening on %s\n", addr)

return Serve(n, manet.NetListener(list), options...)
}
Expand Down
2 changes: 1 addition & 1 deletion test/cli/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func TestGateway(t *testing.T) {

t.Run("verify gateway file", func(t *testing.T) {
t.Parallel()
r := regexp.MustCompile(`Gateway \(readonly\) server listening on (?P<addr>.+)\s`)
r := regexp.MustCompile(`Gateway server listening on (?P<addr>.+)\s`)
matches := r.FindStringSubmatch(node.Daemon.Stdout.String())
ma, err := multiaddr.NewMultiaddr(matches[1])
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ test_set_address_vars() {
API_ADDR=$(convert_tcp_maddr $API_MADDR) &&
API_PORT=$(port_from_maddr $API_MADDR) &&
GWAY_MADDR=$(sed -n "s/^Gateway (.*) server listening on //p" "$daemon_output") &&
GWAY_MADDR=$(sed -n "s/^Gateway server listening on //p" "$daemon_output") &&
GWAY_ADDR=$(convert_tcp_maddr $GWAY_MADDR) &&
GWAY_PORT=$(port_from_maddr $GWAY_MADDR)
'
Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0060-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ test_expect_success "ipfs daemon output looks good" '
echo "" >>expected_daemon &&
sed "s/^/Swarm listening on /" listen_addrs >>expected_daemon &&
sed "s/^/Swarm announcing /" local_addrs >>expected_daemon &&
echo "API server listening on '$API_MADDR'" >>expected_daemon &&
echo "RPC API server listening on '$API_MADDR'" >>expected_daemon &&
echo "WebUI: http://'$API_ADDR'/webui" >>expected_daemon &&
echo "Gateway (readonly) server listening on '$GWAY_MADDR'" >>expected_daemon &&
echo "Gateway server listening on '$GWAY_MADDR'" >>expected_daemon &&
echo "Daemon is ready" >>expected_daemon &&
test_cmp expected_daemon actual_daemon
'
Expand Down

0 comments on commit f5a61b6

Please sign in to comment.