This repo follows the Apollo tutorial for graphql at https://www.apollographql.com/docs/tutorial/introduction/
Steps:
Installation
-
cd ui/client
->npm i
-
cd ui/server
->npm i
-
create
.env
file in both client and server -
Set
ENGINE_API_KEY
in the.env
files, https://engine.apollographql.com/, follow step 4 of the tutorial: https://www.apollographql.com/docs/tutorial/production/ -
Set service name in
apollo.config.js
:In the client folder:
module.exports = { client: { name: 'Holochain Multisig [web]', service: 'the name of your service set in step 4', }, };
In the server folder:
module.exports = { service: { name: 'the name of your service set in set in step 4' } }
-
cd ui/client
->npm run codegen
-
nix-shell
->cd dna
->hc test
orhc package
Run the Client
nix-shell
->sim2h_server
- Open another terminal on the root project, will run 2 agents(alice -> 8888, bob -> 8889)
nix-shell
->cd ui/client
->npm run start:holochain
- Open another terminal on the root project, will run two apollo server instances (alice->4000, bob->4001)
cd ui/client
->npm run start:apollo-server
- Build typescript objects, Open another terminal on the root project
cd ui/client
->npm run codegen
- Press any key when its done
- Run two UIs for each agent
cd ui/client
->npm run start:ui
- Navigate to http://localhost:8080 for Alice and http://localhost:8081 for Bob
Notes. To Test queries and mutations go to http://localhost:4000 for Alice and http://localhost:4001 for Bob