mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Addapt Docker
This commit is contained in:
parent
cbb063f06d
commit
6635722a96
@ -11,6 +11,9 @@ class Nostr:
|
||||
|
||||
async def send_order_event(self, order):
|
||||
"""Creates the event and sends it to the coordinator relay"""
|
||||
|
||||
print("Sending nostr event")
|
||||
|
||||
# Initialize with coordinator Keys
|
||||
keys = Keys.generate()
|
||||
signer = NostrSigner.keys(keys)
|
||||
|
@ -1,4 +1,3 @@
|
||||
import asyncio
|
||||
from celery import shared_task
|
||||
from celery.exceptions import SoftTimeLimitExceeded
|
||||
|
||||
@ -261,10 +260,7 @@ def nostr_send_order_event(order_id=None):
|
||||
order = Order.objects.get(id=order_id)
|
||||
|
||||
nostr = Nostr()
|
||||
coroutine = nostr.send_order_event(order)
|
||||
if coroutine:
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(coroutine)
|
||||
nostr.send_order_event(order)
|
||||
|
||||
return
|
||||
|
||||
|
@ -163,7 +163,6 @@ services:
|
||||
ports:
|
||||
- 8000:8000 # dev frontend build
|
||||
- 12596:12596 # umbrel frontend
|
||||
- 7777:7777 # nostr
|
||||
|
||||
lnd:
|
||||
build: ./docker/lnd
|
||||
@ -228,11 +227,12 @@ services:
|
||||
- ./node/db:/var/lib/postgresql/data
|
||||
|
||||
strfry:
|
||||
build: https://github.com/hoytech/strfry.git
|
||||
image: dockurr/strfry:0.9.6
|
||||
container_name: strfry-dev
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nodeapp/strfry/config/strfry.conf:/app/strfry.conf:r
|
||||
- ./node/strfry/db:/app/strfry-db
|
||||
- ./docker/strfry/config/strfry.conf:/etc/strfry.conf:r
|
||||
network_mode: service:tor
|
||||
|
||||
# # Postgresql for CLN
|
||||
|
@ -27,6 +27,7 @@ services:
|
||||
- "9998:9998"
|
||||
- "5432:5432"
|
||||
- "6379:6379"
|
||||
- "7777:7777"
|
||||
volumes:
|
||||
- bitcoin:/bitcoin/.bitcoin/
|
||||
- ./tests/bitcoind/entrypoint.sh:/entrypoint.sh
|
||||
@ -210,8 +211,8 @@ services:
|
||||
container_name: test-strfry
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nodeapp/strfry/db:/app/strfry-db
|
||||
- ./nodeapp/strfry/config/strfry.conf:/etc/strfry.conf:r
|
||||
- ./tests/strfry/db:/app/strfry-db
|
||||
- ./tests/strfry/config/strfry.conf:/etc/strfry.conf:r
|
||||
network_mode: service:bitcoind
|
||||
|
||||
volumes:
|
||||
|
138
docker/strfry/config/strfry.conf
Normal file
138
docker/strfry/config/strfry.conf
Normal file
@ -0,0 +1,138 @@
|
||||
##
|
||||
## Default strfry config
|
||||
##
|
||||
|
||||
# Directory that contains the strfry LMDB database (restart required)
|
||||
db = "./strfry-db/"
|
||||
|
||||
dbParams {
|
||||
# Maximum number of threads/processes that can simultaneously have LMDB transactions open (restart required)
|
||||
maxreaders = 256
|
||||
|
||||
# Size of mmap() to use when loading LMDB (default is 10TB, does *not* correspond to disk-space used) (restart required)
|
||||
mapsize = 10995116277760
|
||||
|
||||
# Disables read-ahead when accessing the LMDB mapping. Reduces IO activity when DB size is larger than RAM. (restart required)
|
||||
noReadAhead = false
|
||||
}
|
||||
|
||||
events {
|
||||
# Maximum size of normalised JSON, in bytes
|
||||
maxEventSize = 65536
|
||||
|
||||
# Events newer than this will be rejected
|
||||
rejectEventsNewerThanSeconds = 900
|
||||
|
||||
# Events older than this will be rejected
|
||||
rejectEventsOlderThanSeconds = 94608000
|
||||
|
||||
# Ephemeral events older than this will be rejected
|
||||
rejectEphemeralEventsOlderThanSeconds = 60
|
||||
|
||||
# Ephemeral events will be deleted from the DB when older than this
|
||||
ephemeralEventsLifetimeSeconds = 300
|
||||
|
||||
# Maximum number of tags allowed
|
||||
maxNumTags = 2000
|
||||
|
||||
# Maximum size for tag values, in bytes
|
||||
maxTagValSize = 1024
|
||||
}
|
||||
|
||||
relay {
|
||||
# Interface to listen on. Use 0.0.0.0 to listen on all interfaces (restart required)
|
||||
bind = "0.0.0.0"
|
||||
|
||||
# Port to open for the nostr websocket protocol (restart required)
|
||||
port = 7777
|
||||
|
||||
# Set OS-limit on maximum number of open files/sockets (if 0, don't attempt to set) (restart required)
|
||||
nofiles = 1000000
|
||||
|
||||
# HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case)
|
||||
realIpHeader = ""
|
||||
|
||||
info {
|
||||
# NIP-11: Name of this server. Short/descriptive (< 30 characters)
|
||||
name = "Robosats"
|
||||
|
||||
# NIP-11: Detailed information about relay, free-form
|
||||
description = "Federation cache system."
|
||||
|
||||
# NIP-11: Administrative nostr pubkey, for contact purposes
|
||||
pubkey = ""
|
||||
|
||||
# NIP-11: Alternative administrative contact (email, website, etc)
|
||||
contact = ""
|
||||
}
|
||||
|
||||
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
|
||||
maxWebsocketPayloadSize = 131072
|
||||
|
||||
# Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts) (restart required)
|
||||
autoPingSeconds = 55
|
||||
|
||||
# If TCP keep-alive should be enabled (detect dropped connections to upstream reverse proxy)
|
||||
enableTcpKeepalive = false
|
||||
|
||||
# How much uninterrupted CPU time a REQ query should get during its DB scan
|
||||
queryTimesliceBudgetMicroseconds = 10000
|
||||
|
||||
# Maximum records that can be returned per filter
|
||||
maxFilterLimit = 500
|
||||
|
||||
# Maximum number of subscriptions (concurrent REQs) a connection can have open at any time
|
||||
maxSubsPerConnection = 3
|
||||
|
||||
writePolicy {
|
||||
# If non-empty, path to an executable script that implements the writePolicy plugin logic
|
||||
plugin = ""
|
||||
}
|
||||
|
||||
compression {
|
||||
# Use permessage-deflate compression if supported by client. Reduces bandwidth, but slight increase in CPU (restart required)
|
||||
enabled = true
|
||||
|
||||
# Maintain a sliding window buffer for each connection. Improves compression, but uses more memory (restart required)
|
||||
slidingWindow = false
|
||||
}
|
||||
|
||||
logging {
|
||||
# Dump all incoming messages
|
||||
dumpInAll = false
|
||||
|
||||
# Dump all incoming EVENT messages
|
||||
dumpInEvents = false
|
||||
|
||||
# Dump all incoming REQ/CLOSE messages
|
||||
dumpInReqs = false
|
||||
|
||||
# Log performance metrics for initial REQ database scans
|
||||
dbScanPerf = false
|
||||
|
||||
# Log reason for invalid event rejection? Can be disabled to silence excessive logging
|
||||
invalidEvents = true
|
||||
}
|
||||
|
||||
numThreads {
|
||||
# Ingester threads: route incoming requests, validate events/sigs (restart required)
|
||||
ingester = 3
|
||||
|
||||
# reqWorker threads: Handle initial DB scan for events (restart required)
|
||||
reqWorker = 3
|
||||
|
||||
# reqMonitor threads: Handle filtering of new events (restart required)
|
||||
reqMonitor = 3
|
||||
|
||||
# negentropy threads: Handle negentropy protocol messages (restart required)
|
||||
negentropy = 2
|
||||
}
|
||||
|
||||
negentropy {
|
||||
# Support negentropy protocol messages
|
||||
enabled = true
|
||||
|
||||
# Maximum records that sync will process before returning an error
|
||||
maxSyncEvents = 1000000
|
||||
}
|
||||
}
|
@ -37,6 +37,14 @@ location /mainnet/exp/ws/ {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /mainnet/exp/nostr/ {
|
||||
proxy_pass http://mainnet_exp/nostr/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# Experimental Coordinator Testnet Locations
|
||||
location /test/exp/static/assets/avatars/ {
|
||||
proxy_pass http://testnet_exp/static/assets/avatars/;
|
||||
|
@ -37,6 +37,14 @@ location /mainnet/lake/ws/ {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /mainnet/lake/nostr/ {
|
||||
proxy_pass http://mainnet_lake/nostr/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# TheBigLake Coordinator Testnet Locations
|
||||
location /test/lake/static/assets/avatars/ {
|
||||
proxy_pass http://testnet_lake/static/assets/avatars/;
|
||||
|
@ -37,6 +37,14 @@ location /mainnet/satstralia/ws/ {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /mainnet/satstralia/nostr/ {
|
||||
proxy_pass http://mainnet_satstralia/nostr/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# Satstralia Coordinator Testnet Locations
|
||||
location /test/satstralia/static/assets/avatars/ {
|
||||
proxy_pass http://testnet_satstralia/static/assets/avatars/;
|
||||
|
@ -37,6 +37,14 @@ location /mainnet/temple/ws/ {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /mainnet/temple/nostr/ {
|
||||
proxy_pass http://mainnet_temple/nostr/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# Temple of Sats Coordinator Testnet Locations
|
||||
location /test/temple/static/assets/avatars/ {
|
||||
proxy_pass http://testnet_temple/static/assets/avatars/;
|
||||
|
@ -37,6 +37,14 @@ location /mainnet/veneto/ws/ {
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location /mainnet/veneto/nostr/ {
|
||||
proxy_pass http://mainnet_veneto/nostr/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# BitcoinVeneto Coordinator Testnet Locations
|
||||
location /test/veneto/static/assets/avatars/ {
|
||||
proxy_pass http://testnet_veneto/static/assets/avatars/;
|
||||
|
@ -64,6 +64,14 @@ http {
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
location /nostr {
|
||||
proxy_pass http://127.0.0.1:7777;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ relay {
|
||||
maxFilterLimit = 500
|
||||
|
||||
# Maximum number of subscriptions (concurrent REQs) a connection can have open at any time
|
||||
maxSubsPerConnection = 20
|
||||
maxSubsPerConnection = 3
|
||||
|
||||
writePolicy {
|
||||
# If non-empty, path to an executable script that implements the writePolicy plugin logic
|
||||
@ -94,7 +94,7 @@ relay {
|
||||
enabled = true
|
||||
|
||||
# Maintain a sliding window buffer for each connection. Improves compression, but uses more memory (restart required)
|
||||
slidingWindow = true
|
||||
slidingWindow = false
|
||||
}
|
||||
|
||||
logging {
|
@ -52,6 +52,14 @@ http {
|
||||
alias /serve_misc/;
|
||||
}
|
||||
|
||||
location /nostr {
|
||||
proxy_pass http://127.0.0.1:7777;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user