2015-08-22 22:33:22 +03:00
|
|
|
# Contributing to urbit
|
|
|
|
|
|
|
|
Thank you for your interest in contributing to urbit.
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
See [urbit.org/docs/getting-started](https://urbit.org/docs/getting-started/#arvo)
|
|
|
|
for basic orientation and usage instructions.
|
|
|
|
|
|
|
|
## Fake ships
|
2015-08-24 22:50:08 +03:00
|
|
|
|
|
|
|
You may have an identity on the live network, but doing all your
|
|
|
|
development on the live network would be cumbersome and unnecessary.
|
2019-01-16 00:03:37 +03:00
|
|
|
Standard practice in urbit development is to work on a fake `~zod`.
|
|
|
|
Fake ships use deterministic keys (derived from the ship address)
|
|
|
|
and don't talk to the live network. They can talk to each other over
|
|
|
|
the local loopback.
|
2016-02-15 08:52:31 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
To start a fake ship, simply specify the name with `-F`:
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ urbit -F zod
|
|
|
|
```
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
You can also pass a name for the *pier* (or ship directory):
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ urbit -F zod my-fake-zod
|
|
|
|
```
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
To resume a fake ship, just pass the name of the pier:
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ urbit fake-zod/
|
|
|
|
```
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2015-08-22 22:33:22 +03:00
|
|
|
## Git practice
|
|
|
|
|
2016-02-15 08:52:31 +03:00
|
|
|
Since we use the GitHub issue tracker, it is helpful (though not
|
|
|
|
required) to contribute via a GitHub pull request. If you already know
|
|
|
|
what you are doing, skip down to the Style section.
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
Start by cloning the repository on your work machine:
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git clone https://github.com/urbit/urbit
|
|
|
|
```
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
And, additionally, fork the repository on GitHub by clicking the "Fork"
|
|
|
|
button. Add your fork as a remote:
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git remote add [username] https://github.com/[username]/urbit
|
|
|
|
```
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
and set it as the default remote to push to:
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git config --local remote.pushDefault [username]
|
|
|
|
```
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
This is good practice for any project that uses git. You will pull
|
|
|
|
upstream branches from urbit/urbit and push to your personal urbit fork
|
|
|
|
by default.
|
|
|
|
|
2016-10-27 20:02:43 +03:00
|
|
|
Next, start a new branch to do your work on. For `urbit`, please use the
|
|
|
|
latest tagged release as your starting point. For other repositories,
|
|
|
|
anywhere pointed to by `master` is alright to start from.
|
2015-08-22 22:33:22 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git checkout -b [branch name] [starting point]
|
|
|
|
```
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
Now you are free to do your work on this branch. When finished, you may
|
|
|
|
want to clean up your commits:
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git rebase -i [starting point]
|
|
|
|
```
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
Then you can push to your public fork with `git push` and make a pull
|
2015-11-17 01:56:21 +03:00
|
|
|
request via the GitHub UI.
|
2015-08-22 22:33:22 +03:00
|
|
|
|
|
|
|
After your changes are merged upstream, you can delete your branch (via
|
|
|
|
github UI or `git push :[branch]` remotely, and with `git branch -d`
|
|
|
|
locally).
|
|
|
|
|
|
|
|
## Style
|
|
|
|
|
|
|
|
The urbit project uses two-space indentation and avoids tab characters.
|
|
|
|
In C code, it should not be too difficult to mimic the style of the code
|
|
|
|
around you, which is just fairly standard K&R with braces on every
|
|
|
|
compound statement. One thing to watch out for is top-level sections in
|
|
|
|
source files that are denoted by comments and are actually indented one
|
|
|
|
level.
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
Hoon will be a less familiar language to many contributors. More details
|
|
|
|
are forthcoming; for now, the `%ford` vane (in
|
|
|
|
[`sys/vane/ford.hoon`](https://github.com/urbit/arvo/blob/master/sys/vane/ford.hoon))
|
|
|
|
is the highest quality code in the kernel.
|
|
|
|
|
|
|
|
## Kernel development
|
|
|
|
|
|
|
|
Working on either C or non-kernel Hoon should not bring any surprises, but
|
|
|
|
the Hoon kernel (anything under `sys/` in [urbit/arvo](https://github.com/urbit/arvo))
|
|
|
|
is bootstrapped from `urbit.pill`, and must be recompiled if any changes are
|
|
|
|
made. This should happen automatically when you make changes, but if it doesn't,
|
|
|
|
the command to manually recompile the kernel and install the new kernel
|
|
|
|
is `|reset` in `dojo`. This rebuilds from the `sys` directory in the
|
|
|
|
`home` desk in `%clay`. Currently, `|reset` does not reload apps like
|
|
|
|
`dojo` itself, which will still reference the old kernel. To force them
|
|
|
|
to reload, make a trivial edit to their main source file (under the
|
|
|
|
`app` directory) in `%clay`.
|
2015-08-22 22:33:22 +03:00
|
|
|
|
2015-08-24 22:50:08 +03:00
|
|
|
## The kernel and pills
|
|
|
|
|
2016-02-15 08:52:31 +03:00
|
|
|
urbit bootstraps itself using a binary blob called `urbit.pill`. You
|
2016-10-27 20:02:43 +03:00
|
|
|
probably remember it being fetched from `bootstrap.urbit.org` before
|
2019-01-16 00:03:37 +03:00
|
|
|
your first boot. This is the compiled version of the kernel (which
|
|
|
|
you can find in the `sys` directory of [urbit/arvo](https://github.com/urbit/arvo)),
|
|
|
|
along with a complete copy of the Arvo repository as source.
|
2015-08-24 22:50:08 +03:00
|
|
|
|
|
|
|
The procedure for creating `urbit.pill` is often called "soliding". It
|
|
|
|
is somewhat similar to `|reset`, but instead of replacing your running
|
|
|
|
kernel, it writes the compiled kernel to a file. The command to solid
|
2019-01-16 00:03:37 +03:00
|
|
|
is:
|
2015-08-24 22:50:08 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
> .urbit/pill +solid
|
|
|
|
```
|
2015-08-24 22:50:08 +03:00
|
|
|
|
|
|
|
When the compilation finishes, your `urbit.pill` will be found in the
|
2016-02-15 08:52:31 +03:00
|
|
|
`[pier]/.urb/put/` directory.
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
You can boot a new ship from your local pill with `-B`:
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ urbit -F zod -B path/to/urbit.pill fake-zod
|
|
|
|
```
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
Ordinarily, `http://bootstrap.urbit.org/latest.pill` will be updated
|
|
|
|
to match whatever's on `master` in the `arvo` repository with every
|
|
|
|
merge to `master`. Older pills will be stored with the first 10
|
|
|
|
characters of the `git` SHA1 of the relevant commit as `git-[sha1].pill`.
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
The continuous-integration build of the `urbit/arvo` repository
|
|
|
|
uploads these pills for any successful build (if the commit or pull-request
|
|
|
|
affects the `sys/` directory).
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
You can boot from one of these pills by passing the path to an Arvo
|
|
|
|
working copy with `-A` (and `-s` for *search*):
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
```
|
|
|
|
$ git clone https://github.com/urbit/arvo
|
|
|
|
$ urbit -F zod -A path/to/arvo -s fake-zod
|
|
|
|
```
|
2015-10-19 11:33:25 +03:00
|
|
|
|
2015-08-22 22:33:22 +03:00
|
|
|
## What to work on
|
|
|
|
|
|
|
|
If you are not thinking of contributing with a specific goal in mind,
|
|
|
|
the GitHub issue tracker is the first place you should look for ideas.
|
|
|
|
Issues are tagged with a priority and a difficulty. A good place to
|
|
|
|
start is on either a low-difficulty issue or a low-priority issue.
|
|
|
|
Higher priority issues are likely to be assigned to someone - if this is
|
|
|
|
the case, then contacting that person to coordinate before starting to
|
|
|
|
work is probably a good idea.
|
|
|
|
|
2015-08-23 00:10:32 +03:00
|
|
|
There is also a "help wanted" tag for things that we are especially
|
|
|
|
eager to have outside contributions on. Check here first!
|
|
|
|
|
2015-08-22 22:33:22 +03:00
|
|
|
## Staying in touch
|
|
|
|
|
2019-01-16 00:03:37 +03:00
|
|
|
Questions or other communications about contributing to Urbit can go to
|
|
|
|
[support@urbit.org](mailto:support@urbit.org).
|