Setting up Hoon

Index

  1. Toc
  2. Contributing
    1. Understanding Any Module
    2. Style Guide
    3. Writing Documents
    4. Examples Over Testing
    5. Git
    6. Iex
    7. Mnesia Vs Actor State
    8. Observer
    9. Testing
      1. Running Tests
      2. Writing Tests
  3. Visualization
    1. Actors
  4. Hoon
    1. Calling
    2. Dumping
    3. Setting Up
  5. Analysis

Getting a Good Hoon environment

A good starting point is to read Hoon's docs on environment

It's good to follow it until the section "Mount a desk"

From here we can setup the environment quite nicely

|merge %anoma our %base
|mount %anoma

From here we want to remove all the uneeded files, get it to the following state:

8 taichi@Gensokyo:~/Documents/Workspace/Hoon/zod git:master:? % tree anoma
anoma
├── mar
│   ├── hoon.hoon
│   ├── mime.hoon
│   ├── noun.hoon
│   ├── txt-diff.hoon
│   └── txt.hoon
└── sys.kelvin

2 directories, 6 files

with sys.kelvin having only [%zuse 412]

Now that we have our minimal state, we can symlink in the files in https://github.com/anoma/anoma/tree/base/hoon

into lib. It should now look something like this

9 taichi@Gensokyo:~/Documents/Workspace/Hoon/zod git:master:? % tree anoma
anoma
├── lib
│   ├── anoma.hoon -> .../hoon/anoma.hoon
│   ├── logics.hoon -> .../hoon/logics.hoon
│   ├── resource-machine.hoon -> .../hoon/resource-machine.hoon
│   └── tests.hoon -> .../hoon/tests.hoon
├── mar
│   ├── hoon.hoon
│   ├── mime.hoon
│   ├── noun.hoon
│   ├── txt-diff.hoon
│   └── txt.hoon
└── sys.kelvin

3 directories, 10 files

Now we can mount our anoma code into hoon

> |commit %anoma
>=
> =anoma -build-file /=anoma=/lib/anoma/hoon
> =resource-machine -build-file /=anoma=/lib/resource-machine/hoon
> =logics -build-file /=anoma=/lib/logics/hoon
> =tests -build-file /=anoma=/lib/tests/hoon

From here, the hoon environment is ready to be used and it should work just as Anoma uses Nock.