Client CLI

Install

CARGO_NET_GIT_FETCH_WITH_CLI=true \
    cargo install --git https://oak-node.net/cgit/powwow.git pw-client-cli

Configure

The most important configuration for the Client is the source of LN funds, which can be either LND or Nostr Wallet Connect.

Create a local toml file that will hold client configuration. Use client-config.toml as a starting point and adjust it where necessary:

curl -O https://lab.oak-node.net/powwow/doc/trunk/crates/pw-client-cli/client-config.toml

Example: Buy PoW for a Nostril event

You will need

  • openssl to create a secret key
  • nostril to create Nostr events
  • pw-client-cli to purchase PoW
  • LND or NWC as a source of LN funds
// 1. Create a new event with Nostril
sk=$(openssl rand -hex 32)
content="Hello world"

initial_event=$(nostril --sec "${sk}" --content "${content}")
echo "Starting with event: ${initial_event}"


// 2. Use the PoW WoW CLI client to outsource PoW mining. If successful, we will get
//    an unsigned version of the initial event, but with PoW.
reconstructed_event=$(pw-client-cli buy client-config.toml "${initial_event}")
echo "Reconstructed event with PoW (unsigned): ${reconstructed_event}"


// 3. Sign the event with Nostril
created_at=$(echo "${reconstructed_event}" | jq '.created_at')
tags=$(echo "${reconstructed_event}" | jq -c '.tags')

nostril --sec "${sk}" --content "${content}" --tags "${tags}" --created-at "${created_at}"