-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from holochain-gym/master
Sync fork with holochain-gym
- Loading branch information
Showing
32 changed files
with
4,377 additions
and
5,444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ docs/_merged_includes/ | |
node_modules/ | ||
_site-dev/ | ||
_site/ | ||
*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Intermediate >> Remote Call ||203 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# Holochain Gym | ||
|
||
Go to the [gym](https://holochain-gym.github.io). | ||
|
||
## Contributor Setup | ||
|
||
First, you need to be running node v14. An easy way to do this is to enter the nix-shell: | ||
|
||
```bash | ||
nix-shell -p nodejs-14_x | ||
``` | ||
|
||
Install the dependencies for the project: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Starting | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
This will start a server with hot reload that should open automatically. | ||
|
||
## Deploying to github pages | ||
|
||
```bash | ||
npm run gh-pages | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Creating a playground exercise | ||
|
||
1. Go to the [playground documentation](https://holochain-playground.github.io/elements/?path=/story/call-zome-fns--simple). | ||
- See which components are available and their options. | ||
- This list may grow soon, but the elements that are there should be quite stable. | ||
2. In the gym exercise, add this at the beginning of the markdown file: | ||
````js | ||
```js script | ||
import { html } from "lit-html"; | ||
import { | ||
HolochainPlaygroundContainer, | ||
EntryContents, | ||
EntryGraph, | ||
CallZomeFns, | ||
} from "@holochain-playground/elements"; | ||
customElements.define( | ||
"holochain-playground-container", | ||
HolochainPlaygroundContainer | ||
); | ||
customElements.define("entry-graph", EntryGraph); | ||
customElements.define("entry-contents", EntryContents); | ||
customElements.define("call-zome-fns", CallZomeFns); | ||
``` | ||
```` | ||
|
||
- Import the elements that you need from the documentation. If you'd need some other element, submit an issue in the playground repository. | ||
|
||
3. In the place that you want your interactive playground to appear, write the following: | ||
|
||
````js | ||
```js story | ||
const sampleZome = { | ||
name: "helloworld", | ||
entry_defs: [ | ||
{ | ||
id: "greeting", | ||
visibility: "Public", | ||
}, | ||
], | ||
zome_functions: { | ||
// Here you can code whatever functions you want your dna to have | ||
say_greeting: { | ||
call: ({ create_entry }) => ({ content }) => { | ||
return create_entry({ content, entry_def_id: "greeting" }); | ||
}, | ||
arguments: [{ name: "content", type: "String" }], | ||
}, | ||
}, | ||
}; | ||
const simulatedDnaTemplate = { | ||
zomes: [sampleZome], | ||
}; | ||
export const Simple = () => { | ||
return html` | ||
<holochain-playground-container | ||
.numberOfSimulatedConductors=${1} | ||
.simulatedDnaTemplate=${simulatedDnaTemplate} | ||
@ready=${(e) => { | ||
const conductor = e.detail.conductors[0]; | ||
|
||
const cellId = conductor.getAllCells()[0].cellId; | ||
|
||
e.target.activeAgentPubKey = cellId[1]; | ||
}} | ||
> | ||
<!-->Here you can put whatever elements you want to show<--> | ||
<div style="display: flex; flex-direction: row; align-items: start; margin-bottom: 20px;"> | ||
<call-zome-fns | ||
id="call-zome" | ||
style="height: 250px; margin-right: 20px;" | ||
hide-zome-selector | ||
hide-agent-pub-key | ||
hide-results | ||
> | ||
</call-zome-fns> | ||
<entry-contents style="flex-basis: 500px; height: 250px;"> </entry-contents> | ||
</div> | ||
<entry-graph | ||
show-entry-contents | ||
hide-filter | ||
.excludedEntryTypes=${["Agent"]} | ||
style="flex: 1; height: 500px;" | ||
> | ||
</entry-graph> | ||
</holochain-playground-container> | ||
`; | ||
}; | ||
``` | ||
```` | ||
|
||
|
||
You can also look at the numerous examples that you have available in this repository. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a href="https://developer.holochain.org/docs/concepts/" class="">Core Concepts</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a href="https://developer.holochain.org/docs/glossary/" class="">Glossary of Terms</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a href="https://forum.holochain.org/c/learning-library/gym/133" class="">Give us Feedback!</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
--- | ||
title: Architects | ||
eleventyNavigation: | ||
key: Architects | ||
order: 20 | ||
--- | ||
|
||
TBD |
Oops, something went wrong.