これは、で書かれた鼻のリレーです タイプスクリプト。
この実装は運用環境に対応しています。サポートされている機能については、以下を参照してください。
プロジェクト マスター リポジトリは GitHub で入手できます。
リレー固有の実装を持つ NIP を次に示します。
created_at
警告: Snap、Brew、またはDebianリポジトリからのDockerディストリビューションはサポートされておらず、エラーが発生します。 公式ガイドからのみDockerをインストールしてください。
公式ガイドに従ってDockerデスクトップをインストールします。 別のガイドを使用してインストールした場合は、マシン上のDockerをアンインストールする必要があります。
リポジトリをクローンしてディレクトリを入力します。
git clone git@github.com:Cameri/nostream.git cd nostream
始める:
./scripts/start_local
これは、Ctrl + Cで停止するまでターミナルのフォアグラウンドで実行されます。
公式ガイドに従ってDockerをインストールします。 別のガイドを使用してインストールした場合は、Dockerをアンインストールする必要があります。
リポジトリをクローンしてディレクトリを入力します。
git clone git@github.com:Cameri/nostream.git cd nostream
始める:
./scripts/start
又は
./scripts/start_with_tor
次のようにしてサーバーを停止します。
./scripts/stop
Torホスト名を出力します。
./scripts/print_tor_hostname
デフォルトでは、このサーバーは、Ctrl + C で停止するか、システムが再起動するまで継続的に実行されます。
システムが再起動されるたびにサーバーを自動的に再実行する場合は、systemdサービスとしてインストールできます。例えば:
$ nano /etc/systemd/system/nostream.service # Note: replace "User=..." with your username, and # "/home/nostr/nostream" with the directory where you cloned the repo. [Unit] Description=Nostr TS Relay After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=5 User=nostr WorkingDirectory=/home/nostr/nostream ExecStart=/home/nostr/nostream/scripts/start ExecStop=/home/nostr/nostream/scripts/stop [Install] WantedBy=multi-user.target
それから:
systemctl enable nostream systemctl start nostream
ログは次のように表示できます。
journalctl -u nostream
次の環境変数を設定します。
DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay_test" or DB_HOST=localhost DB_PORT=5432 DB_NAME=nostr_ts_relay DB_USER=postgres DB_PASSWORD=postgres REDIS_URI="redis://default:nostr_ts_relay@localhost:6379" REDIS_HOST=localhost REDIS_PORT=6379 REDIS_USER=default REDIS_PASSWORD=nostr_ts_relay
データベースの作成:
nostr_ts_relay
$ psql -h $DB_HOST -p $DB_PORT -U $DB_USER -W postgres=# create database nostr_ts_relay; postgres=# quit
Redisを起動し、を使用してデフォルトのパスワードを設定し、以下を確認します。
redis-cli
$ redis-cli 127.0.0.1:6379> CONFIG SET requirepass "nostr_ts_relay" OK 127.0.0.1:6379> AUTH nostr_ts_relay Ok
リポジトリをクローンしてディレクトリを入力します。
git clone git@github.com:Cameri/nostream.git cd nostream
依存関係をインストールします。
npm install -g knex npm install
移行を実行します(少なくとも一度、新しい変更をプルした後):
npm run db:migrate
nostreamプロジェクトフォルダ内に.nostrフォルダを作成します。
mkdir .nostr
開発モードで開始するには:
npm run dev
または、実稼働モードで開始します。
npm run start
ビルドをクリーンアップするには、カバレッジ レポートとテスト レポートを実行します。
npm run clean
ターミナルを開き、プロジェクトのディレクトリに移動します。
cd /path/to/nostream
単体テストの実行方法:
npm run test:unit
または、ウォッチモードで単体テストを実行します。
npm run test:unit:watch
単体テストのカバレッジを取得するには、次のコマンドを実行します。
npm run cover:unit
単体テスト レポートをブラウザーで開くには:
.test-reports/unit/index.html
open .test-reports/unit/index.html
単体テスト カバレッジ レポートをブラウザーで開くには:
.coverage/unit/lcov-report/index.html
open .coverage/unit/lcov-report/index.html
ターミナルを開き、プロジェクトのディレクトリに移動します。
cd /path/to/nostream
以下を使用して統合テストを実行します。
npm run docker:test:integration
また、統合テストカバレッジを取得するには、次のコマンドを実行します。
npm run docker:cover:integration
ターミナルを開き、プロジェクトのディレクトリに移動します。
cd /path/to/nostream
Set the following environment variables:
DB_URI="postgresql://postgres:postgres@localhost:5432/nostr_ts_relay_test" or DB_HOST=localhost DB_PORT=5432 DB_NAME=nostr_ts_relay_test DB_USER=postgres DB_PASSWORD=postgres DB_MIN_POOL_SIZE=1 DB_MAX_POOL_SIZE=2
Then run the integration tests:
npm run test:integration
To see the integration tests report open with a browser:
.test-reports/integration/report.html
open .test-reports/integration/report.html
To get the integration test coverage run:
npm run cover:integration
To see the integration test coverage report open with a browser.
.coverage/integration/lcov-report/index.html
open .coverage/integration/lcov-report/index.html
You can change the default folder by setting the environment variable to a different path.
NOSTR_CONFIG_DIR
Run nostream using one of the quick-start guides at least once and will be created. Any changes made to the settings file will be read on the next start.
nostream/.nostr/settings.json
Default settings can be found under . Feel free to copy it to if you would like to have a settings file before running the relay first.
resources/default-settings.yaml
nostream/.nostr/settings.yaml
各環境変数と設定の詳細については、CONFIGURATION.md を参照してください。
開発の議論には、Nostrタイプスクリプトリレー開発グループを使用してください。
プロトコルに関する議論については、Nostrテレグラムグループを自由に使用してください。
私はほとんどのソーシャルネットワークでキャメリです。あなたはnpub1qqqqqqqyz0la2jjl752yv8h7wgs3v098mh9nztd4nr6gynaef6uqqt0n47mによってNostrで私を見つけることができます。
このプロジェクトはMITライセンスです。