Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

memba_feed_v1 state

Back to all declarations

MaxBodyLen

untyped bigint

// post body (roadmap 4.1)

Value

(1000 <untyped> bigint)

MaxMediaCIDs

untyped bigint

// stored per post; pin/serve pipeline is P2

Value

(4 <untyped> bigint)

MaxCIDLen

untyped bigint

// defensive cap on a single CID string

Value

(128 <untyped> bigint)

FeedPageSize

untyped bigint

// posts per rendered page / default JSON window

Value

(20 <untyped> bigint)

MaxPageLimit

untyped bigint

// hard cap on any JSON read window (DoS guard)

Value

(100 <untyped> bigint)

MaxRenderPage

untyped bigint

// deepest gnoweb page; beyond → use the cursor API

Value

(50 <untyped> bigint)

MaxRepliesPerPost

untyped bigint

Value

(500 <untyped> bigint)

FlagThreshold

untyped bigint

// unique flags before auto-hide

Value

(5 <untyped> bigint)

MinAccountAgeForFlag

untyped bigint

// blocks since first post (~1-2h)

Value

(1200 <untyped> bigint)

FlagsPerDayBudget

untyped bigint

// per address per BlocksPerDay window

Value

(10 <untyped> bigint)

BlocksPerDay

untyped bigint

// ~5s blocks; approximation is fine

Value

(17280 <untyped> bigint)

MinPostIntervalBlocks

untyped bigint

Value

(2 <untyped> bigint)

YoungMinPostIntervalBlocks

untyped bigint

Value

(12 <untyped> bigint)

YoungAccountBlocks

untyped bigint

// first ~day

Value

(17280 <untyped> bigint)

Post

type

Value

memba_feed_v1.Post

flagBudget

type

Value

memba_feed_v1.flagBudget

posts

*avl.Tree

// padID(id) -> \*Post (live + hidden + not-yet-swept tombstones)

Open
OID
0a00bd…f2d6:78
posts details

Inspect pointer

byAuthor

*avl.Tree

// author + ":" + padID(id) -> true

Open
OID
0a00bd…f2d6:82
byAuthor details

Inspect pointer

byParent

*avl.Tree

// padID(parent) + ":" + padID(child) -> true

Open
OID
0a00bd…f2d6:84
byParent details

Inspect pointer

liveCount

uint64

// number of keys in liveFeed

Value

0

replyCount

*avl.Tree

// padID(parent) -> uint64 (live replies)

Open
OID
0a00bd…f2d6:86
replyCount details

Inspect pointer

nextPostID

uint64

// monotonic; NEVER iterated by reads

Value

1

lastPostH

*avl.Tree

// addr -> int64 (last CreatePost height)

Open
OID
0a00bd…f2d6:88
lastPostH details

Inspect pointer

firstSeenH

*avl.Tree

// addr -> int64 (first write interaction height)

Open
OID
0a00bd…f2d6:90
firstSeenH details

Inspect pointer

flags

*avl.Tree

// padID(id) -> \*avl.Tree (flagger addr -> true)

Open
OID
0a00bd…f2d6:92
flags details

Inspect pointer

flagSpend

*avl.Tree

// addr -> \*flagBudget

Open
OID
0a00bd…f2d6:94
flagSpend details

Inspect pointer

tombstones

*avl.Tree

// padID(id) -> true

Open
OID
0a00bd…f2d6:100
tombstones details

Inspect pointer

paused

bool

Value

false

owner

.uverse.address

Value

<gnolang.StringValue>

padID

func(id uint64) string

padID zero-pads to 12 digits so AVL string order == numeric order. 12 digits ≥ 31,000 years of one post per block — effectively unbounded.

Open
OID
0a00bd…f2d6:21
padID details

Inspect func

getPost

func(id uint64) (*memba_feed_v1.Post, bool)
Open
OID
0a00bd…f2d6:22
getPost details

Inspect func

mustGetPost

func(id uint64) *memba_feed_v1.Post
Open
OID
0a00bd…f2d6:23
mustGetPost details

Inspect func

authorKey

func(addr .uverse.address, id uint64) string
Open
OID
0a00bd…f2d6:24
authorKey details

Inspect func

parentKey

func(parent uint64, child uint64) string
Open
OID
0a00bd…f2d6:25
parentKey details

Inspect func

getReplyCount

func(parent uint64) uint64
Open
OID
0a00bd…f2d6:26
getReplyCount details

Inspect func

addToLiveIndexes

func(p *memba_feed_v1.Post)

addToLiveIndexes registers a visible post in every live index (B1). A reply is only linked into its parent's byParent/replyCount indexes when the parent is still LIVE. On CreatePost the parent was just verified live, so this is always true there. The guard matters on the UnhidePost re-add path: if the parent was deleted+swept while the reply sat hidden, re-linking would recreate an orphan byParent/replyCount entry under a parent id no longer in \`posts\` (never sweepable again) — the exact leak SweepTombstones' byParent-prefix cleanup was added to prevent. An unhidden reply whose parent is gone simply becomes standalone live content, which is how a reply to a removed parent is already treated everywhere else.

Open
OID
0a00bd…f2d6:27
addToLiveIndexes details

Inspect func

removeFromLiveIndexes

func(p *memba_feed_v1.Post)

removeFromLiveIndexes drops a post from every live index (hide/delete).

Open
OID
0a00bd…f2d6:28
removeFromLiveIndexes details

Inspect func

assertCallerIsOwner

func()
Open
OID
0a00bd…f2d6:30
assertCallerIsOwner details

Inspect func

touchFirstSeen

func(addr .uverse.address, h int64)

touchFirstSeen records the first write interaction height for an address.

Open
OID
0a00bd…f2d6:31
touchFirstSeen details

Inspect func

accountAge

func(addr .uverse.address, now int64) int64
Open
OID
0a00bd…f2d6:32
accountAge details

Inspect func

TransferOwnership

func(newOwner .uverse.address)

TransferOwnership moves realm ownership (deployer multisig rotation).

Open
OID
0a00bd…f2d6:36
TransferOwnership details

Inspect func

CreatePost

func(body string, replyTo uint64) uint64

CreatePost publishes a post (replyTo == 0) or a reply (replyTo == parent id). Open write: any wallet, subject to the block cooldown and body caps. Returns the new post id.

Open
OID
0a00bd…f2d6:38
CreatePost details

Inspect func

EditPost

func(id uint64, newBody string)

EditPost lets the author replace the body of a visible post.

Open
OID
0a00bd…f2d6:39
EditPost details

Inspect func

DeletePost

func(id uint64)

DeletePost soft-deletes the author's own post: content cleared, dropped from every live index (frees render slots immediately — B1), queued for hard-GC (B2). Replies stay: they render as replies to an unavailable post.

Open
OID
0a00bd…f2d6:40
DeletePost details

Inspect func

FlagPost

func(id uint64)

FlagPost files a community flag. Guards, in order: - flag rights are EARNED BY PARTICIPATION: the caller must have a firstSeen record (anchored by their first successful CreatePost) at least MinAccountAgeForFlag blocks old. A failed flag cannot anchor age itself — an on-chain abort reverts every write in the tx, so recording firstSeen here and then panicking would revert the record and deadlock pure flaggers; requiring a prior post is the honest, implementable account-age gate (realms cannot query global account age); - one flag per address per post; - per-day flag budget per address (blunts coordinated flag-brigades). At FlagThreshold unique flags the post auto-hides (reversible via UnhidePost).

Open
OID
0a00bd…f2d6:41
FlagPost details

Inspect func

reactionEmojis

[]string (len=9)

reactionEmojis is the fixed on-chain reaction set. Changing it is a realm version bump (redeploy), so it is deliberately small and stable.

Open
OID
0a00bd…f2d6:43
reactionEmojis details (len=9)

+9 more Inspect slice

isReactionEmoji

func(e string) bool
Open
OID
0a00bd…f2d6:44
isReactionEmoji details

Inspect func

reactionSubKey

func(emoji string, addr .uverse.address) string

reactionSubKey namespaces a reactor's entry within a post's reaction tree. The NUL separator cannot appear in a fixed-set emoji or a bech32 address, so (emoji, addr) round-trips unambiguously.

Open
OID
0a00bd…f2d6:45
reactionSubKey details

Inspect func

HasReacted

func(id uint64, emoji string, addr .uverse.address) bool

HasReacted reports whether addr currently has the given emoji on the post. O(log n) point lookup — never a scan.

Open
OID
0a00bd…f2d6:46
HasReacted details

Inspect func

AddReaction

func(id uint64, emoji string)

AddReaction records the caller's emoji reaction. A repeat aborts (rather than no-op) so an optimistic client's double-tap cannot silently burn gas twice — the client gates the button on HasReacted / indexed state.

Open
OID
0a00bd…f2d6:47
AddReaction details

Inspect func

RemoveReaction

func(id uint64, emoji string)

RemoveReaction removes the caller's emoji reaction (toggle-off). Allowed even on a hidden/deleted post so a reactor can always retract; aborts if the caller had not reacted with that emoji.

Open
OID
0a00bd…f2d6:48
RemoveReaction details

Inspect func

assertCallerIsOwnerOrModerator

func()
Open
OID
0a00bd…f2d6:49
assertCallerIsOwnerOrModerator details

Inspect func

IsModerator

func(addr .uverse.address) bool

IsModerator reports whether addr currently holds the moderator role.

Open
OID
0a00bd…f2d6:50
IsModerator details

Inspect func

AddModerator

func(addr .uverse.address)

AddModerator grants the moderator role (owner only).

Open
OID
0a00bd…f2d6:51
AddModerator details

Inspect func

RemoveModerator

func(addr .uverse.address)

RemoveModerator revokes the moderator role (owner only).

Open
OID
0a00bd…f2d6:52
RemoveModerator details

Inspect func

ModRemovePost

func(id uint64)

ModRemovePost permanently hides a post by moderation. Emits an audited ModAction. The node is tombstoned for hard-GC like an author delete.

Open
OID
0a00bd…f2d6:53
ModRemovePost details

Inspect func

UnhidePost

func(id uint64)

UnhidePost clears flags and restores a flag-hidden post to the live set.

Open
OID
0a00bd…f2d6:54
UnhidePost details

Inspect func

SweepTombstones

func(limit int) int

SweepTombstones hard-removes up to \`limit\` soft-deleted posts, reclaiming AVL storage so post+delete spam cannot accrete permanent state. Permissionless by design (state-shrink hygiene primitive, not a refund path). Bounded + idempotent: keep \`limit\` small (1-10); re-running drains the next batch and stops at 0. Returns the number of posts swept. For a swept post that was a PARENT, its surviving replies' byParent links (\`padID(parent):padID(child)\`) would otherwise be orphaned under an id no longer in \`posts\` — a permanent leak plus a read inconsistency (replies still enumerable, getReplyCount() disagreeing). So the sweep range-deletes that byParent prefix; the reply posts themselves stay as standalone live content (their parent was removed by its own author). Bounded because the live reply set per post is capped at MaxRepliesPerPost — but a reply-heavy parent makes one sweep step do up to that many removes, so keep \`limit\` small (1) when draining known reply-heavy tombstones.

Open
OID
0a00bd…f2d6:55
SweepTombstones details

Inspect func

GetTombstoneCount

func() int

GetTombstoneCount returns how many soft-deleted posts await hard-GC.

Open
OID
0a00bd…f2d6:56
GetTombstoneCount details

Inspect func

jsonEscape

func(s string) string

jsonEscape escapes a string for embedding in a JSON string literal.

Open
OID
0a00bd…f2d6:57
jsonEscape details

Inspect func

postJSON

func(p *memba_feed_v1.Post) string

postJSON is the qeval read fallback. Note it exposes \`mediaCids\` (P2) and \`repostOf\` (P1) which the CANONICAL indexed path (chain.Emit → backend → feed\_rpc → UI) does NOT carry yet — PostCreated emits neither, the proto reserves repost\_of, and there is no media column. A future dev wiring the qeval fallback must not assume those two are plumbed end-to-end.

Open
OID
0a00bd…f2d6:58
postJSON details

Inspect func

clampLimit

func(limit int) int
Open
OID
0a00bd…f2d6:60
clampLimit details

Inspect func

GetPostJSON

func(id uint64) string

GetPostJSON returns one post (any state — the indexer needs tombstones too).

Open
OID
0a00bd…f2d6:61
GetPostJSON details

Inspect func

listWindow

func(tree *avl.Tree, cursorKey string, limit int, extract func(...)) []uint64

listWindow walks \`tree\` REVERSE (newest first) starting below cursorKey ("" = from the newest), collecting up to limit ids via extract.

Open
OID
0a00bd…f2d6:62
listWindow details

Inspect func

idFromPadded

func(key string) uint64
Open
OID
0a00bd…f2d6:63
idFromPadded details

Inspect func

idFromComposite

func(key string) uint64
Open
OID
0a00bd…f2d6:64
idFromComposite details

Inspect func

idsToJSON

func(ids []uint64) string
Open
OID
0a00bd…f2d6:65
idsToJSON details

Inspect func

ListFeedJSON

func(cursor uint64, limit int) string

ListFeedJSON returns the newest live posts strictly older than cursor (cursor == 0 → from the top). Pass the last id of the previous window as the next cursor. ReverseIterate treats BOTH bounds as inclusive (avl/v0 TraverseInRange), so "strictly older than cursor" = end bound padID(cursor-1): ids are integers, keys are fixed-width, hence key \< padID(cursor) ⟺ key ≤ padID(cursor-1).

Open
OID
0a00bd…f2d6:66
ListFeedJSON details

Inspect func

ListUserJSON

func(addr string, cursor uint64, limit int) string

ListUserJSON returns a user's newest live posts strictly older than cursor (same inclusive-bound rule as ListFeedJSON).

Open
OID
0a00bd…f2d6:67
ListUserJSON details

Inspect func

ListRepliesJSON

func(parent uint64, cursor uint64, limit int) string

ListRepliesJSON returns a post's live replies, OLDEST first (conversation order), starting strictly after cursor (0 → from the beginning).

Open
OID
0a00bd…f2d6:68
ListRepliesJSON details

Inspect func

GetStatsJSON

func() string

GetStatsJSON returns realm-level counters (monotonic id is informational — no read iterates it).

Open
OID
0a00bd…f2d6:69
GetStatsJSON details

Inspect func

collectPage

func(tree *avl.Tree, prefix string, endKey string, k uint64) []uint64

collectPage walks a live index reverse and returns the ids for window k (1-based). Scan is bounded: k is capped at MaxRenderPage by callers.

Open
OID
0a00bd…f2d6:71
collectPage details

Inspect func

renderPostLine

func(sb *strings.Builder, p *memba_feed_v1.Post)
Open
OID
0a00bd…f2d6:72
renderPostLine details

Inspect func

renderFeedPage

func(k uint64) string
Open
OID
0a00bd…f2d6:73
renderFeedPage details

Inspect func

renderUserPage

func(addr string, k uint64) string
Open
OID
0a00bd…f2d6:74
renderUserPage details

Inspect func

renderPost

func(id uint64) string
Open
OID
0a00bd…f2d6:75
renderPost details

Inspect func

truncAddr

func(addr .uverse.address) string
Open
OID
0a00bd…f2d6:76
truncAddr details

Inspect func

sanitizeForRender

func(s string) string

sanitizeForRender strips markdown-sensitive characters to prevent injection.

Open
OID
0a00bd…f2d6:77
sanitizeForRender details

Inspect func
MaxBodyLen : untyped bigint =(1000 <untyped> bigint)
MaxMediaCIDs : untyped bigint =(4 <untyped> bigint)
MaxCIDLen : untyped bigint =(128 <untyped> bigint)
FeedPageSize : untyped bigint =(20 <untyped> bigint)
MaxPageLimit : untyped bigint =(100 <untyped> bigint)
MaxRenderPage : untyped bigint =(50 <untyped> bigint)
MaxRepliesPerPost : untyped bigint =(500 <untyped> bigint)
FlagThreshold : untyped bigint =(5 <untyped> bigint)
MinAccountAgeForFlag : untyped bigint =(1200 <untyped> bigint)
FlagsPerDayBudget : untyped bigint =(10 <untyped> bigint)
BlocksPerDay : untyped bigint =(17280 <untyped> bigint)
MinPostIntervalBlocks : untyped bigint =(2 <untyped> bigint)
YoungMinPostIntervalBlocks : untyped bigint =(12 <untyped> bigint)
YoungAccountBlocks : untyped bigint =(17280 <untyped> bigint)
Post : type =memba_feed_v1.Post
flagBudget : type =memba_feed_v1.flagBudget
posts : *avl.Tree Inspect
liveFeed : *avl.Tree Inspect
byAuthor : *avl.Tree Inspect
byParent : *avl.Tree Inspect
liveCount : uint64 =0
replyCount : *avl.Tree Inspect
nextPostID : uint64 =1
lastPostH : *avl.Tree Inspect
firstSeenH : *avl.Tree Inspect
flags : *avl.Tree Inspect
flagSpend : *avl.Tree Inspect
reactions : *avl.Tree Inspect
tombstones : *avl.Tree Inspect
moderators : *avl.Tree Inspect
paused : bool =false
owner : .uverse.address =<gnolang.StringValue>
init.32 : func() Inspect
padID : func(id uint64) string Inspect
getPost : func(id uint64) (*memba_feed_v1.Post, bool) Inspect
mustGetPost : func(id uint64) *memba_feed_v1.Post Inspect
authorKey : func(addr .uverse.address, id uint64) string Inspect
parentKey : func(parent uint64, child uint64) string Inspect
getReplyCount : func(parent uint64) uint64 Inspect
addToLiveIndexes : func(p *memba_feed_v1.Post) Inspect
removeFromLiveIndexes : func(p *memba_feed_v1.Post) Inspect
assertNotPaused : func() Inspect
assertCallerIsOwner : func() Inspect
touchFirstSeen : func(addr .uverse.address, h int64) Inspect
accountAge : func(addr .uverse.address, now int64) int64 Inspect
PauseRealm : func() Inspect
UnpauseRealm : func() Inspect
IsPaused : func() bool Inspect
TransferOwnership : func(newOwner .uverse.address) Inspect
GetOwner : func() .uverse.address Inspect
CreatePost : func(body string, replyTo uint64) uint64 Inspect
EditPost : func(id uint64, newBody string) Inspect
DeletePost : func(id uint64) Inspect
FlagPost : func(id uint64) Inspect
reactionEmojis : []string (len=9) Inspect
isReactionEmoji : func(e string) bool Inspect
reactionSubKey : func(emoji string, addr .uverse.address) string Inspect
HasReacted : func(id uint64, emoji string, addr .uverse.address) bool Inspect
AddReaction : func(id uint64, emoji string) Inspect
RemoveReaction : func(id uint64, emoji string) Inspect
assertCallerIsOwnerOrModerator : func() Inspect
IsModerator : func(addr .uverse.address) bool Inspect
AddModerator : func(addr .uverse.address) Inspect
RemoveModerator : func(addr .uverse.address) Inspect
ModRemovePost : func(id uint64) Inspect
UnhidePost : func(id uint64) Inspect
SweepTombstones : func(limit int) int Inspect
GetTombstoneCount : func() int Inspect
jsonEscape : func(s string) string Inspect
postJSON : func(p *memba_feed_v1.Post) string Inspect
boolStr : func(b bool) string Inspect
clampLimit : func(limit int) int Inspect
GetPostJSON : func(id uint64) string Inspect
listWindow : func(tree *avl.Tree, cursorKey string, limit int, extract func(...)) []uint64 Inspect
idFromPadded : func(key string) uint64 Inspect
idFromComposite : func(key string) uint64 Inspect
idsToJSON : func(ids []uint64) string Inspect
ListFeedJSON : func(cursor uint64, limit int) string Inspect
ListUserJSON : func(addr string, cursor uint64, limit int) string Inspect
ListRepliesJSON : func(parent uint64, cursor uint64, limit int) string Inspect
GetStatsJSON : func() string Inspect
Render : func(path string) string Inspect
collectPage : func(tree *avl.Tree, prefix string, endKey string, k uint64) []uint64 Inspect
renderPostLine : func(sb *strings.Builder, p *memba_feed_v1.Post) Inspect
renderFeedPage : func(k uint64) string Inspect
renderUserPage : func(addr string, k uint64) string Inspect
renderPost : func(id uint64) string Inspect
truncAddr : func(addr .uverse.address) string Inspect
sanitizeForRender : func(s string) string Inspect