• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MinaProtocol / mina / 3577

04 Apr 2025 08:06AM UTC coverage: 62.252% (+1.5%) from 60.78%
3577

push

buildkite

web-flow
Merge pull request #16847 from MinaProtocol/dkijania/sync/steps_port_dev

[CI][Dev] port sync steps

49172 of 78989 relevant lines covered (62.25%)

483194.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

5.0
/src/lib/cli_lib/background_daemon.ml
1
open Core
11✔
2
open Async
3

4
type state = Start | Run_client | Abort | No_daemon
5

6
let does_daemon_exist host_and_port =
7
  let open Deferred.Let_syntax in
×
8
  let%map result =
9
    Rpc.Connection.client (Tcp.Where_to_connect.of_host_and_port host_and_port)
×
10
  in
11
  Result.is_ok result
×
12

13
let run ~f (t : Host_and_port.t Flag.Types.with_name) arg =
14
  let rec go = function
×
15
    | Start ->
×
16
        let%bind has_daemon = does_daemon_exist t.value in
×
17
        if has_daemon then go Run_client else go No_daemon
×
18
    | No_daemon ->
×
19
        Print.printf
20
          !"Error: Unable to connect to Mina daemon.\n\
×
21
            - The daemon might not be running. See logs (in \
22
            `~/.mina-config/mina.log`) for details under the host:%s.\n\
23
           \  Run `mina daemon -help` to see how to start daemon.\n\
24
            - If you just started the daemon, wait a minute for the RPC server \
25
            to start.\n\
26
            - Alternatively, the daemon may not be running the RPC server on \
27
            %{sexp:Host_and_port.t}.\n\
28
           \  If so, add flag `-%s` with correct port when running this command.\n"
29
          (Host_and_port.host t.value)
×
30
          t.value t.name ;
31
        go Abort
×
32
    | Run_client ->
×
33
        f t.value arg
34
    | Abort ->
×
35
        exit 15
36
  in
37
  go Start
38

39
let rpc_init ~f arg_flag =
40
  let open Command.Param.Applicative_infix in
×
41
  Command.Param.return (fun port arg () -> run ~f port arg)
×
42
  <*> Flag.Host_and_port.Client.daemon <*> arg_flag
×
43

44
let graphql_init ~f arg_flag =
45
  let open Command.Param.Applicative_infix in
×
46
  Command.Param.return (fun rest_uri arg () -> f rest_uri arg)
×
47
  <*> Flag.Uri.Client.rest_graphql <*> arg_flag
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc