So, if you arrived at this point, you might be thinking: "oh okey, I'm beginning to get this! Where should I go next as I'm learning this?"
If this is the case, we'd love for you to join our developer community! Click here. It's the best place to collaborate and learn from each other.
A good way to think about the public DHT holochain data is like a graph: entries are nodes, and links are the edges that connect the entries.
A link has 3 basic properties:
- A base entry
- A target entry
- A tag with arbitrary content
To get a better sense of links, try creating a link between two entries:
- Create an entry with some content with the
- Create a different entry with the same function (remember, if you create an entry with the same content, it won't be a different entry).
- Switch to the
- Click one of the entries from the graph. Copy the "Entry Hash" you see in "Entry Detail" and paste it in the
- Click on the other entry, and copy its hash to the
- If you want, input some example tag.
- Click execute!
Now you should see the two entries linked together.
Great! Now you might be thinking: what do we do with links? Links are useful to attach metadata to entries, without having to change its content (and if we don't change the content, the hash doesn't change either).
Here we have some posts created, with a link from the author public key to all the posts they have created.
Try creating some posts and see how the entries behave, and try to do a
get_links with the public key of the author to get the links to all the posts that that agent has created. You can get the public key of the author by clicking on the
Agent entry and copying the hash of that entry. All agents create an initial
Agent entry when they join the network, in order to be identified by other peers in that DHT.
- Go to the
- Enter the nix-shell:
nix-shell. you should run this in the folder containing the default.nix file. starting the nix-shell for the very first time might take a long time, somewhere between 20 to 80 minutes, after that it will take just a few seconds.
- Implement the functions
- Compile and test your code:
cd tests && npm install && npm test.
- Don't stop until the test runs green.