Documentation / Reference / The code reference
The code reference
This page lists every name that protocol0 exports with 1 line on what it does and apps and tests use only these names.
Functions, classes and constants
These names exist when the program runs and an app can call or read them.
readyIt loads the sealing library and an app calls it once before any other function.
newKeyPairIt makes a new key pair for 1 computer or 1 app.
keyPairFromSeedIt makes the same key pair again from a 32 byte seed that is written in hex.
randomKeyIt makes a random secret key for sealing and writes it in hex.
publicOfIt returns the public half of a key pair and that half is safe to hand to others.
shortCodeIt turns a key or an entry code into 6 characters that a person can read.
canonicalIt writes a value as JSON with sorted keys and equal values give equal bytes.
EntryStoreIt holds the entries of 1 copy and keeps them in the fixed order of the record.
entryCodeIt returns the code of an entry and that code is the hash of the whole entry.
signEntryIt signs an unsigned entry with a secret signing key and returns the signed entry.
checkEntryShapeIt checks the shape and the signature of an entry and returns the reason when the check fails.
CopyA copy holds the record of 1 community on 1 computer and offers every call that writes or reads it.
ProtocolErrorA protocol error is what protocol0 throws when a call would break a rule.
TestClockA test clock is a clock that a test moves by hand so no test waits for real days.
systemClockIt returns a clock that follows the time of the computer.
DAYIt is the number of milliseconds in 1 day.
MemoryKeyStoreIt keeps keys in memory and they are gone when the program ends.
FileKeyStoreIt keeps keys in 1 plain JSON file and belongs in tests and made-up members only.
MemoryHubIt is a relay that lives inside 1 process and tests use it.
HttpRelayIt reaches a relay program over HTTP such as the one in the relay folder.
FolderStoreIt passes entries through 1 shared folder that all protocol0 apps of a user read.
syncIt sends the new entries of a copy to every transport, takes theirs and skips a silent transport.
syncDirectIt passes entries both ways between copies in 1 process until they hold the same entries.
neededIt returns how many signatures a body of a given size needs under a threshold.
isAllowedThresholdIt tells whether a threshold is more than half for every size of body.
MORE_THAN_HALFThis threshold needs more than half of the members and is the default of a new community.
TWO_OF_THREEThis threshold needs at least 2 of every 3 members.
EVERYONEThis threshold needs every member of the body to sign.
PROTOCOLIt holds the version of protocol0 and its code and the first entry of a record names both.
RULE_NAMESIt lists the 18 rules of protocol0 in order, and the code of the version is made from this list.
memberIdIt turns the first signing key of a member into the id of that member.
Types
These names exist only for TypeScript and are gone when the program runs.
KeyPairA key pair holds the signing key and the box key of 1 computer or app with their secret halves.
PublicKeyA public key holds the 2 public halves that name the key of a member to others.
EntryAn entry is 1 signed step of the record that names the entries it builds on.
UnsignedEntryAn unsigned entry is an entry before its signature is added.
ShareA share is a sealed key for 1 recipient that travels next to an entry.
AddResultAn add result tells whether a store took an entry and gives the reason when it did not.
WireItemA wire item is an entry with its code and its deletable words as copies pass it on.
ClockA clock is any object with a
nowfunction that returns the time in milliseconds.ThresholdA threshold states how many members of a body must sign as a fraction of the body.
ProtocolVersionA protocol version holds the version of protocol0 and its code of 6 characters.
SettingsSettings hold the numbers and choices of a constitution such as the relays and the life of a proposal.
PersonA person holds a name and no entry of the record holds an email.
FounderA founder is a person with a public key who is a member from the first entry on.
BodyRefA body reference names where a decision is taken and that is the group, a team or the community.
TeamPowerA team power is 1 of the 3 powers that a team can hold and these are
keep-pages,hide-postandpause-member.TeamSeedA team seed describes a team with its members, its pages and its powers when a decision makes it.
ChangeA change names what a proposal changes such as a page, the member list or the constitution.
ProposalStatusA proposal status is open, decided, closed, stopped, undone, out-of-date or replaced.
MemberViewA member view shows 1 member as a copy reads it with the keys, the status and the group.
GuestViewA guest view shows 1 guest with the member who invited the guest and whether a member let the guest in.
TeamViewA team view shows 1 team together with the decision that made it and the version of its member list.
PageVersionA page version holds the content of 1 version of a page and the decision that made it.
PageViewA page view shows a page with its keeper, its versions and its current content.
SubchatViewA sub chat view shows 1 sub chat, its parent and whether guests can read it.
PostViewA post view shows 1 post with its writer, its words and whether it is hidden.
ProposalViewA proposal view shows 1 proposal with its signatures, its number and its status.
ProofA proof lists the entries that show that a member signed 2 versions of the same proposal.
RefusalA refusal names an entry that a copy refused and gives the reason.
EntryViewAn entry view describes 1 entry in plain words and says whether the copy accepted it.
PauseViewA pause view shows a member whose posting is paused with the end date and the decision.
GroupInfoA group info holds the id, the name and the members of 1 group of a community.
GroupViewA group view holds everything a copy shows about a group such as members, pages, teams, posts and proposals.
ReceiveReportA receive report lists the entries that a copy added, the ones it refused and the ones that wait.
TransportA transport is anything that passes entries between copies with a
pushand apullcall.SyncReportA sync report lists the transports that answered, the ones that stayed silent and the entries received.
StartOptionsStart options hold everything that
Copy.starttakes such as the key, the founders and the pages.LoadOptionsLoad options hold the key and the entries that
Copy.loadtakes.ForceOptionsForce options let a test write an entry that breaks a rule on purpose.
KeyStoreA key store is anything that can get, put and list keys by name.
Next
Something wrong on this page