⏰ Time:
🌡️ Temp:
Loading...
📌 💡 การสร้าง LND สำหรับร้านค้า 1️⃣ ติดตั้ง LND และ Bitcoin full node
โดย puk
•2025-09-06 13:07
💡 การสร้าง LND สำหรับร้านค้า
1️⃣ ติดตั้ง LND และ Bitcoin full node
ติดตั้ง Bitcoin Core (mainnet):
sudo apt update
sudo apt install bitcoind
bitcoind -daemon
ติดตั้ง LND:
wget https://github.com/lightningnetwork/lnd/releases/download/v0.17.2-beta/lnd-linux-amd64-v0.17.2-beta.tar.gz
tar -xzf lnd-linux-amd64-v0.17.2-beta.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-amd64-v0.17.2-beta/*
สร้างไฟล์ config lnd.conf:
[Application Options]
alias=MyShopNode
color=#FF5733
listen=[::]:9735
maxpendingchannels=5
[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind
[Bitcoind]
bitcoind.rpchost=127.0.0.1
bitcoind.rpcuser=<rpcuser>
bitcoind.rpcpass=<rpcpass>
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
[tor]
tor.active=true
tor.v3=true
tor.socks=127.0.0.1:9050
tor.control=127.0.0.1:9051
tor.password=<รหัสผ่าน Tor>
ใช้ Tor เพื่อให้ร้านค้าเชื่อมแบบ Onion address ปลอดภัย
2️⃣ เปิด Tor และสร้าง Onion address
sudo systemctl start tor
sudo systemctl enable tor
Onion address ของโหนดร้านค้าจะสร้างอัตโนมัติ
ตรวจสอบได้ด้วย:
lncli getinfo
3️⃣ สร้าง wallet LND สำหรับร้านค้า
lncli create
ตั้ง seed phrase และ password
เก็บ seed ไว้ให้ปลอดภัย → สำคัญมาก
4️⃣ เชื่อม peers และ fund wallet
เติม BTC เข้า LND wallet (on-chain)
เชื่อมกับ peer ที่เชื่อถือได้ หรือ public nodes:
lncli connect <pubkey>@<ip_or_onion>:9735
5️⃣ เปิดช่องสำหรับร้านค้า
เปิด channel เพื่อรับชำระ Lightning payments:
lncli openchannel --node_key=<peer_pubkey> --local_amt=500000
local_amt = จำนวน satoshi ร้านค้าพร้อมให้ liquidity
6️⃣ การรับชำระ Lightning
สร้าง invoice:
lncli addinvoice --amt=1000 --memo="สินค้า A"
ส่ง payment request ให้ลูกค้า
เมื่อจ่ายสำเร็จ ระบบจะอัปเดต balance อัตโนมัติ
7️⃣ ความปลอดภัยสำหรับร้านค้า
เปิด Tor + Onion address → ปลอดภัยจาก IP scan
สำรอง wallet และ seed phrase อย่างสม่ำเสมอ
ใช้ watchtower ป้องกัน channel ถูกโจมตี
8️⃣ ตัวอย่าง workflow ร้านค้า
ลูกค้า → สแกน QR Lightning invoice → จ่าย satoshi → ยืนยันอัตโนมัติ
ไม่ต้องรอ confirmation blockchain → รับเงินทันที
สามารถผูกระบบ POS / เว็บร้านค้า ให้ LND สร้าง invoice อัตโนมัติ