Update crypto documentation with accurate configuration and remove tutorials
- Document actual resource requirements from production systems - Fix fee documentation: fee buffers are for quotes, not wallet reserves - Clarify perfect accounting to quote amounts in atomic units - Remove generic curl/API tutorials, keep Make commands - Add dust prevention benefit of exact amount sweeping - Update Makefile targets to match what actually exists
This commit is contained in:
parent
7c8a0065cf
commit
51ec71a9f9
3 changed files with 48 additions and 164 deletions
|
|
@ -302,26 +302,9 @@ def validate_dogecoin_address(address):
|
|||
return all(c in valid_chars for c in address)
|
||||
```
|
||||
|
||||
**Auto-Sweep Configuration:**
|
||||
```python
|
||||
def auto_sweep_dogecoin_payment(payment, confirmed_amount):
|
||||
"""Sweep confirmed DOGE payment to cold storage."""
|
||||
fee_reserve = Decimal('0.01') # Keep 0.01 DOGE for fees
|
||||
sweep_amount = confirmed_amount - fee_reserve
|
||||
|
||||
if sweep_amount > 0:
|
||||
# Sweep to shop's configured cold wallet
|
||||
tx_hash = client.sendtoaddress(
|
||||
address=payment.shop.cold_wallet_address,
|
||||
amount=float(sweep_amount),
|
||||
comment=f"Auto-sweep payment {payment.id}",
|
||||
comment_to="",
|
||||
subtractfeefromamount=False
|
||||
)
|
||||
|
||||
log.sweep_operation(payment, "DOGE auto-sweep successful",
|
||||
tx_hash, sweep_amount)
|
||||
```
|
||||
**Auto-Sweep System:**
|
||||
|
||||
The system uses perfect accounting to the quote amount - sweeping exactly what the customer paid (including fee buffers). Quotes are calculated in atomic units (koinu) for precision. After confirmation, the full payment amount is swept to cold storage with network fees paid from the balance. Each shop's funds are swept to their configured cold wallet address immediately after confirmation. This approach prevents dust accumulation in the hot wallet.
|
||||
|
||||
## Monitoring and Maintenance
|
||||
|
||||
|
|
@ -329,15 +312,10 @@ def auto_sweep_dogecoin_payment(payment, confirmed_amount):
|
|||
|
||||
**Key Metrics:**
|
||||
```bash
|
||||
# Node synchronization status
|
||||
dogecoin-cli getblockchaininfo | grep -E "(blocks|headers|verificationprogress)"
|
||||
|
||||
# Network connectivity
|
||||
dogecoin-cli getnetworkinfo | grep -E "(connections|version)"
|
||||
|
||||
# Wallet balance and transactions
|
||||
dogecoin-cli getwalletinfo
|
||||
dogecoin-cli getbalance
|
||||
# Use Make commands for monitoring
|
||||
make dogecoin-status # Check sync status and progress
|
||||
make dogecoin-config # View/create configuration
|
||||
make dogecoin-node # Start pruned node
|
||||
```
|
||||
|
||||
**Automated Health Checks:**
|
||||
|
|
@ -412,49 +390,29 @@ grep "Dogecoin RPC connection error" logs/crypto_watcher.log
|
|||
# Check if daemon is running
|
||||
ps aux | grep dogecoind
|
||||
|
||||
# Check peer connections
|
||||
dogecoin-cli getpeerinfo | grep -c '"id"'
|
||||
|
||||
# Force reconnection to peers
|
||||
dogecoin-cli addnode seed.dogechain.info add
|
||||
dogecoin-cli addnode seed.multidoge.org add
|
||||
# Check connection status
|
||||
make dogecoin-status # Shows peers and sync status
|
||||
```
|
||||
|
||||
**Wallet Issues:**
|
||||
```bash
|
||||
# Check wallet loading
|
||||
dogecoin-cli listwallets
|
||||
|
||||
# Load specific wallet if needed
|
||||
dogecoin-cli loadwallet make_post_sell_hot_wallet
|
||||
|
||||
# Check wallet integrity
|
||||
dogecoin-cli getwalletinfo
|
||||
# Wallet managed by dogecoind configuration
|
||||
# Check status with:
|
||||
make dogecoin-status
|
||||
```
|
||||
|
||||
**Address and Transaction Issues:**
|
||||
```bash
|
||||
# List all addresses with labels
|
||||
dogecoin-cli listaddressgroupings
|
||||
|
||||
# Check specific address balance
|
||||
dogecoin-cli getreceivedbyaddress D1A2B3C4D5E6F7G8H9I0J1K2L3M4N5O6P7 1
|
||||
|
||||
# List recent transactions
|
||||
dogecoin-cli listtransactions "*" 50 0
|
||||
# Address and transaction tracking handled by crypto_watcher
|
||||
# View payment activity in logs:
|
||||
tail -f logs/crypto_watcher.log | grep DOGE
|
||||
```
|
||||
|
||||
**Recovery Procedures:**
|
||||
```bash
|
||||
# Backup wallet (regular maintenance)
|
||||
dogecoin-cli backupwallet /secure/backup/wallet-$(date +%Y%m%d).dat
|
||||
|
||||
# Restore wallet from backup
|
||||
cp /secure/backup/wallet-20231201.dat ~/.dogecoin/wallet.dat
|
||||
# Restart dogecoind after restore
|
||||
|
||||
# Rescan blockchain for transactions (if needed)
|
||||
dogecoin-cli rescanblockchain 0
|
||||
# Regular wallet backups are critical
|
||||
# Store wallet.dat backups in secure location
|
||||
# Recovery requires restoring wallet.dat and restarting dogecoind
|
||||
```
|
||||
|
||||
### Emergency Procedures
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue