strfryをdockerで立てる
著名リレー実装の一つの
strfry をdockerで起動する方法。
1. docker-compose.yml
を作る
docker-compose.ymlversion: '3'
services:
strfry:
image: pluja/strfry:latest
restart: unless-stopped
volumes:
- type: bind
source: ./strfry.conf
target: /etc/strfry.conf
- ./strfry-db:/app/strfry-db
ports:
- "7777:7777"
2. strfry.conf
を入手する
bashwget https://raw.githubusercontent.com/hoytech/strfry/master/strfry.conf
3. strfry.conf
の44行目付近にある relay.bind
を 127.0.0.1
から 0.0.0.0
に書き換える
diff--- strfry.conf.old 2023-10-18 10:43:06
+++ strfry.conf 2023-10-18 10:33:48
@@ -41,7 +41,7 @@
relay {
# Interface to listen on. Use 0.0.0.0 to listen on all interfaces (restart required)
- bind = "127.0.0.1"
+ bind = "0.0.0.0"
# Port to open for the nostr websocket protocol (restart required)
port = 7777
4. 起動する
5. 動作確認する
bashecho '["REQ", "test", {"limit": 0}]' | websocat -n ws://localhost:7777 # 空のリクエスト
# ["EOSE","test"] が出力される