7Here's an example of a thread that scries ames for the IP address & port of a ship and nicely prints it:
14=, strand=strand:spider
15=, strand-fail=strand-fail:libstrand:spider
18 |= [target=@p lanes=(list lane:ames)]
21 ?~ `(list lane:ames)`lanes
22 %- (slog leaf+"No route for {(scow %p target)}." ~)
24 =/ lroute (skip lanes |=(a=lane:ames -.a))
26 %- (slog leaf+"No direct route for {(scow %p target)}." ~)
28 =/ ip +:(scow %if p.i.lroute)
29 =/ port (skip (scow %ud (cut 5 [1 1] p.i.lroute)) |=(a=@tD =(a '.')))
30 %- (slog leaf+"{ip}:{port}" ~)
37=/ utarget !< (unit @p) arg
39 (strand-fail %no-arg ~)
41;< lanes=(list lane:ames) bind:m (scry:strandio (list lane:ames) /ax//peers/(scot %p target)/forward-lane)
42;< ~ bind:m (process-lanes target lanes)
46**Note:** Pretty useless on a fake ship.
48Save as `ted/get-ip.hoon` in the `%base` desk, `|commit %base`, and run it with `-get-ip ~bitbet-bolbel`. You should see something like:
56Here we use the `strandio` function `scry` which takes an argument of `[mold path]` where:
58- `mold` is the return type of the scry
59- `path` is the scry path formatted like:
60 1. vane letter and care
61 2. desk if scrying arvo or agent if scrying a gall agent
64In our case the mold is `(list lane:ames)` and the path is `/ax//peers/(scot %p target)/forward-lane` like:
67;< lanes=(list lane:ames) bind:m (scry:strandio (list lane:ames) /ax//peers/(scot %p target)/forward-lane)
70After that we just process the result in `++ process-lanes` and print it.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list