Search documentation of macula

# macula_content_system (macula v0.44.2)

View Source

Supervisor for Macula content-addressed storage system.

Manages the lifecycle of content system child processes: - macula_content_store: Local block and manifest storage - macula_content_transfer: Want/have/block exchange protocol

### Supervision Strategy

Uses one_for_one strategy - if a child dies, only that child is restarted. This is appropriate because: - Store and Transfer can operate independently - Store failure shouldn't affect in-flight transfers - Transfer failure shouldn't corrupt storage

### Integration

Add to macula_root.erl supervision tree:

       #{id => macula_content_system,
         start => {macula_content_system, start_link, [#{}]},
         type => supervisor}

# Summary

## Functions

child_specs(Opts)

Get child specifications for external inspection/testing.

start_link(Opts)

Start the content system supervisor. Options: - store_path: Base directory for block storage - node_id: This node's identifier for transfer protocol

strategy()

Get the supervision strategy.

# Functions

# child_specs(Opts)

    -spec child_specs(map()) -> [supervisor:child_spec()].

Get child specifications for external inspection/testing.

# start_link(Opts)

    -spec start_link(map()) -> {ok, pid()} | {error, term()}.

Start the content system supervisor. Options: - store_path: Base directory for block storage - node_id: This node's identifier for transfer protocol

# strategy()

    -spec strategy() -> {ok, supervisor:strategy()}.

Get the supervision strategy.