Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B 03313 - Update holo-envoy with rsm #37

Merged
merged 66 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
12de1d6
nix-shell: update for RSM binaries (holochain, dna-util, lair-keystore)
mjbrisebois Nov 17, 2020
7012db3
Merge branch 'develop' into rsm-update-2020-11-17
mjbrisebois Nov 17, 2020
7da4463
update conductor calls; add run dna script; clean out rust conductor
JettTech Dec 3, 2020
4f97932
adds appInfo call; updates installed app id convention; includes elem…
JettTech Dec 3, 2020
da76cac
test comments
JettTech Dec 3, 2020
7bf965e
remove ZomeApiResult .Ok
JettTech Dec 3, 2020
d0e22a0
make call compatbile with chaperone; add conductor scripts
JettTech Dec 4, 2020
adad76a
remove mock zomecall in index.ts; update specs in hha mock file
JettTech Dec 5, 2020
05b0529
update tests and servicelogger
JettTech Dec 7, 2020
4291fd3
update servicelogger confirmation
JettTech Dec 7, 2020
8ba43c3
update call_spec to restore dna_alias, small edits
JettTech Dec 7, 2020
7aa2e8b
replace all instance_ids
JettTech Dec 7, 2020
dc232ce
add test consoles, tests updates
JettTech Dec 8, 2020
ea32878
update payload and agent type
JettTech Dec 9, 2020
4c3cb88
update testing opts, structure response in hhdt format, wormhole work…
JettTech Dec 13, 2020
3ca25fc
add jshandle logs
JettTech Dec 13, 2020
d5daf9d
zome call fn arg workaround, hha as working test app
JettTech Dec 14, 2020
484c6c2
bump holochain, add codec digest updates, remove happ alias, update t…
JettTech Dec 17, 2020
93d3856
clean-up
JettTech Dec 17, 2020
c9c1e47
update dev deps
JettTech Dec 17, 2020
347eaff
restore u prefix
JettTech Dec 21, 2020
0052ddc
update test master agent key, logs
JettTech Dec 22, 2020
eeb3658
cryto update, add servicelogger settings setup
JettTech Dec 29, 2020
1fbe02d
run all apps in same conductor, add servicelogger settings setup, clean
JettTech Dec 31, 2020
d48fe3d
update to yarn to support hc-run-dna
JettTech Dec 31, 2020
0eef460
odds and ends
JettTech Dec 31, 2020
a639211
bump holochain-run-dna, return to npm
JettTech Jan 6, 2021
21a889b
update logs
JettTech Jan 11, 2021
869b816
update pack format, add sectioning
JettTech Jan 11, 2021
a8dcc13
update confirm response
JettTech Jan 11, 2021
0f4efd2
return to get_happ call
JettTech Jan 11, 2021
377b9ff
pre-register test app in test
JettTech Jan 11, 2021
38e1908
add hosted happ specific servicelogger ids, add opt to test config
JettTech Jan 11, 2021
9bddc95
improve debug logs
JettTech Jan 11, 2021
c3a1cce
clean-up test
JettTech Jan 11, 2021
106a520
update urls
JettTech Jan 12, 2021
9bf3ea0
cleanup
JettTech Jan 12, 2021
b98810f
add close conductor to e2e
JettTech Jan 13, 2021
fe2276a
pass back host_data as metadata, clean logs
JettTech Jan 16, 2021
8570055
update response_id value to be response digest
JettTech Jan 16, 2021
4bbd3a1
Update package.json
JettTech Jan 18, 2021
4978ce7
add local path to config
JettTech Jan 18, 2021
154bf4f
clean-up
JettTech Jan 18, 2021
6898472
update master port number to production port
JettTech Jan 18, 2021
9f61612
rename ConnectionCheck to ConnectinMonitor
robbiecarlton Jan 20, 2021
2265169
update chaperone dep
JettTech Jan 20, 2021
2befddd
remove todos
robbiecarlton Jan 20, 2021
f22f8c8
formatting
robbiecarlton Jan 20, 2021
b95ce12
Merge branch 'B-03313-update-admin-calls' of https://github.com/Holo-…
robbiecarlton Jan 20, 2021
a50f876
changes
robbiecarlton Jan 20, 2021
46e3381
comment out old tests
robbiecarlton Jan 20, 2021
58e0765
clean up nix files and remove sprintf module
zo-el Jan 22, 2021
a3565bc
lint
zo-el Jan 22, 2021
2cbf5b7
add src_path to dna config, use relative paths, update api doc, clean-up
JettTech Jan 22, 2021
3080c06
Merge branch 'B-03313-update-admin-calls' into 2021-01-21/fixes
JettTech Jan 22, 2021
95a40c4
update lock with request module, correct timeout spacing
JettTech Jan 22, 2021
4229863
Merge pull request #44 from Holo-Host/2021-01-21/fixes
JettTech Jan 22, 2021
78fe0e4
addPendingConfirmation after error, clean-up
JettTech Jan 22, 2021
453b8ff
Merge branch 'B-03313-update-admin-calls' of https://github.com/Holo-…
JettTech Jan 22, 2021
fd32fe4
touchups
JettTech Jan 22, 2021
b635850
test clean-up
JettTech Jan 23, 2021
4fcc59d
unit test touchups
JettTech Jan 25, 2021
ad7e3f5
isolate last failing test
JettTech Jan 25, 2021
dab12e2
final unit test cleanup
JettTech Jan 25, 2021
0c6ff40
CI on Github Actions (#48)
zo-el Jan 27, 2021
364cb47
Update src/index.ts
JettTech Jan 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ AGENTID
conductor.log
sim2h.log
holochain-conductor/storage
holochain-conductor.log
15 changes: 5 additions & 10 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@
# RPC WebSocket API
JettTech marked this conversation as resolved.
Show resolved Hide resolved

### `holo/agent/signup`
Request Envoy to set up new hApp instances for this Agent. We should have a way to verify that this
Request Envoy to set up new installed app for this Agent. We should have a way to verify that this
Agent is actually unregisterd for the given hApp.

Arguments
- `<hha_hash>`
- `<agent_id>`


### `holo/agent/identify`
Endpoint for asking a Host if they are hosting the given Agent ID.
### `holo/app_info`
Endpoint for fetching app data, including a list of cell_data and nicknames for each dna in the app.

Arguments
- `<agent_id>`

Failure modes
- Host does not have expected instances
- Host does not have the correct chains
- Host does not have up-to-date chains
- `<installed_app_id>`


### `holo/call`
Expand All @@ -37,7 +32,7 @@ Arguments
"call_spec": {
"hha_hash" : string,
"dna_alias" : string,
"instance_id" : string,
"cell_id" : string,
"zome" : string,
"function" : string,
"args" : array
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ make test-e2e

### Outgoing Connections

- **Admin (Admin Server)** - used for creating new hosted Agents and their instances
- **Admin (Admin Server)** - used for creating new hosted Agents and their installed-apps
- **Internal (Conductor)** - used for service logger traffic
- **Public (Conductor)** - used for hosted agent traffic


## Concepts

### Anonymous Agent
These are ephemeral Agent identities that can connect to any Host running an anonymous instance of a
hApp's DNA(s). When an anonymous connection is made, Envoy does not need to do anything special for
These are ephemeral Agent identities that can connect to any Host running an anonymous installed-app (which runs the cells
attached to the anonymous id for this happ). When an anonymous connection is made, Envoy does not need to do anything special for
that Agent.

### Signed-in Agent
Expand All @@ -94,11 +94,11 @@ The Agent is connecting to this Host for the first time and has never used this

*Process*
- register this Agent as a Hosted Agent in Conductor
- start instances for each of the hApp's DNAs
- start cells for each of the hApp's DNAs
- and continue to sign-in process...

#### Sign-in
The Agent has used this hApp before and expects this Host to have their instances running
The Agent has used this hApp before and expects this Host to have their installed-happs running

*Process*
- Register Agent's wormhole endpoint in RPC events
Expand Down
109 changes: 35 additions & 74 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,59 @@ docs/index.html: build/index.js
.PRECIOUS: keystore-%.key
.PHONY: src build docs docs-watch build-watch

dnas:
mkdir -p ./dnas
dnas/holo-hosting-app.dna.gz: dnas
curl 'https://holo-host.github.io/holo-hosting-app-rsm/releases/downloads/v0.0.1-alpha3/holo-hosting-app.dna.gz' -o $@
dnas/servicelogger.dna.gz: dnas
curl 'https://holo-host.github.io/servicelogger-rsm/releases/downloads/v0.0.1-alpha3/servicelogger.dna.gz' -o $@
dnas/elemental-chat.dna.gz: dnas
curl -LJ 'https://github.com/holochain/elemental-chat/releases/download/v0.0.1-alpha9/elemental-chat.dna.gz' -o $@

build: node_modules build/index.js
docs: node_modules docs/index.html
DNAs: dnas/elemental-chat.dna.gz dnas/holo-hosting-app.dna.gz dnas/servicelogger.dna.gz

MOCHA_OPTS =

test: build DNAs conductor-1.toml start-sim2h
test: build
make test-unit;
make reset-hcc; make test-integration
make reset-hcc; make test-e2e
test-nix: build DNAs conductor-1.toml start-sim2h
make test-integration;
make test-e2e
test-nix: build
make test-unit;
CONDUCTOR_LOGS=error,warn LOG_LEVEL=silly make reset-hcc; make test-integration
test-debug: build DNAs conductor-1.toml start-sim2h
CONDUCTOR_LOGS=error,warn LOG_LEVEL=silly make test-integration
test-debug: build
CONDUCTOR_LOGS=error,warn LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) ./tests/unit/
make reset-hcc; make test-integration-debug
make reset-hcc; make test-e2e-debug2
make test-integration-debug
make test-e2e-debug2

test-unit: build
npx mocha $(MOCHA_OPTS) ./tests/unit/
test-unit-debug: build
LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) ./tests/unit/

test-integration: build DNAs conductor-1.toml start-sim2h
test-integration: build DNAs
npx holochain-run-dna -c ./app-config.yml -a 4444 &> holochain-conductor.log &
npx mocha $(MOCHA_OPTS) ./tests/integration/
test-integration-debug: build DNAs conductor-1.toml start-sim2h
killall holochain
test-integration-debug: build DNAs
npx holochain-run-dna -c ./app-config.yml -a 4444 &> holochain-conductor.log &
LOG_LEVEL=silly CONDUCTOR_LOGS=error,warn npx mocha $(MOCHA_OPTS) ./tests/integration/
killall holochain

test-e2e: build DNAs conductor-1.toml start-sim2h dist/holo_hosting_chaperone.js
test-e2e: build DNAs dist/holo_hosting_chaperone.js
npx holochain-run-dna -c ./app-config.yml -a 4444 &> holochain-conductor.log &
npx mocha $(MOCHA_OPTS) ./tests/e2e
test-e2e-debug: build DNAs conductor-1.toml start-sim2h dist/holo_hosting_chaperone.js
killall holochain
test-e2e-debug: build DNAs dist/holo_hosting_chaperone.js
npx holochain-run-dna -c ./app-config.yml -a 4444 &> holochain-conductor.log &
LOG_LEVEL=silly npx mocha $(MOCHA_OPTS) ./tests/e2e/
test-e2e-debug2: build DNAs conductor-1.toml start-sim2h dist/holo_hosting_chaperone.js
killall holochain
test-e2e-debug2: build DNAs dist/holo_hosting_chaperone.js
npx holochain-run-dna -c ./app-config.yml -a 4444 &> holochain-conductor.log &
LOG_LEVEL=silly CONDUCTOR_LOGS=error,warn npx mocha $(MOCHA_OPTS) ./tests/e2e/
killall holochain

docs-watch:
build-watch:
Expand Down Expand Up @@ -75,56 +95,16 @@ publish-docs:
git checkout $(CURRENT_BRANCH)


# Generate Conductor TOML config
HCC_DIR = ./holochain-conductor
HCC_STORAGE = $(shell pwd)/holochain-conductor/storage
# Manage Holochain Conductor config
HC_LOCAL_STORAGE = $(shell pwd)/holochain-conductor/storage

.PHONY: start-hcc-%
conductor.log:
touch $@

reset-hcc:
rm $(HCC_STORAGE)/* -rf
rm -f dnas/*
rm -f conductor-*.toml
start-hcc-%: DNAs conductor-%.toml conductor.log
holochain -c conductor-$*.toml > conductor.log 2>&1 & tail -f conductor.log

dist/holo_hosting_chaperone.js:
ln -s node_modules/@holo-host/chaperone/dist dist

DNAs: dnas/happ-store.dna.json dnas/holo-hosting-app.dna.json dnas/holofuel.dna.json dnas/servicelogger.dna.json
rm-DNAs:
rm dnas/*.json
update-DNAs: rm-DNAs DNAs

dnas/%.dna.json:
@mkdir -p ./dnas
@for p in $$buildInputs; do \
if [[ "$${p#*-}" == "$*" ]]; then \
echo "Linking $${p} to $@"; \
ln -fs $${p}/$*.dna.json $@; \
fi \
done

check-sim2h:
ps -efH | grep sim2h_server | grep 9000 | grep -v grep
restart-sim2h: stop-sim2h start-sim2h
start-sim2h:
@if [[ $$(ps -efH | grep sim2h_server | grep 9000 | grep -v grep) ]]; then \
echo "sim2h is already running on port 9000"; \
else \
echo "Starting sim2h_server on port 9000"; \
sim2h_server -p 9000 > sim2h.log 2>&1 & \
fi
stop-sim2h:
@if [[ $$(ps -efH | grep sim2h_server | grep 9000 | grep -v grep) ]]; then \
echo "Stopping sim2h_server..."; \
killall sim2h_server || true; \
else \
echo "sim2h is not running on port 9000"; \
fi

check-conductor: check-holochain
check-holochain:
ps -efH | grep holochain | grep -E "conductor-[0-9]+.toml"
Expand All @@ -137,24 +117,6 @@ stop-holochain:
echo "holochain conductor is not running"; \
fi

conductor-%.toml: keystore-%.key $(HCC_DIR)/conductor.master.toml Makefile
@echo "Creating Holochain conductor config for Agent $*..."; \
AGENT=$*; \
PUBKEY=$$(cat AGENTID); \
KEYFILE=$<; \
S2HURI=ws://localhost:9000; \
WORMHOLE=http://localhost:9676; \
HCC_STORAGE=$(HCC_STORAGE); \
sed -e "s|AGENT|$$AGENT|g" \
-e "s/PUBKEY/$$PUBKEY/g" \
-e "s/KEYFILE/$$KEYFILE/g" \
-e "s|S2HURI|$$S2HURI|g" \
-e "s|WORMHOLE|$$WORMHOLE|g" \
-e "s|HCC_STORAGE|$$HCC_STORAGE|g" \
< $(HCC_DIR)/conductor.master.toml \
> $@; \
echo " ... Wrote new $@ (from $(HCC_DIR)/conductor.master.toml and $<)"

keystore-%.key:
@echo "Creating Holochain key for Agent $*: keystore-$*.key";
echo $$( hc keygen --nullpass --quiet --path ./keystore-$*.key) \
Expand All @@ -164,7 +126,6 @@ keystore-%.key:
@echo "Agent ID: $$(cat AGENTID)";

# TMP targets

use-local-chaperone:
npm uninstall --save @holo-host/chaperone; npm install --save-dev ../chaperone
use-npm-chaperone:
Expand Down
19 changes: 19 additions & 0 deletions app-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# Servicelogger App
- dnas:
- ./dnas/servicelogger.dna.gz
app_name: hosted-app-hha-hash::servicelogger
app_port: 42222 # service port

# HoloHosting App
- dnas:
- ./dnas/holo-hosting-app.dna.gz
# NB: Make sure the hha app_name matches the harded HHA_INSTALLED_APP_ID value in index.ts
app_name: holo-hosting-app
app_port: 42233 # internal port

# Hosted App
- dnas:
- ./dnas/elemental-chat.dna.gz
app_name: hosted-app
app_port: 42244 # hosted port
9 changes: 2 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ with pkgs;
src = gitignoreSource ./.;

buildInputs = [
holochain-rust
holochain
lair-keystore
python

# dnaPackages.happ-store
# dnaPackages.holo-hosting-app
dnaPackages.hosted-holofuel
# dnaPackages.holofuel
dnaPackages.servicelogger
];

nativeBuildInputs = [
Expand Down
Loading