From f5a61b61abed8f3f963a72ea0c659c2b473dede2 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 22 Mar 2023 22:54:43 +0100 Subject: [PATCH] refactor: cleanup daemon stdout - removed (readonly) from gateway (less confusing that having that and Gateway.NoFetch:true at the same time) - RPC API instead of plain API --- cmd/ipfs/daemon.go | 2 +- core/corehttp/corehttp.go | 2 +- test/cli/gateway_test.go | 2 +- test/sharness/lib/test-lib.sh | 2 +- test/sharness/t0060-daemon.sh | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 9f4377aa256..85ca79246cb 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -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": diff --git a/core/corehttp/corehttp.go b/core/corehttp/corehttp.go index fe9f1b1dba5..b1a317f3c2a 100644 --- a/core/corehttp/corehttp.go +++ b/core/corehttp/corehttp.go @@ -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...) } diff --git a/test/cli/gateway_test.go b/test/cli/gateway_test.go index 4c40729c708..1d6ac45b965 100644 --- a/test/cli/gateway_test.go +++ b/test/cli/gateway_test.go @@ -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.+)\s`) + r := regexp.MustCompile(`Gateway server listening on (?P.+)\s`) matches := r.FindStringSubmatch(node.Daemon.Stdout.String()) ma, err := multiaddr.NewMultiaddr(matches[1]) require.NoError(t, err) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 8b57fb1a1bd..1f1491f9ebf 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -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) ' diff --git a/test/sharness/t0060-daemon.sh b/test/sharness/t0060-daemon.sh index b237e143f66..f43708b1df5 100755 --- a/test/sharness/t0060-daemon.sh +++ b/test/sharness/t0060-daemon.sh @@ -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 '