erDiagram
ocp2p_identity ||--o{ ocp2p_task_ledger : did_from
ocp2p_identity ||--o{ ocp2p_peer_route : did_peer
ocp2p_identity ||--o{ ocp2p_reputation_snapshot : did
ocp2p_identity ||--o{ ocp2p_chat_message : did_from_to
ocp2p_resource_meta ||--o{ ocp2p_subscription : resource
ocp2p_resource_meta ||--o{ ocp2p_chat_message : resource_msgs
ocp2p_identity {
bigint id PK
string did UK
string key_material_ref
json capabilities
}
ocp2p_task_ledger {
bigint id PK
string task_id UK
string idempotency_key
string status
string from_did
string to_did
string trace_id
}
ocp2p_peer_route {
bigint id PK
binary peer_node_id
string did
string host
int port
}
ocp2p_pairing_token {
bigint id PK
string code_hash
datetime expires_at
}
ocp2p_reputation_snapshot {
bigint id PK
string did
json score_json
bigint dht_seq
}
ocp2p_chat_message {
bigint id PK
string msg_id UK
string channel_id
string resource_id
string from_did
string to_did
string direction
string ack_state
bigint ts
}
ocp2p_resource_meta {
bigint id PK
string resource_id UK
string publisher_did
string kind
}
ocp2p_subscription {
bigint id PK
string resource_id
string subscriber_did
string status
bigint expires_at
}