PoW Pub

Artifact [b8ffe553e5]
Login

Artifact b8ffe553e508ddf6119ec38ed32dd70d4f569c1ce49045f4f494211392f41a26:


#!/bin/bash

# The relays used by this provider to listen and react to Client Asks
# export POWPUB_RELAYS=["wss://relay.damus.io","wss://nos.lol"]

# Maximum difficulty of a Client Ask this provider is willing to mine, measured in bits. Any Client Asks with higher difficulty are ignored.
# Hex requests have 4 bits per character, Npub requests have 5 bits per character, and PoW requests explicitly say the number of bits they need.
# export POWPUB_PROVIDER_MAX_MINING_DIFFICULTY=25

# When creating an invoice for a Client Ask, the invoice amount will be based on this unit price x expected number of hashes
# until a matching pubkey is found, then everything rounded to sats.
# 1 hex char prefix  = 16 (2^4) expected hashes on average, 2 hex char prefix  =  256 (2^8) expected hashes on average, etc
# 1 npub char prefix = 32 (2^5) expected hashes on average, 2 npub char prefix = 1024 (2^10) expected hashes on average, etc
# invoice_amount = POWPUB_PROVIDER_MSATS_PER_EXPECTED_HASH * (expected hashes on average)
# The value has to expressed as a decimal (1.0, 15.0, 1.21, 3.4, etc).
# export POWPUB_PROVIDER_MSATS_PER_EXPECTED_HASH=0.21

# Provider's nostr private key, in nsec format (bech32) or legacy hex.
# If not set, a new random one is generated on each startup and printed in the console.
# To accumulate reputation, it's recommended to set this here, such that even after a restart, the provider will use the same key.
# export POWPUB_PROVIDER_NOSTR_PRV_KEY=

# Option 1: Using LND for invoicing
export POWPUB_LND_REST_API_URL=https://lnd:port
export POWPUB_LND_MACAROON_PATH=/path/to/lnd/admin.macaroon
export POWPUB_LND_CERT_PATH=/path/to/lnd/tls.cert
RUSTFLAGS="-Ctarget-cpu=native" cargo run --release --features=client-lnd --example provider

# Option 2: Using a LN Address for invoicing
# export POWPUB_PROVIDER_LN_ADDRESS="your@lightning_address.com"
# RUSTFLAGS="-Ctarget-cpu=native" cargo run --release --features=client-lnaddress --example provider