Aller au contenu principal

flnd

flnd is the engine that powers the Flokicoin Lightning Network. It is a full-featured daemon that acts as both a Flokicoin wallet and a Lightning Network node.

If you are a developer, a node operator, or a power user who prefers automation and a powerful command-line interface, flnd is your choice.

High PerformanceWritten in Go, designed for stability and 24/7 operation.
Lightning ReadySupports instant payments and smart-contract channels natively.
Fully ScriptableEvery feature is accessible via the flncli tool or a robust gRPC/REST API.

Quick Installation

flnd is distributed as a pair of binaries: flnd (the daemon) and flncli (the controller).

  1. Download: Go to the flnd Releases page and grab the version for your system.
  2. Extract: Unpack the archives and move the binaries to your path (e.g., /usr/local/bin or C:\Windows).
  3. Verify:
    flnd --version
    flncli --version

The Onboarding Lifecycle

Operating flnd follows a standard lifecycle: Start Daemon → Create/Unlock Wallet → Sync → Operate.

2. Starting the Daemon

Before you can interact with your wallet, the flnd daemon must be running. By default, it will use DNS seeds to find peers and connect to the network using Neutrino.

Simply run:

flnd

What to look for in the logs:

[INF] LTND: Waiting for wallet encryption password.
Use flncli create to create a wallet or flncli unlock to unlock an existing wallet.

2. Creating Your Wallet

Open a second terminal window and run the initialization command:

flncli create

You will be guided through several critical security steps:

  1. Wallet Password: Enter a password (min 8 characters). This password encrypts your local wallet.db file. You will need it every time you start the daemon.
  2. Cipher Seed: You will be asked if you have an existing seed to import. For a new wallet, choose No (n).
  3. Seed Passphrase (Optional): You can add an extra "25th word" for additional security. If you don't want one, simply press Enter.
  4. The 24-Word Seed: The terminal will display your unique 24-word recovery phrase.
Security Protocol
  • Write it down: Use physical paper.
  • Offline only: Never take a screenshot, photo, or store it in a digital file.
  • Ultimate Backup: This seed (and your optional passphrase) is the only way to recover your on-chain funds.

3. Static Channel Backup (SCB)

While the 24-word seed restores your Flokicoin balance, it does not automatically restore your Lightning channels.

  • File: channel.backup
  • Location: Inside your data directory (e.g., chain/flokicoin/mainnet/).
  • Action: Every time you open or close a channel, this file updates. You should back this file up to a separate device or cloud storage to ensure you can recover Lightning funds.

4. Unlocking the Wallet

Every time you restart the flnd daemon, you must provide your wallet password to decrypt the local keys:

flncli unlock

Pro Tip: Auto-Unlocking

To allow the daemon to start and unlock automatically (useful for servers), you can use a password file:

  1. Create a file containing only your wallet password (e.g., ~/.flnd/pwd.txt).
  2. Start the daemon with the flag: --wallet-unlock-password-file=/path/to/pwd.txt.

Network & Connectivity

To be a healthy part of the network, your node needs to talk to others.

Port Forwarding

If you are running flnd behind a home router, you should forward these ports to your node's local IP to allow external connectivity:

  • 5521 (TCP): The standard port for Lightning Network peer-to-peer communication.
  • 10005 (TCP): The gRPC port used by flncli and external dashboards like Lokihub.
  • 5050 (TCP): The REST API port for web-based integrations.

Data Directory

By default, all data (logs, database, macaroons) is stored in:

  • Linux: ~/.flnd/
  • macOS: ~/Library/Application Support/Flnd/
  • Windows: %LOCALAPPDATA%\Flnd\

You can move this to an external drive using the --lnddir=/path/to/data flag.

Basic Operations

Once unlocked, the daemon will begin syncing with the Flokicoin network. Use these commands to manage your funds:

Check Sync Status:

flncli getinfo

Generate a SegWit Address:

flncli newaddress p2wkh

Check Balances:

flncli walletbalance # On-chain Flokicoin
flncli channelbalance # Lightning Network liquidity

Send Flokicoin:

flncli sendcoins --addr=[ADDRESS] --amt=[AMOUNT_IN_LOKI]

External Access (Macaroons)

flnd uses "Macaroons" for authentication. These are credential files that grant specific permissions to external apps.

  • admin.macaroon: Full access (keep this secret).
  • readonly.macaroon: Only allows viewing balances and info.
  • invoice.macaroon: Only allows creating and viewing invoices.

When connecting apps like Zeus or Lokihub, you will often need to provide the hex-encoded string of your admin.macaroon.

Advanced: Lightning Network

flnd is a full Lightning Network implementation. Once you have on-chain funds, you can open channels to start sending instant, near-free payments.

  1. Find a peer: Ask for a node's public key on the Flokicoin Discord.
  2. Connect: flncli connect [pubkey]@[host]:[port]
  3. Open Channel: flncli openchannel [pubkey] [amount_in_Loki]

Next Steps