Skip to content

feat: server identity parsing, relay list fetching, and fetch_events (CEP-17)#82

Open
harsh04044 wants to merge 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep17-pr1-identity-relay-discovery
Open

feat: server identity parsing, relay list fetching, and fetch_events (CEP-17)#82
harsh04044 wants to merge 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep17-pr1-identity-relay-discovery

Conversation

@harsh04044
Copy link
Copy Markdown

Part of CEP-17 implementation #80.

Adds all the standalone building blocks for client-side relay discovery - no transport wiring yet, that's PR 2.

What's new:

parse_server_identity() - accepts hex pubkey, npub, or nprofile. Extracts relay hints from nprofile for use in relay resolution later. NostrClientTransport now uses this instead of PublicKey::from_hex(), so nprofile identifiers work as serverPubkey today.

fetch_server_relay_list() - creates a temporary relay pool, connects to discovery relays, fetches kind 10002, returns parsed RelayListEntry vec with url + optional marker. Disconnects in all code paths.

select_operational_relay_urls() - picks operational relays from a relay list. Prefers unmarked entries, falls back to read+write union, deduplicates.

RelayPoolTrait::fetch_events() - added Vec variant to the trait and all impls (RelayPool, MockRelayPool, TestRelayPool). MockRelayPool also gets inject_event() for test setup.

@harsh04044 harsh04044 force-pushed the feat/cep17-pr1-identity-relay-discovery branch from 83d1f87 to de726a4 Compare May 21, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant