nostr is an open protocol used on open relays. The goal of this issue is to create a small usable client using Erlang/OTP functions and few external modules like Thoas and Gun.
[x] Try to connect to an open-relay using only the Erlang shell and external modules. In parallel document how the protocol is working using a modern browser like Firefox, Chromium or Brave with javascript client.
[x] Create a connection
[x] Request for events
[x] Create a key
[x] Stop a connection
[x] Create module nostr_client.erl
[x] Document the implementation
[x] Create tests when needed
Summary
At this time, these functions were created to design the client. They will probably change during the development process based on the nostr protocol requirements.
nostr is an open protocol used on open relays. The goal of this issue is to create a small usable client using Erlang/OTP functions and few external modules like Thoas and Gun.
nostr_client.erl
Summary
At this time, these functions were created to design the client. They will probably change during the development process based on the nostr protocol requirements.
nostr_client:connect/1
nostr_client:connect(Host)
nostr_client:connect/2
nostr_client:connect(Host, Options)
nostr_client:request/2
nostr_client:request(Reference, EventsId)
nostr_client:publish/2
nostr_client:publish(Reference, Event)
nostr_client:key/0
nostr_client:key()
nostr_client:disconnect/1
nostr_client:disconnect(Reference)
Specification
Work in progress.
References and Resources