Merge branch 'test' into pittyp

This commit is contained in:
Anton Dyudin 2015-10-20 14:33:51 -07:00
commit bc86863682
9 changed files with 172 additions and 146 deletions

View File

@ -145,6 +145,30 @@ Just do the same procedure to create a new, merged pill before
committing the merge. Otherwise, just make sure to use the correct committing the merge. Otherwise, just make sure to use the correct
`urbit.pill` for each commit. `urbit.pill` for each commit.
## Debug urbit with `gdb`
Follow the build instructions in README.md but run `make` with argument `DEBUG=yes`:
(If you've already built urbit first run `make clean`.)
make DEBUG=yes
Run `gdb`, while loading `bin/urbit` and its symbol table:
gdb bin/urbit
Set a breakpoint on `main()` (optional):
break main
Run your urbit comet `mycomet`:
run mycomet
Continue from the breakpoint on `main()`:
continue
## What to work on ## What to work on
If you are not thinking of contributing with a specific goal in mind, If you are not thinking of contributing with a specific goal in mind,

View File

@ -70,10 +70,18 @@ endif
INCLUDE=include INCLUDE=include
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\" MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN) -D U3_LIB=\"$(LIB)\"
DEBUG=no
ifeq ($(DEBUG),yes)
DEBUGFLAGS=-g
else
DEBUGFLAGS=-O3
endif
# NOTFORCHECKIN - restore -O3 # NOTFORCHECKIN - restore -O3
# -DGHETTO \ # -DGHETTO \
# -DHUSH # -DHUSH
CFLAGS= $(COSFLAGS) -O3 -ffast-math \ CFLAGS= $(COSFLAGS) $(DEBUGFLAGS) -ffast-math \
-funsigned-char \ -funsigned-char \
-I/usr/local/include \ -I/usr/local/include \
-I/opt/local/include \ -I/opt/local/include \

238
README.md
View File

@ -1,43 +1,85 @@
urbit Urbit
===== =====
Urbit is a new computing environment designed from scratch. Urbit is a clean-slate system software stack defined as a
deterministic computer. An encrypted P2P network, `%ames`, runs on a
functional operating system, Arvo, written in a strict, typed
functional language, Hoon, which compiles itself to a combinator
interpreter, Nock, whose spec gzips to 340 bytes.
At present urbit is under heavy development. It's not useful for any What is this for? Most directly, Urbit is designed as a personal
external purpose. Documentation is completely inadequate. Anyone can use cloud server for self-hosted web apps. It also uses HTTP APIs to
the interpreter, of course, but the network is invitation-only. manage data stuck in traditional web applications.
If you're interested in keeping in touch or following the project you More broadly, Urbit's network tackles identity and security problems
can: which the Internet can't easily address. Programming for a
deterministic single-level store is also a different experience from
Unix programming, regardless of language.
- Enter your email address at [urbit.org](http://urbit.org). Getting involved
- Subscribe to the ----------------
If you're interested in following Urbit, you can:
- Read our documentation at [urbit.org](http://urbit.org/docs)
- Subscribe to our newsletter at [urbit.org](http://urbit.org).
- Check out the
[urbit-dev](https://groups.google.com/forum/#!forum/urbit-dev) [urbit-dev](https://groups.google.com/forum/#!forum/urbit-dev)
mailing list. mailing list.
- Follow [@urbit_](https://twitter.com/urbit\_) on Twitter. - Follow [@urbit_](https://twitter.com/urbit\_) on Twitter.
- Get in touch with us via email, <urbit@urbit.org> - Hit us up by email, `urbit@urbit.org`. We're nice!
All of the source code is distributed under the MIT license. Code of conduct
---------------
Packages Everyone involved in the Urbit project needs to understand and
-------- respect our code of conduct, which is: "don't be rude."
#### Ubuntu or Debian Documentation
=============
Third-party package files are maintained at In-progress documentation can be found at
https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie [urbit.org/docs](http://urbit.org/docs).
onward.
#### OS X - Homebrew These docs ship with your urbit. If you're running one locally you
can access them at
http://localhost:8080/home/docs
Assuming you're running on port 8080. The port is printed on startup.
Install
=======
Urbit can be installed on most Unix systems. There is no Windows
port. Windows is a wonderful OS, we just haven't gotten to it yet.
Use a VM.
Install as a package
--------------------
### OS X - Homebrew
brew install --HEAD homebrew/head-only/urbit brew install --HEAD homebrew/head-only/urbit
Dependencies ### Ubuntu or Debian
------------
Third-party packages are available, at:
https://github.com/yebyen/urbit-deb
Urbit is only supported on Jessie onward (but outbound HTTPS requests only work on Stretch; I wish we knew why; help us!)
Hand-build from source
----------------------
First, install all external dependencies. Then, make.
### Dependencies
urbit depends on: urbit depends on:
gcc gcc (or clang)
gmp gmp
libsigsegv libsigsegv
openssl openssl
@ -54,9 +96,6 @@ urbit depends on:
sudo apt-get install libgmp3-dev libsigsegv-dev openssl libssl-dev libncurses5-dev git make exuberant-ctags automake autoconf libtool g++ ragel cmake re2c sudo apt-get install libgmp3-dev libsigsegv-dev openssl libssl-dev libncurses5-dev git make exuberant-ctags automake autoconf libtool g++ ragel cmake re2c
*note: http requests are not supported on debian jessie due to an ssl
issue*
#### Fedora #### Fedora
sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
@ -81,8 +120,7 @@ three packages, at least with Homebrew. Your mileage may vary.
pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
Build ### Download and make
-----
Clone the repo: Clone the repo:
@ -92,144 +130,82 @@ Clone the repo:
cd urbit cd urbit
Just run `make`: Run `make`:
make make
(On FreeBSD, use `gmake` instead.) (On FreeBSD, use `gmake` instead.)
Run (with a network invitation) The executable is `bin/urbit`. Install it somewhere, or just use it
------------------------------- where it is.
If you have a planet named `~fintud-macrep` and a ticket Launch
`~fortyv-tombyt-tabsen-sonres`, run ======
bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres An urbit is a persistent server on the `%ames` P2P network. You'll
create one of these servers now.
Your pier (all Urbit state, log and checkpoint) will be in If you have an invitation, it's a planet like `~fintud-macrep` and a
`./fintud-macrep`. ticket like `~fortyv-tombyt-tabsen-sonres`. Run
To start Urbit again omit the `-w` and `-t` flags: urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
bin/urbit fintud-macrep (You can leave the `~` on, but it annoys some Unix shells.)
Run (without a network invitation) If you don't have an invitation, pick a nickname for your comet, like
---------------------------------- `mycomet`. Urbit will randomly generate a 128-bit plot:
bin/urbit -c mypier urbit -c mycomet
Urbit will create a comet in `mypier`. Either way, creating your urbit will take some time. Some of this
time involves creating keys; some of it involves downloading code
over Urbit itself. Go get a cup of coffee. Or a beer.
To start Urbit again omit the `-c` flag: Wait until you see a prompt, something like
bin/urbit mypier ~fintud-macrep:talk()
Basics or
------
`^v` will switch between the task manager and the focussed process. `^x` ~fintud-macrep:dojo>
will switch between processes.
To start a process that is not yet started, run `*proc` from the task Your urbit is launched! Ladies and gentlemen, we are floating in
manager. space.
To connect your console to a process that has already been started, run Docs
`+proc` from the task manager. Note that the process must be one that ====
supports console access, such as dojo and talk.
`^d` will exit the pier from the task manager. No matter how you shut Your urbit is your personal web server. The best place to read its
your urbit down you'll be returned to exactly the same state as when you docs is by pointing your browser at it.
turned it off.
Talk Urbit prints the HTTP port it's serving when it starts up:
----
If you're on the network, you can use its most basic application, http: live (insecure) on 8080
`talk`.
If `talk` is not running, start it with `*talk` from the task manager. 8080 is the default. When it's not available we use 8081. Then 8082, and so on. If you're running on AWS or another cloud
service, this port may be firewalled; go to the firewall
configuration to open it.
Use `^x` to switch to the `talk` prompt and then run (*Always run any urbit HTTP server which is even semi-serious inside a reliable, battle-proven frontline server like nginx.*)
;join ~doznec/urbit-meta Urbit's own official planet `~winsen-pagdel` is also bound to just
plain `urbit.org`, and hosts the public docs
[here](http://urbit.org/docs). (They are, of course, the same as
those that ship with your urbit.)
to join the `urbit-meta` channel. People in there are helpful. Assuming your Urbit is on `localhost:8080`, your copy of the docs are at
There are three main `talk` commands: http://localhost:8080/home/docs
;join ~urbit-name/channel To continue getting setup, start here:
`;join` subscribes your main feed to a remote channel. http://localhost:8080/home/docs/user/start
;<number>
`;<number>` activates a previous message number, like a URL that got
clipped.
;<target>
`;<target>` sets the target for your messages, such as `;~urbit-name`
for a private message.
Filesystem Sync
---------------
The Urbit filesystem, `%clay` doesn't automatically sync to unix. If
you'd like to browse the contents of your Urbit from unix you'll need to
use `|mount`.
`|mount` creates a mirror in unix of files from `%clay` that is always
watching for changes. To sync your entire `home/` desk run:
|mount %
you should see a directory called `home/` get created inside your pier.
When you change files in this directory the changes will get synced into
your urbit.
Since each mount point is always watching for changes you may also want
to unmount from time to time.
The full syntax is as follows (from `dojo`):
|mount <path-in-clay> [<mount-name>]
The `<mount-name>` is optional and defaults to the last part of
the `<path-in-clay>`.
|unmount <mount-name>
or:
|unmount <path-in-clay>
Sysadmin
--------
For the most part, updates to the system are automatically synced to
your urbit across the network.
When we make updates to the interpreter you should be able to shut down
your urbit and:
git pull origin master
make
bin/urbit pier
where pier is the name of your pier.
While the network is still young from time to time we reboot the entire
universe. We call this a 'continuity breach' since we're breaking the
continuity of our crypto.
When this happens you'll need to back up your data and start a fresh
pier. Your original ticket will still work.
Contributing Contributing
------------ ============
The first step in contributing to urbit is to come and join us on The first step in contributing to urbit is to come and join us on
`:talk`. `:talk`.
For more detailed instructions check out For more detailed instructions check out
[`contributing.md`](https://github.com/urbit/urbit/blob/master/CONTRIBUTING.md),. [`contributing.md`](https://github.com/urbit/urbit/blob/master/CONTRIBUTING.md).

View File

@ -163,8 +163,8 @@ Regular symbols follow this pattern:
u3w[a-g] jets (retain, nock core) i/j/w.h j/[a-g]/*.c u3w[a-g] jets (retain, nock core) i/j/w.h j/[a-g]/*.c
Irregular symbols always start with `u3` and obey no other rules. Irregular symbols always start with `u3` and obey no other rules.
They're defined in `i/n/u.h`. Finally, `i/all.h` includes all They're defined in `i/n/aliases.h`. Finally, `i/all.h` includes
these headers (fast compilers, yay) and is all you need to all these headers (fast compilers, yay) and is all you need to
program in `u3`. program in `u3`.
### u3: noun internals ### u3: noun internals
@ -175,10 +175,10 @@ If your `u3_noun` is less than `(1 << 31)`, it's a direct atom.
Every unsigned integer between `0` and `0x7fffffff` inclusive is Every unsigned integer between `0` and `0x7fffffff` inclusive is
its own noun. its own noun.
If bit `31` is set in a `u3_noun`, bit `30` is always set - this If bit `31` is set in a `u3_noun` and bit `30` is `1` the noun
bit is reserved. Bit `29` is `1` if the noun is a cell, `0` if is an indirect cell. If bit `31` is set and bit `30` is `0` the
it's an atom. Bits `28` through `0` are a word pointer into the noun is an indirect atom. Bits `29` through `0` are a word
loom - see below. The structures are: pointer into the loom - see below. The structures are:
typedef struct { typedef struct {
c3_w mug_w; c3_w mug_w;
@ -400,9 +400,10 @@ A "south" road is the other way around:
Legend: `-` is durable storage (heap); `+` is temporary storage Legend: `-` is durable storage (heap); `+` is temporary storage
(stack); `~` is deep storage (immutable); `$` is the allocation (stack); `~` is deep storage (immutable); `$` is the allocation
frame `#` is free memory. frame; `#` is free memory.
Pointer restrictions: pointers stored in `+` can point anywhere. Pointer restrictions: pointers stored in `+` can point anywhere.
Of course, pointing to `#` (free memory) would be a bug.
Pointers in `-` can only point to `-` or `~`; pointers in `~` Pointers in `-` can only point to `-` or `~`; pointers in `~`
only point to `~`. only point to `~`.

View File

@ -819,7 +819,7 @@
void void
u3_term_ef_bake(u3_noun fav); u3_term_ef_bake(u3_noun fav);
/* u3_term_ef_blit(): send %blit effect to to terminal. /* u3_term_ef_blit(): send %blit effect to terminal.
*/ */
void void
u3_term_ef_blit(c3_l tid_l, u3_term_ef_blit(c3_l tid_l,
@ -950,7 +950,7 @@
void void
u3_unix_ef_ogre(u3_noun mon); u3_unix_ef_ogre(u3_noun mon);
/* u3_unix_ef_ogre(): delete mount point /* u3_unix_ef_hill(): enumerate mount points
*/ */
void void
u3_unix_ef_hill(u3_noun hil); u3_unix_ef_hill(u3_noun hil);

View File

@ -105,7 +105,14 @@ u3v_wish(const c3_c* str_c)
// It's probably not a good idea to use u3v_wish() // It's probably not a good idea to use u3v_wish()
// outside the top level... // outside the top level...
// //
return _cv_nock_wish(u3i_string(str_c)); u3_noun txt = u3i_string(str_c);
u3_noun exp = u3kdb_get(u3A->yot, u3k(txt));
if ( u3_none != exp ) {
u3z(txt);
return exp;
}
else return _cv_nock_wish(u3i_string(str_c));
} }
} }

View File

@ -1054,9 +1054,11 @@ _http_start(u3_http* htp_u)
uL(fprintf(uH, "http: listen: %s\n", uv_strerror(ret))); uL(fprintf(uH, "http: listen: %s\n", uv_strerror(ret)));
} }
} }
#if 0
uL(fprintf(uH, "http: live (%s) on %d\n", uL(fprintf(uH, "http: live (%s) on %d\n",
(c3y == htp_u->sec) ? "\"secure\"" : "insecure", (c3y == htp_u->sec) ? "\"secure\"" : "insecure",
htp_u->por_w)); htp_u->por_w));
#endif
break; break;
} }
} }

View File

@ -225,7 +225,8 @@ u3_ve_usage(c3_i argc, c3_c** argv)
"-f Fuzz testing\n", "-f Fuzz testing\n",
"-k stage Start at Hoon kernel version stage\n", "-k stage Start at Hoon kernel version stage\n",
"-Xwtf Skip last event\n"}; "-Xwtf Skip last event\n"};
for ( c3_i i=0; i < sizeof(use_c)/sizeof(c3_c*); i++ ) { c3_i i;
for ( i=0; i < sizeof(use_c)/sizeof(c3_c*); i++ ) {
fprintf(stderr,use_c[i],argv[0]); fprintf(stderr,use_c[i],argv[0]);
} }
exit(1); exit(1);
@ -341,11 +342,16 @@ main(c3_i argc,
if ( c3y == u3_Host.ops_u.nuu ) { if ( c3y == u3_Host.ops_u.nuu ) {
struct stat s; struct stat s;
if ( !stat(u3_Host.dir_c, &s) ) { if ( !stat(u3_Host.dir_c, &s) ) {
fprintf(stderr, "used -c but %s already exists\n", u3_Host.dir_c); fprintf(stderr, "tried to create, but %s already exists\n", u3_Host.dir_c);
exit(1); exit(1);
} }
} }
#if 0
if ( 0 == getuid() ) {
chroot(u3_Host.dir_c);
u3_Host.dir_c = "/";
}
#endif
u3_ve_sysopt(); u3_ve_sysopt();
printf("~\n"); printf("~\n");

View File

@ -355,7 +355,9 @@ u3_term_io_talk(void)
uL(fprintf(uH, "term: listen: %s\n", uv_strerror(ret_w))); uL(fprintf(uH, "term: listen: %s\n", uv_strerror(ret_w)));
} }
} }
#if 0
uL(fprintf(uH, "term: live (but unsupported) on %d\n", tel_u->por_s)); uL(fprintf(uH, "term: live (but unsupported) on %d\n", tel_u->por_s));
#endif
break; break;
} }
} }