Skip to content

Commit

Permalink
update README.md with publish event to relay(s) instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastix committed Jun 18, 2024
1 parent 4087ec5 commit d8cf60f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,21 @@ $signer->signEvent($note, $private_key);
$eventMessage = new EventMessage($note);

$relayUrl = 'wss://nostr-websocket.tld';
$relay = new Relay($relayUrl, $eventMessage);
$relay = new Relay($relayUrl);
$relay->setMessage($eventMessage);
$result = $relay->send();
```

If you would like to publish the event to multiple relays, you can use the `RelaySet` class.

```php
$relay1 = new Relay(''wss://nostr-websocket1.tld'');
$relay2 = new Relay(''wss://nostr-websocket2.tld'');
$relay3 = new Relay(''wss://nostr-websocket3.tld'');
$relay4 = new Relay(''wss://nostr-websocket4.tld'');
$relaySet = new RelaySet();
$relaySet->setRelays([$relay1, $relay2, $relay3, $relay4]);
$relaySet->setMessage($eventMessage);
$result = $relay->send();
```

Expand Down

0 comments on commit d8cf60f

Please sign in to comment.