Merge wizard-update branch: add QR code feature and README updates
This commit is contained in:
commit
a0a51255c2
7 changed files with 343 additions and 166 deletions
155
README.md
155
README.md
|
|
@ -1,11 +1,11 @@
|
||||||
# Lightning.Pub
|
# Lightning.Pub
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
[](http://makeapullrequest.com)
|
[](http://makeapullrequest.com)
|
||||||
[](https://t.me/ShockBTC)
|
[](https://t.me/ShockBTC)
|
||||||

|

|
||||||
|
|
||||||
### Don't just run a Lightning Node, run a Lightning Pub.
|
### Don't just run a Lightning Node, run a Lightning Pub.
|
||||||
|
|
||||||
|
|
@ -15,7 +15,9 @@ Lightning payments open the door to a new internet, but because of UX challenges
|
||||||
|
|
||||||
It may come as a surprise that the biggest hurdle to more adoption via Family and SMB Lightning nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen that liquidity is easily automated, but rather the legacy baggage of traditional Client-Server web infrastructure. Things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all require a personal configuration that is a hurdle for most.
|
It may come as a surprise that the biggest hurdle to more adoption via Family and SMB Lightning nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen that liquidity is easily automated, but rather the legacy baggage of traditional Client-Server web infrastructure. Things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all require a personal configuration that is a hurdle for most.
|
||||||
|
|
||||||
Tor as a workaround has proven too slow and unreliable, and a dead-end for clearnet-web usecases. Mobile node are easy but channels for every device is expensive and unscalable, and the UX that suffers from the limitations of the node not being an always-online server.
|
Tor as a workaround has proven too slow and unreliable, and a dead-end for clearnet-web usecases.
|
||||||
|
|
||||||
|
Mobile nodes are easy to use for spending, but channels for every device is expensive and unscalable. UX suffers from the limitations of the node not being an always-online server, which also makes them largely useless for merchants and routing services that earn revenue while you sleep.
|
||||||
|
|
||||||
Pub solves these challenges with a P2P-like design that is also web-friendly, by implementing a full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44).
|
Pub solves these challenges with a P2P-like design that is also web-friendly, by implementing a full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44).
|
||||||
|
|
||||||
|
|
@ -31,33 +33,42 @@ By solving the networking and programability hurdles, Pub provides Lightning wit
|
||||||
- [Docker Installation](#docker-installation)
|
- [Docker Installation](#docker-installation)
|
||||||
- [Manual CLI Installation](#manual-cli-installation)
|
- [Manual CLI Installation](#manual-cli-installation)
|
||||||
- [Usage Notes](#usage-notes)
|
- [Usage Notes](#usage-notes)
|
||||||
- [Misc](#support-development)
|
- [Connecting to ShockWallet](#connecting-to-shockwallet)
|
||||||
|
- [Lightning Address](#lightning-address)
|
||||||
|
- [Advanced Configuration](#advanced-configuration)
|
||||||
|
- [Custom Nostr Relay](#custom-nostr-relay)
|
||||||
|
- [Bootstrap Liquidity Provider](#bootstrap-liquidity-provider)
|
||||||
|
- [Custom Lightning Address Domain](#custom-lightning-address-domain)
|
||||||
|
- [Support Development](#support-development)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- **Zero Network Configuration Required** - No port forwarding, Tor setup, firewall rules, or DNS configuration needed! Pub uses Nostr relays for all communication, making it perfect for users who want sovereignty without networking complexity.
|
||||||
- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR
|
- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR
|
||||||
- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
|
- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md)
|
||||||
- Automated Channels
|
- Automated Channels
|
||||||
- Receives quotes from multiple LSPs including Zeus, Voltage, and Flashsats
|
- Receives quotes from multiple LSPs including Zeus, Voltage, and Flashsats
|
||||||
- Bootstrap Peering
|
- Bootstrap Peering
|
||||||
- A pub node may trust another pub node until it can afford a channel
|
- A pub node may trust another pub node until it can afford a channel
|
||||||
|
- Can be disabled via environment variable for full sovereignty
|
||||||
- Accounting SubLayers for Application Pools and Users
|
- Accounting SubLayers for Application Pools and Users
|
||||||
- A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications.
|
- A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications.
|
||||||
|
- **Complete Lightning Solution** - No additional LN node or Bitcoin full node required (uses Neutrino)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Connecting via ShockWallet is as easy as pasting an nprofile
|
- Connecting via ShockWallet is as easy as pasting an nprofile
|
||||||
- Or use a link to share your nprofile with friends and family
|
- Or use a link to share your nprofile with friends and family
|
||||||
|
|
||||||
<img src="https://cdn.shockwallet.app/add_src_sm.png" height="20%" alt="Connect Wallet"> <img src="https://cdn.shockwallet.app/src_invite_sm.png" height="20%" alt="Invite Guests">
|
<img src="https://cdn.shockwallet.app/add_source2.png" height="20%" alt="Connect Wallet"> <img src="https://cdn.shockwallet.app/invites2.png" height="20%" alt="Invite Guests">
|
||||||
|
|
||||||
## Planned Features
|
## Planned Features
|
||||||
|
|
||||||
- [x] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
|
- [x] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2)
|
||||||
- [x] Nostr native [CLINK](https://clinkme.dev) "offers"
|
- [x] Nostr native [CLINK](https://clinkme.dev) "offers"
|
||||||
- [x] Encrypted Push Notifications
|
- [x] Encrypted Push Notifications
|
||||||
|
- [_] Swap integration (in progress)
|
||||||
- [ ] P2P "LSP" coordination for channel batching over Nostr
|
- [ ] P2P "LSP" coordination for channel batching over Nostr
|
||||||
- [ ] Swap integration
|
|
||||||
- [ ] High-Availabilty / Clustering
|
- [ ] High-Availabilty / Clustering
|
||||||
|
|
||||||
Dashboard Wireframe:
|
Dashboard Wireframe:
|
||||||
|
|
@ -74,8 +85,17 @@ This method installs all dependencies and creates user-level systemd services.
|
||||||
|
|
||||||
**Platform Support:**
|
**Platform Support:**
|
||||||
- ✅ **Debian/Ubuntu**: Fully tested and supported
|
- ✅ **Debian/Ubuntu**: Fully tested and supported
|
||||||
- ⚠️ **Arch/Fedora**: Should work but untested - please report issues
|
- ✅ **Arch/Fedora**: Fully tested and supported
|
||||||
- 🚧 **macOS**: Basic support stubbed in but completely untested - help wanted
|
- 🚧 **macOS**: Basic support stubbed in, but untested. Help wanted.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> **System Requirements:**
|
||||||
|
> - **RAM**: Minimum 2GB burstable in headless containers or VPS. 4+GB recommended for full Linux Desktop OS.
|
||||||
|
> - **Storage**: 20GB of space for compact blocks.
|
||||||
|
> - **Network**: No port forwarding, Tor, or firewall configuration needed! Pub uses Nostr relays for communication to eliminate traditional server networking requirements.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> **Bundled Node**: The Lightning.Pub install script provides a complete Lightning solution. You do NOT need to a full Bitcoin or other node, perfect small devices like Raspberry Pi.
|
||||||
|
|
||||||
To start, run the following command:
|
To start, run the following command:
|
||||||
|
|
||||||
|
|
@ -90,7 +110,11 @@ It should look like this in a minute or so
|
||||||
**Note:** The installation is now confined to user-space, meaning:
|
**Note:** The installation is now confined to user-space, meaning:
|
||||||
- No sudo required for installation
|
- No sudo required for installation
|
||||||
- All data stored in `$HOME/lightning_pub/`
|
- All data stored in `$HOME/lightning_pub/`
|
||||||
- Logs available at `$HOME/lightning_pub/install.log`
|
|
||||||
|
**After Installation:**
|
||||||
|
- The installer will display an admin connection string (nprofile and secret separated by a colon) and a **QR code** for easy mobile setup
|
||||||
|
- You can also access the connection info via web browser on Start9 and Umbrel appliances (releases forthcoming)
|
||||||
|
- Copy the connection string or scan the QR code with ShockWallet to connect as administrator
|
||||||
|
|
||||||
**⚠️ Migration from Previous Versions:**
|
**⚠️ Migration from Previous Versions:**
|
||||||
Previous system-wide installations (as of 8.27.2025) need some manual intervention:
|
Previous system-wide installations (as of 8.27.2025) need some manual intervention:
|
||||||
|
|
@ -113,6 +137,32 @@ These are controversial, so we don't include them. You can however add a line to
|
||||||
|
|
||||||
**Note:** The installer will only restart services if version checks deem necessary.
|
**Note:** The installer will only restart services if version checks deem necessary.
|
||||||
|
|
||||||
|
#### Troubleshooting
|
||||||
|
|
||||||
|
If the installation fails or services don't start properly, use these commands to diagnose:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check service status
|
||||||
|
systemctl --user status lnd
|
||||||
|
systemctl --user status lightning_pub
|
||||||
|
|
||||||
|
# View logs
|
||||||
|
journalctl --user-unit lnd -f
|
||||||
|
journalctl --user-unit lightning_pub -f
|
||||||
|
|
||||||
|
# Restart services if needed
|
||||||
|
systemctl --user restart lnd
|
||||||
|
systemctl --user restart lightning_pub
|
||||||
|
|
||||||
|
# Retrieve admin connection string (if installation completed but you need to find it again)
|
||||||
|
cat ~/lightning_pub/admin.connect
|
||||||
|
|
||||||
|
# Reset admin access (generates new admin.connect automatically)
|
||||||
|
rm ~/lightning_pub/admin.npub
|
||||||
|
sleep 1 # Wait briefly for new admin.connect to re-generate
|
||||||
|
cat ~/lightning_pub/admin.connect
|
||||||
|
```
|
||||||
|
|
||||||
### Docker Installation
|
### Docker Installation
|
||||||
|
|
||||||
See the [Docker Installation Guide](DOCKER.md).
|
See the [Docker Installation Guide](DOCKER.md).
|
||||||
|
|
@ -145,13 +195,92 @@ npm start
|
||||||
|
|
||||||
## Usage Notes
|
## Usage Notes
|
||||||
|
|
||||||
Connect with ShockWallet ([wallet2](https://github.com/shocknet/wallet2)) using the wallet admin string that gets logged at startup. Simply copy/paste the string into the node connection screen.
|
### Connecting to ShockWallet
|
||||||
|
|
||||||
The nprofile of the node can also be used to send invitation links to guests via the web version of ShockWallet.
|
**For Administrators:**
|
||||||
|
1. After installation, you'll see an admin connection string (format: `nprofile1...:token`) and a QR code
|
||||||
|
2. **Option 1**: Scan the QR code with ShockWallet mobile app
|
||||||
|
3. **Option 2**: Copy/paste the connection string into ShockWallet's node connection screen
|
||||||
|
|
||||||
**Note that connecting with wallet will create an account on the node, it will not show or have access to the full LND balance. Allocating existing funds to the admin user will be added to the operator dashboard in a future release.**
|
**For Guest Users:**
|
||||||
|
- The nprofile of the node (without the admin token) can be used to send invitation links to guests via the web version of ShockWallet
|
||||||
|
- The nprofile is stored in `$HOME/lightning_pub/app.nprofile` or the administrator can copy a link from the "Invite" page in ShockWallet
|
||||||
|
|
||||||
Additional docs are WIP at [docs.shock.network](https://docs.shock.network)
|
> [!NOTE]
|
||||||
|
> Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance. Allocating existing funds to the admin user will be added to the operator dashboard in a future release.
|
||||||
|
|
||||||
|
### Lightning Address
|
||||||
|
|
||||||
|
When you run your own Lightning Pub, obtaining a Lightning Address is fully automated in ShockWallet. The wallet automatically:
|
||||||
|
1. Takes the CLINK offer from your Pub
|
||||||
|
2. Enrolls it at a LNURL bridge (creates a `@shockwallet.app` address)
|
||||||
|
3. This makes the Lightning Address trustless when payers support CLINK as it uses Nostr for communication instead of trusting the bridge to serve the correct invoice.
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> **CLINK Integration**: Your Pub's CLINK offers enable ShockWallet to connect to CLINK-compatible services, like [Stacker News](https://stacker.news), allowing you to send and receive payments without additional setup.
|
||||||
|
|
||||||
|
For custom Lightning Address domains, see the [Advanced Configuration](#advanced-configuration) section.
|
||||||
|
|
||||||
|
## Advanced Configuration
|
||||||
|
|
||||||
|
Copy `env.example` to `.env` and customize settings:
|
||||||
|
```bash
|
||||||
|
cp env.example .env
|
||||||
|
nano .env # or use your preferred editor
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> Environment variables set in `.env` will override any settings configured via the wizard or stored in the settings database table.
|
||||||
|
|
||||||
|
### Custom Nostr Relay
|
||||||
|
|
||||||
|
By default, Lightning.Pub uses the ShockNet relay. To use your own:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Single relay
|
||||||
|
NOSTR_RELAYS=wss://your-relay-url.com
|
||||||
|
|
||||||
|
# Multiple relays (space-separated)
|
||||||
|
NOSTR_RELAYS="wss://relay1.com wss://relay2.com wss://relay3.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
The wizard interface (coming soon for Start9/Umbrel) will make this graphical.
|
||||||
|
|
||||||
|
### Bootstrap Liquidity Provider
|
||||||
|
|
||||||
|
By default, Lightning.Pub uses a bootstrap liquidity provider that provides initial channel funding as a service credit until you can afford your own channels. Pub compares rates from top LSPs and automatically requests a channel when needed.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Disable for full sovereignty
|
||||||
|
DISABLE_LIQUIDITY_PROVIDER=true
|
||||||
|
|
||||||
|
# Or point to a different Pub instance
|
||||||
|
LIQUIDITY_PROVIDER_PUB=nprofile1...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Custom Lightning Address Domain
|
||||||
|
|
||||||
|
By default, ShockWallet automatically enrolls your CLINK offer at `@shockwallet.app`. For custom domains, you have two options:
|
||||||
|
|
||||||
|
**Option 1: Run your own [Bridgelet](https://github.com/shocknet/bridgelet)**
|
||||||
|
|
||||||
|
A minimalist LNURL-P and Lightning Address bridge service that uses CLINK Offers. This gives you full control over your Lightning Address domain without trusting third-party bridges.
|
||||||
|
|
||||||
|
**Option 2: Enable LNURL directly on Pub**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Configure which LNURL bridge to suggest to wallets (default: https://shockwallet.app)
|
||||||
|
BRIDGE_URL=https://your-bridge.com
|
||||||
|
|
||||||
|
# Enable LNURL callbacks directly on Pub (requires SSL reverse proxy pointing to Pub's port)
|
||||||
|
SERVICE_URL=https://yourdomain.com
|
||||||
|
```
|
||||||
|
|
||||||
|
### Complete Reference
|
||||||
|
|
||||||
|
See `env.example` for complete documentation of all available settings.
|
||||||
|
|
||||||
|
For additional documentation, guides, and FAQs, visit [docs.shock.network](https://docs.shock.network) or contribute to the [docs repository](https://github.com/shocknet/docs).
|
||||||
|
|
||||||
## Support Development
|
## Support Development
|
||||||
|
|
||||||
|
|
|
||||||
9
package-lock.json
generated
9
package-lock.json
generated
|
|
@ -36,6 +36,7 @@
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nostr-tools": "^2.13.0",
|
"nostr-tools": "^2.13.0",
|
||||||
"pg": "^8.4.0",
|
"pg": "^8.4.0",
|
||||||
|
"qrcode-terminal": "^0.12.0",
|
||||||
"reflect-metadata": "^0.2.2",
|
"reflect-metadata": "^0.2.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.5",
|
||||||
|
|
@ -5730,6 +5731,14 @@
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/qrcode-terminal": {
|
||||||
|
"version": "0.12.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz",
|
||||||
|
"integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==",
|
||||||
|
"bin": {
|
||||||
|
"qrcode-terminal": "bin/qrcode-terminal.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.13.0",
|
"version": "6.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"nostr-tools": "^2.13.0",
|
"nostr-tools": "^2.13.0",
|
||||||
"pg": "^8.4.0",
|
"pg": "^8.4.0",
|
||||||
|
"qrcode-terminal": "^0.12.0",
|
||||||
"reflect-metadata": "^0.2.2",
|
"reflect-metadata": "^0.2.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.5",
|
||||||
|
|
|
||||||
BIN
pub_logo.png
BIN
pub_logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 26 KiB |
|
|
@ -4,6 +4,11 @@ get_log_info() {
|
||||||
USER_HOME=$HOME
|
USER_HOME=$HOME
|
||||||
USER_NAME=$(whoami)
|
USER_NAME=$(whoami)
|
||||||
|
|
||||||
|
# Ensure node is in PATH for QR generation
|
||||||
|
if [ "$OS" = "Mac" ]; then
|
||||||
|
export PATH="$USER_HOME/node/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
LOG_DIR="$INSTALL_DIR/logs"
|
LOG_DIR="$INSTALL_DIR/logs"
|
||||||
DATA_DIR="$INSTALL_DIR/"
|
DATA_DIR="$INSTALL_DIR/"
|
||||||
START_TIME=$(date +%s)
|
START_TIME=$(date +%s)
|
||||||
|
|
@ -116,12 +121,18 @@ get_log_info() {
|
||||||
log "A node admin has not yet enrolled via Nostr."
|
log "A node admin has not yet enrolled via Nostr."
|
||||||
log "Paste this string into ShockWallet as a node source to connect as administrator:"
|
log "Paste this string into ShockWallet as a node source to connect as administrator:"
|
||||||
log "${SECONDARY_COLOR}$admin_connect${RESET_COLOR}"
|
log "${SECONDARY_COLOR}$admin_connect${RESET_COLOR}"
|
||||||
|
echo ""
|
||||||
|
log "Or scan this QR code with ShockWallet:"
|
||||||
|
node "$INSTALL_DIR/scripts/qr_generator.js" "$admin_connect" 2>/dev/null || log "QR code generation unavailable"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
elif [ -f "$DATA_DIR/app.nprofile" ]; then
|
elif [ -f "$DATA_DIR/app.nprofile" ]; then
|
||||||
app_nprofile=$(cat "$DATA_DIR/app.nprofile")
|
app_nprofile=$(cat "$DATA_DIR/app.nprofile")
|
||||||
log "${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} is already set up. Use this nprofile to invite guest users:"
|
log "${SECONDARY_COLOR}Lightning.Pub${RESET_COLOR} is already set up. Use this nprofile to invite guest users:"
|
||||||
log "${SECONDARY_COLOR}$app_nprofile${RESET_COLOR}"
|
log "${SECONDARY_COLOR}$app_nprofile${RESET_COLOR}"
|
||||||
|
echo ""
|
||||||
|
log "Or scan this QR code with ShockWallet:"
|
||||||
|
node "$INSTALL_DIR/scripts/qr_generator.js" "$app_nprofile" 2>/dev/null || log "QR code generation unavailable"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep $WAIT_INTERVAL
|
sleep $WAIT_INTERVAL
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,18 @@ install_nodejs_mac() {
|
||||||
install_nodejs_linux() {
|
install_nodejs_linux() {
|
||||||
export NVM_DIR="$USER_HOME/.nvm"
|
export NVM_DIR="$USER_HOME/.nvm"
|
||||||
|
|
||||||
|
# Check for snap curl which cannot access hidden folders, nvm falls back to wget if curl is not installed
|
||||||
|
if snap list 2>/dev/null | grep -q "^curl "; then
|
||||||
|
log "ERROR: Snap curl detected"
|
||||||
|
log ""
|
||||||
|
log "Snap curl cannot access hidden folders needed for Node.js installation."
|
||||||
|
log "Please remove snap curl and install native curl:"
|
||||||
|
log " sudo snap remove curl"
|
||||||
|
log " sudo apt install curl"
|
||||||
|
log ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Load nvm if it already exists
|
# Load nvm if it already exists
|
||||||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
|
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
|
||||||
|
|
||||||
|
|
|
||||||
15
scripts/qr_generator.js
Executable file
15
scripts/qr_generator.js
Executable file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
import qrcode from 'qrcode-terminal';
|
||||||
|
|
||||||
|
const text = process.argv[2];
|
||||||
|
|
||||||
|
if (!text) {
|
||||||
|
console.error('Usage: qr_generator.js <text>');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
qrcode.generate(text, { small: true }, (qr) => {
|
||||||
|
console.log(qr);
|
||||||
|
});
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue