Lnd: Structure of the data directory

Created on 13 Nov 2017  ยท  3Comments  ยท  Source: lightningnetwork/lnd

Right now, this structure is created:

โ”œโ”€โ”€ admin.macaroon
โ”œโ”€โ”€ bitcoin
โ”‚ย ย  โ””โ”€โ”€ testnet
โ”‚ย ย      โ””โ”€โ”€ wallet.db
โ”œโ”€โ”€ macaroons.db
โ”œโ”€โ”€ readonly.macaroon
โ””โ”€โ”€ testnet3
    โ””โ”€โ”€ bitcoin
        โ””โ”€โ”€ channel.db

It's kinda confusing that there is a bitcoin/testnet and testnet3/bitcoin. I think both channel.db and wallet.db could live in <protocol>/<network>/..

config enhancement question

Most helpful comment

while bitcoin-mainnet and litecoin-mainnet also share one

Yep, that's the plan! Stay tuned for some news soon on the implications of this ๐Ÿ˜‰

All 3 comments

The current structure is a hold-over as it's mid way between being able to support multiple chains. In a future of multiple chains, the channel.db file would be in a distinct folder as it would be shared across all other instances. In this case, it would look something like:

โ”œโ”€โ”€ chain
โ”‚   โ””โ”€โ”€ bitcoin
โ”‚        โ””โ”€โ”€ testnet
โ”‚           โ”œโ”€โ”€ block_headers.bin
โ”‚           โ”œโ”€โ”€ ext_filter_headers.bin
โ”‚           โ”œโ”€โ”€ neutrino.db
โ”‚           โ”œโ”€โ”€ peers.json
โ”‚           โ”œโ”€โ”€ reg_filter_headers.bin
โ”‚           โ””โ”€โ”€ wallet.db
โ””โ”€โ”€ graph
    โ””โ”€โ”€ testnet 
        โ””โ”€โ”€ channel.db

Agreed that the current structure is confusing and sub-optimal. Before 0.4-beta is released, we want to have a set directory structure which factors in future extensions.

Perfectly understandable, just keeping this for the record.

Quick thing: does ./graph/testnet/ mean that both litecoin-testnet and bitcoin-testnet will be considered equivalent and share a db, while bitcoin-mainnet and litecoin-mainnet also share one? That's neat.

while bitcoin-mainnet and litecoin-mainnet also share one

Yep, that's the plan! Stay tuned for some news soon on the implications of this ๐Ÿ˜‰

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joaodealmeida picture joaodealmeida  ยท  3Comments

hxsquid picture hxsquid  ยท  3Comments

alexbosworth picture alexbosworth  ยท  3Comments

ealymbaev picture ealymbaev  ยท  3Comments

alec-djinn picture alec-djinn  ยท  3Comments