[
  {
    "scenario": "Node won't sync",
    "commands": [
      "bitcoin-cli getblockchaininfo",
      "bitcoin-cli getnetworkinfo",
      "bitcoin-cli verifychain"
    ],
    "solutions": [
      "Check disk space",
      "Verify internet connection",
      "Try reindexing with -reindex option"
    ]
  },
  {
    "scenario": "Lightning channel stuck",
    "commands": [
      "lncli listchannels",
      "lncli decodepayreq <invoice>",
      "lncli closedchannels"
    ],
    "solutions": [
      "Force close with lncli closechannel --force",
      "Wait for cooperative close",
      "Check for on-chain resolution"
    ]
  },
  {
    "scenario": "Disk space running out",
    "commands": [
      "bitcoin-cli help prune",
      "du -sh ~/.bitcoin/",
      "bitcoin-cli getblockchaininfo"
    ],
    "solutions": [
      "Enable pruning with prune=550",
      "Remove old blocks manually",
      "Move blockchain to external drive"
    ]
  },
  {
    "scenario": "Stratum connection failure",
    "commands": [
      "telnet pool.example.com 3333",
      "ping pool.example.com",
      "bitcoin-cli help getnetworkinfo"
    ],
    "solutions": [
      "Check pool credentials",
      "Verify stratum version compatibility",
      "Update mining software"
    ]
  },
  {
    "scenario": "Lightning invoice expired",
    "commands": [
      "lncli decodepayreq <invoice>",
      "lncli listinvoices",
      "lncli addinvoice <amount>"
    ],
    "solutions": [
      "Create new invoice",
      "Check expiry time",
      "Use longer expiry for large amounts"
    ]
  },
  {
    "scenario": "Wallet recovery",
    "commands": [
      "electrum restore",
      "bitcoin-cli dumpprivkey <address>",
      "bitcoin-cli importprivkey <key>"
    ],
    "solutions": [
      "Use seed phrase to restore",
      "Import private keys",
      "Verify wallet balance after restore"
    ]
  },
  {
    "scenario": "Memory/CPU optimization",
    "commands": [
      "bitcoin-cli help dbcache",
      "top -bn1 | grep bitcoin",
      "free -m"
    ],
    "solutions": [
      "Increase dbcache parameter",
      "Enable pruning",
      "Use SSD for blockchain data"
    ]
  },
  {
    "scenario": "Tor setup for Bitcoin",
    "commands": [
      "sudo apt install tor",
      "bitcoin.conf -proxy=127.0.0.1:9050",
      "bitcoin-cli getnetworkinfo"
    ],
    "solutions": [
      "Install Tor package",
      "Configure proxy in bitcoin.conf",
      "Restart Bitcoin Core"
    ]
  },
  {
    "scenario": "Channel rebalancing",
    "commands": [
      "lightning-cli listchannels",
      "lightning-cli channel",
      "lightning-cli help channel"
    ],
    "solutions": [
      "Use internal rebalance",
      "Open new channel with balance",
      "Use c-lightning plugins"
    ]
  },
  {
    "scenario": "Multi-sig setup",
    "commands": [
      "bitcoin-cli createwallet multisig",
      "bitcoin-cli createmultisig 2 '[\"pubkey1\", \"pubkey2\", \"pubkey3\"]'",
      "bitcoin-cli importaddress <address>"
    ],
    "solutions": [
      "Generate multiple keys",
      "Create multi-sig address",
      "Import to all wallets"
    ]
  }
]