Skip to content

Commit 0573876

Browse files
committed
wip: updating the developer docs
1 parent fffe153 commit 0573876

File tree

1 file changed

+21
-47
lines changed

1 file changed

+21
-47
lines changed

DEVELOPERS.md

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,40 @@
11
## Developers
22

3-
### Managing Dependencies for Developing Acorn
3+
This is a monorepo that includes the frontend and backend code for Acorn.
4+
Note, there are two build targets and thus two development modes:
45

5-
There are several cargo and holochain dependencies you need to manage when you change any of the holochain aspects of Acorn:
6+
- Acorn Desktop (app packaging is currently managed by a separate repo [acorn-desktop](https://github.com/lightningrodlabs/acorn-desktop))
7+
- Acorn Moss Tool
68

7-
- [`holochain-runner`](https://github.com/lightningrodlabs/holochain-runner)
8-
- a rust binary that bundles a preconfigured conductor to simplify the app packaging process.
9-
- [`electron-holochain`](https://github.com/lightningrodlabs/electron-holochain)
10-
- an electron template which includes `holochain-runner`, meant to reduce boilerplate around building desktop happs. All that's required are the UI and `.happ` files.
11-
- [`hdk_crud`](https://github.com/lightningrodlabs/hdk_crud)
12-
- a generic zome utility crate for defining entry types and automatically generating CRUD for each of them. Used by `acorn-happ`.
13-
- [`acorn-happ`](https://github.com/lightningrodlabs/acorn-happ)
14-
- all of the zome logic lives here. Uses `hdk_crud` to define all the Acorn entry types, like outcomes, edges, etc.
9+
## setup
1510

16-
### Building the frontend
11+
- you must have nix installed, then run `nix develop` at the root. This will setup a nix shell environment with all the required environment packages (holochain, node, etc)
12+
- run `yarn install`
13+
- build the happs by running `yarn run pack-happs`
1714

18-
There are two build targets:
15+
### Acorn Desktop
1916

20-
- desktop
21-
- Weave app
17+
When you are running the app locally for the desktop version, you need to run two separate commands.
2218

23-
### Run Locally and Develop on your Computer
19+
- In the first terminal window run `yarn run desktop:ui`
20+
- In the second terminal window run `yarn run desktop:happ`
2421

25-
_Prerequisites_
22+
This will launch the ui and a electron app with the holochain conductor preconfigured and the acorn happ loaded.
2623

27-
- Have `nodejs` (v20) and `yarn` (v1, classic) installed on your system
24+
If you want multiple instances to test multi-agent scenarios run `yarn run desktop:happ -n 2` (or any number)
2825

29-
Then run
26+
Alternatively, instead of launching the ui separately, you can run `yarn run desktop:build-webhapp` and then `yarn run desktop:webhapp`. This will launch a fully packaged webhapp in a preconfigured electron environment.
3027

31-
- `yarn install`
32-
- `yarn run dev`
28+
### Acorn Moss Tool
3329

34-
In the future, just run `yarn run dev` anytime to develop.
30+
- In the first terminal window run `yarn run moss:ui`
31+
- In the second terminal window run `yarn run moss:happ`
3532

36-
When you run `yarn run dev` a `user-data/` directory is created and this is where user data including private keys, and also data generated through use of the app is stored.
33+
If you want 2 agents, open a 3rd terminal window and run `yarn run moss:happ2`
3734

38-
You can run `yarn run user-data-reset` if you have user data in development, but you want to clear it, and start over with fresh identities.
35+
If you want to test the full webhapp, run `yarn run moss:build-webhapp` then run `yarn run moss:webhapp`. If you want a second agent, run `yarn run moss:webhapp2`.
3936

40-
> NOTE: if you see a blank screen once electron launches the app, refresh the page (using View -> Reload or Cmd/Ctrl-R) to see app contents.
41-
42-
#### Commands that are more specific to your use case:
43-
44-
You can run the web process and the electron processes separately, instead of running `yarn run dev` which combines them.
45-
46-
**web** (user interface)
47-
48-
- `yarn run web`
49-
50-
**electron**
51-
52-
- `yarn run electron`
53-
54-
#### Multi-User Testing
55-
56-
run the following commands in separate terminal instances (must have a running instance of acorn for the first user, either by running `yarn run dev` or the below commands without the `2`):
57-
58-
- `yarn run web(2,3,4)`
59-
- `yarn run electron(2,3,4)`
60-
61-
After running these commands, a `user-data/` directory is created with user data. It too can be cleared by running `yarn run user-data-reset`.
62-
63-
### Building / Packaging
37+
### Building / Packaging - TO BE UPDATED
6438

6539
To build:
6640

0 commit comments

Comments
 (0)