feat(examples): add {p,r}/n2p5/loci #3338
Open
+198
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
loci (package and realm)
This is a realm I've developed as part of a larger project I have in the works. While I have a specific purpose for it, the loci realm is free to be used by anyone who wants to have a mutable data store for placing a byte slice tied to their caller address. This can be useful for pointing to other immutable data.
loci
is a single purpose datastore keyed by the caller's address. It has two functions: Set and Get.loci is plural for locus, which is a central or core place where something is found or from which it originates.
In this case, it's a simple key-value store where an address (the key) can store exactly one value (in the form of a byte slice).
Only the caller can set the value for their address, but anyone can retrieve the value for any address.