-
Notifications
You must be signed in to change notification settings - Fork 57
Aquarium and pH #1120
Aquarium and pH #1120
Changes from all commits
fc9cae6
fe02c76
0757005
88579c5
c6cf690
6138daf
54a6187
ea27465
fd5df26
81e8c59
da5515b
1cfea70
39ce138
705a531
1a87a5c
64b1176
462f027
0fc7ab1
da12f04
17cea6a
600dc02
11adf30
3336699
42d5c90
6337c91
7f8e3da
c3faca0
c4f3614
ad4750f
3e1d742
99b6111
e319df9
3f74d30
e22eac6
55b708d
1ab6fea
68d3ebd
186984f
dab83cd
ae8966e
1e1bcfa
e261983
187aff9
c2c2b04
1893443
3d64641
aba5339
4fc3f63
0dc6e69
e8c7c16
7edcbf7
b5414a4
154a726
8ebe809
3fcd17b
19cb571
98ef8fa
da883a5
04b71f2
73febd4
3c92eb5
7590a4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Arvo | ||
|
||
A clean-slate operating system. | ||
|
||
## Usage | ||
|
||
To run Arvo, you'll need [Urbit](https://github.com/urbit/urbit/). To install Urbit and run Arvo please follow the instructions in the [getting started docs](https://urbit.org/docs/getting-started/). You'll be on the live network in a few minutes. | ||
|
||
If you're doing development on Arvo, keep reading. | ||
|
||
## Documentation | ||
|
||
Find Arvo's documentation [on urbit.org](https://urbit.org/docs/learn/arvo/). | ||
|
||
## Development | ||
|
||
To boot a fake ship from your development files, run `urbit` with the following arguments: | ||
|
||
``` | ||
urbit -F zod -A /path/to/arvo -c fakezod | ||
``` | ||
|
||
Mount Arvo's filesystem allows you to update its contents through Unix. To do so, run `|mount` in dojo. It is most common to `|mount /=home=`. | ||
|
||
To create a custom pill (bootstrapping object) from the files loaded into the home desk, run `.my/pill +solid`. Your pill will appear in `/path/to/fakezod/.urb/put/my.pill`. | ||
|
||
To boot a fake ship with a custom pill, use the `-B` flag: | ||
|
||
``` | ||
urbit -F zod -A /path/to/arvo -B /path/to.pill -c fakezod | ||
``` | ||
|
||
To run all tests in `/tests`, run `+test` in dojo. `+test /some/path` would only run all tests in `/tests/some/path`. | ||
|
||
## Contributing | ||
|
||
Contributions of any form are more than welcome! If something doesn't seem right, and there is no issue about it yet, feel free to open one. | ||
|
||
If you're looking to make code contributions, a good place to start might be the [good contributor issues](https://github.com/urbit/arvo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+contributor+issue%22). | ||
|
||
## Maintainers | ||
|
||
Most parts of Arvo have dedicated maintainers. | ||
|
||
* `/sys/hoon`: @pilfer-pandex (~pilfer-pandex) | ||
* `/sys/zuse`: @pilfer-pandex (~pilfer-pandex) | ||
* `/sys/arvo`: @jtobin (~nidsut-tomdun) | ||
* `/sys/vane/ames`: @belisarius222 (~rovnys-ricfer) & @joemfb (~master-morzod) | ||
* `/sys/vane/behn`: @belisarius222 (~rovnys-ricfer) | ||
* `/sys/vane/clay`: @philipcmonk (~wicdev-wisryt) | ||
* `/sys/vane/dill`: @bernardodelaplaz (~rigdyn-sondur) | ||
* `/sys/vane/eyre`: @eglaysher (~littel-ponnys) | ||
* `/sys/vane/ford`: @belisarius222 (~rovnys-ricfer) & @eglaysher (~littel-ponnys) | ||
* `/sys/vane/gall`: @jtobin (~nidsut-tomdun) | ||
* `/sys/vane/jael`: @fang- (~palfun-foslup) & @joemfb (~master-morzod) | ||
* `/app/acme`: @joemfb (~master-morzod) | ||
* `/app/dns`: @joemfb (~master-morzod) | ||
* `/app/hall`: @fang- (~palfun-foslup) | ||
* `/app/talk`: @fang- (~palfun-foslup) | ||
* `/lib/test`: @eglaysher (~littel-ponnys) | ||
|
||
## Contact | ||
|
||
We are using our new UI, Landscape, to run a few experimental cities. If you have an Azimuth point, please send us your planet name at [[email protected]](mailto:[email protected]) to request access. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
:: This needs a better SDN solution. Every ship should have an IP | ||
:: address, and we should eventually test changing those IP | ||
:: addresses. | ||
:: | ||
:: For now, we broadcast every packet to every ship and rely on them | ||
:: to drop them. | ||
:: | ||
/- aquarium | ||
=, aquarium | ||
=> |% | ||
+$ move (pair bone card) | ||
+$ card | ||
$% [%poke wire dock %aqua-events (list aqua-event)] | ||
[%peer wire dock path] | ||
[%pull wire dock ~] | ||
== | ||
:: | ||
+$ state | ||
$: %0 | ||
subscribed=_| | ||
== | ||
-- | ||
=, gall | ||
=| moves=(list move) | ||
=| aqua-event-list=(list aqua-event) | ||
=| ships=(list ship) | ||
|_ $: bowl | ||
state | ||
== | ||
++ this . | ||
++ apex %_(this moves ~, aqua-event-list ~, ships ~) | ||
++ abet | ||
=? this !=(~ aqua-event-list) | ||
%- emit-moves | ||
[ost %poke /aqua-events [our %aqua] %aqua-events aqua-event-list]~ | ||
:: ~? !?=(~ moves) [%aqua-ames-moves (lent moves)] | ||
[moves this] | ||
:: | ||
++ emit-moves | ||
|= ms=(list move) | ||
%_(this moves (weld moves ms)) | ||
:: | ||
++ emit-aqua-events | ||
|= aes=(list aqua-event) | ||
%_(this aqua-event-list (weld aqua-event-list aes)) | ||
:: | ||
++ poke-aqua-vane-control | ||
|= command=?(%subscribe %unsubscribe) | ||
:_ this(subscribed =(command %subscribe)) | ||
(aqua-vane-control-handler our ost subscribed command) | ||
:: | ||
:: Handle effects from ships. We only react to %send effects. | ||
:: | ||
++ diff-aqua-effects | ||
|= [way=wire afs=aqua-effects] | ||
^- (quip move _this) | ||
=. this apex =< abet | ||
|- ^+ this | ||
?~ ufs.afs | ||
this | ||
=. this | ||
?+ -.q.i.ufs.afs this | ||
%restore (handle-restore who.afs) | ||
%send (handle-send i.ufs.afs) | ||
== | ||
$(ufs.afs t.ufs.afs) | ||
:: | ||
++ handle-restore | ||
|= who=@p | ||
%- emit-aqua-events | ||
[%event who [//newt/0v1n.2m9vh %barn ~]]~ | ||
:: | ||
++ handle-send | ||
|= [way=wire %send lan=lane:ames pac=@] | ||
^+ this | ||
=/ hear [//newt/0v1n.2m9vh %hear lan pac] | ||
=? ships =(~ ships) | ||
.^((list ship) %gx /(scot %p our)/aqua/(scot %da now)/ships/noun) | ||
%- emit-aqua-events | ||
%+ turn ships | ||
|= who=ship | ||
[%event who hear] | ||
-- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/- aquarium | ||
=, aquarium | ||
=> |% | ||
+$ move (pair bone card) | ||
+$ card | ||
$% [%poke wire dock %aqua-events (list aqua-event)] | ||
[%peer wire dock path] | ||
[%pull wire dock ~] | ||
[%wait wire p=@da] | ||
[%rest wire p=@da] | ||
== | ||
:: | ||
+$ state | ||
$: %0 | ||
subscribed=_| | ||
piers=(map ship pier) | ||
== | ||
:: | ||
+$ pier next-timer=(unit @da) | ||
-- | ||
=, gall | ||
=| moves=(list move) | ||
|_ $: bowl | ||
state | ||
== | ||
++ this . | ||
++ apex %_(this moves ~) | ||
++ abet [(flop moves) this] | ||
++ emit-moves | ||
|= ms=(list move) | ||
%_(this moves (weld ms moves)) | ||
:: | ||
++ emit-aqua-events | ||
|= aes=(list aqua-event) | ||
%- emit-moves | ||
[ost %poke /aqua-events [our %aqua] %aqua-events aes]~ | ||
:: | ||
++ poke-aqua-vane-control | ||
|= command=?(%subscribe %unsubscribe) | ||
:_ this(subscribed =(command %subscribe)) | ||
(aqua-vane-control-handler our ost subscribed command) | ||
:: | ||
++ diff-aqua-effects | ||
|= [way=wire afs=aqua-effects] | ||
^- (quip move _this) | ||
=. this apex =< abet | ||
|- ^+ this | ||
?~ ufs.afs | ||
this | ||
=. this | ||
?+ -.q.i.ufs.afs this | ||
%sleep abet-pe:handle-sleep:(pe who.afs) | ||
%restore abet-pe:handle-restore:(pe who.afs) | ||
%doze abet-pe:(handle-doze:(pe who.afs) i.ufs.afs) | ||
== | ||
$(ufs.afs t.ufs.afs) | ||
:: | ||
:: Received timer wake | ||
:: | ||
++ wake | ||
|= [way=wire ~] | ||
^- (quip move _this) | ||
=. this apex =< abet | ||
?> ?=([@ *] way) | ||
=/ who (,@p (slav %p i.way)) | ||
abet-pe:(take-wake:(pe who) t.way ~) | ||
:: | ||
++ pe | ||
|= who=ship | ||
=+ (fall (~(get by piers) who) *pier) | ||
=* pier-data - | ||
|% | ||
++ abet-pe | ||
^+ this | ||
=. piers (~(put by piers) who pier-data) | ||
this | ||
:: | ||
++ handle-sleep | ||
^+ ..abet-pe | ||
=< ..abet-pe(pier-data *pier) | ||
?~ next-timer | ||
..abet-pe | ||
cancel-timer | ||
:: | ||
++ handle-restore | ||
^+ ..abet-pe | ||
=. this | ||
%- emit-aqua-events | ||
[%event who [//behn/0v1n.2m9vh %born ~]]~ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That value is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just cargo-culted that. The right answer is probably for aqua to keep track of that, change it on restart, and insert it into each of these wire as necessary. For now, I've just copied the same string everywhere. |
||
..abet-pe | ||
:: | ||
++ handle-doze | ||
|= [way=wire %doze tim=(unit @da)] | ||
^+ ..abet-pe | ||
?~ tim | ||
?~ next-timer | ||
..abet-pe | ||
cancel-timer | ||
?~ next-timer | ||
(set-timer u.tim) | ||
(set-timer:cancel-timer u.tim) | ||
:: | ||
++ set-timer | ||
|= tim=@da | ||
~? debug=| [who=who %setting-timer tim] | ||
=. next-timer `tim | ||
=. this (emit-moves [ost %wait /(scot %p who) tim]~) | ||
..abet-pe | ||
:: | ||
++ cancel-timer | ||
~? debug=| [who=who %cancell-timer (need next-timer)] | ||
=. this (emit-moves [ost %rest /(scot %p who) (need next-timer)]~) | ||
=. next-timer ~ | ||
..abet-pe | ||
:: | ||
++ take-wake | ||
|= [way=wire ~] | ||
~? debug=| [who=who %aqua-behn-wake now] | ||
=. next-timer ~ | ||
=. this | ||
%- emit-aqua-events | ||
[%event who [//behn/0v1n.2m9vh %wake ~]]~ | ||
..abet-pe | ||
-- | ||
-- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
:: Would love to see a proper stateful terminal handler. Ideally, | ||
:: you'd be able to ^X into the virtual ship, like the old ^W. | ||
:: | ||
:: However, that's probably not the primary way of interacting with | ||
:: it. In practice, most of the time you'll be running from a file | ||
:: (eg for automated testing) or fanning the same command to multiple | ||
:: ships or otherwise making use of the fact that we can | ||
:: programmatically send events. | ||
:: | ||
/- aquarium | ||
=, aquarium | ||
=> |% | ||
+$ move (pair bone card) | ||
+$ card | ||
$% [%poke wire dock %aqua-events (list aqua-event)] | ||
[%peer wire dock path] | ||
[%pull wire dock ~] | ||
== | ||
:: | ||
+$ state | ||
$: %0 | ||
subscribed=_| | ||
== | ||
-- | ||
=, gall | ||
=| moves=(list move) | ||
|_ $: bowl | ||
state | ||
== | ||
++ this . | ||
++ apex %_(this moves ~) | ||
++ abet [(flop moves) this] | ||
++ emit-moves | ||
|= ms=(list move) | ||
%_(this moves (weld ms moves)) | ||
:: | ||
++ emit-aqua-events | ||
|= aes=(list aqua-event) | ||
%- emit-moves | ||
[ost %poke /aqua-events [our %aqua] %aqua-events aes]~ | ||
:: | ||
++ poke-aqua-vane-control | ||
|= command=?(%subscribe %unsubscribe) | ||
:_ this(subscribed =(command %subscribe)) | ||
(aqua-vane-control-handler our ost subscribed command) | ||
:: | ||
++ diff-aqua-effects | ||
|= [way=wire afs=aqua-effects] | ||
^- (quip move _this) | ||
=. this apex =< abet | ||
|- ^+ this | ||
?~ ufs.afs | ||
this | ||
=. this | ||
?+ -.q.i.ufs.afs this | ||
%blit (handle-blit who.afs i.ufs.afs) | ||
== | ||
$(ufs.afs t.ufs.afs) | ||
:: | ||
++ handle-blit | ||
|= [who=@p way=wire %blit blits=(list blit:dill)] | ||
^+ this | ||
=/ last-line | ||
%+ roll blits | ||
|= [b=blit:dill line=tape] | ||
?- -.b | ||
%lin (tape p.b) | ||
%mor ~& "{<who>}: {line}" "" | ||
%hop line | ||
%bel line | ||
%clr "" | ||
%sag ~& [%save-jamfile-to p.b] line | ||
%sav ~& [%save-file-to p.b] line | ||
%url ~& [%activate-url p.b] line | ||
== | ||
~& last-line | ||
this | ||
-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little comment explaining that this ignores effects other than %restore or %send might be helpful.