WeaveDocs
Woven

dSocial

dSocial helpers in WOVEN — social-graph-friendly defaults for WOVEN events and feeds.

Purpose

Blockchainless decentralized app event protocol with spaces, event references, feeds, filters, transport, and dSocial helpers.

This page follows the real source shape for Woven and explains the workflow a developer is likely to use first.

Developer workflow

Start from the smallest constructor or builder, perform one meaningful operation, inspect the returned state, then add the relevant policy, storage, or network integration. The examples below should be expanded whenever the crate API changes.

Primary types to know

  • AggregatedEventRecord — models/woven/src/lib.rs
  • Event — models/woven/src/lib.rs
  • EventBuilder — models/woven/src/lib.rs
  • EventFilter — models/woven/src/lib.rs
  • EventRecord — models/woven/src/lib.rs
  • EventRef — models/woven/src/lib.rs
  • EventStream — models/woven/src/lib.rs
  • Follow — models/woven/src/lib.rs
  • NexusEventFeed — models/woven/src/lib.rs
  • Post — models/woven/src/lib.rs
  • Profile — models/woven/src/lib.rs
  • Reaction — models/woven/src/lib.rs

Example shape

use woven::dsocial::{Follow, Post, Profile, Reaction};
use woven::SpaceId;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let keypair = weave_crypto::key_pair(Some(&[7u8; 32]));
    let space = SpaceId::new("woven://dsocial/global")?;
    let author = "did:l1fe:agent:alice";
    let created_at = 1_777_130_000;

    // Each dSocial body has a typed builder and a strongly-typed event KIND.
    let profile_event = Profile::new("Alice")
        .bio("agent-curious")
        .avatar("locus://avatars/alice.png")
        .sign(author, space.clone(), created_at, &keypair)?;

    let post_event = Post::new("hello p2p web")
        .attachment("locus://posts/alice/cover.png")
        .sign(author, space.clone(), created_at + 1, &keypair)?;

    let follow_event = Follow::new("did:l1fe:agent:bob")
        .sign(author, space.clone(), created_at + 2, &keypair)?;

    let reaction_event = Reaction::new(post_event.id().clone(), "+")
        .sign(author, space, created_at + 3, &keypair)?;

    println!(
        "profile kind={} post kind={} follow kind={} reaction kind={}",
        profile_event.kind(),
        post_event.kind(),
        follow_event.kind(),
        reaction_event.kind(),
    );
    Ok(())
}