---
# System prepended metadata

title: Comments

---

# Comments

## Entry structs

```rust
struct Comment {
    content: String,
    comment_about_entry_hash: EntryHash,
    author_pub_key: AgentPubKey,
    timestamp: Timestamp, // To avoid collisions
}
```

## Zome Functions

- `add_comment(content: String, comment_about_entry_hash: EntryHash) -> ExternResult<EntryHash>`
    - Initialize Comment struct (use agent_info!() and sys_time!())
    - Create Comment entry
    - Link from the comment_about_entry_hash to the comment, with LinkTag = 'comment' (read String linktag from https://hackmd.io/p3VO8y-zTR-JcPds3GvwNw)
- `get_comments_for_entry(entry_hash: EntryHash) -> ExternResult<Vec<Comment>>`
    - get_links from entry_hash with LinkTag = 'comment'