2017-07-04 18:51:39 +02:00
|
|
|
#ifndef LIGHTNING_BITCOIN_CHAINPARAMS_H
|
|
|
|
#define LIGHTNING_BITCOIN_CHAINPARAMS_H
|
|
|
|
|
|
|
|
#include "config.h"
|
2017-12-18 07:44:10 +01:00
|
|
|
#include <bitcoin/block.h>
|
2017-07-04 18:51:39 +02:00
|
|
|
#include <ccan/short_types/short_types.h>
|
2019-02-21 04:45:54 +01:00
|
|
|
#include <common/amount.h>
|
2017-07-04 18:51:39 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2019-03-11 20:03:14 +01:00
|
|
|
struct bip32_key_version {
|
|
|
|
u32 bip32_pubkey_version;
|
|
|
|
u32 bip32_privkey_version;
|
|
|
|
};
|
|
|
|
|
2017-07-04 18:51:39 +02:00
|
|
|
struct chainparams {
|
|
|
|
const char *network_name;
|
2017-10-26 04:57:19 +02:00
|
|
|
const char *bip173_name;
|
2017-12-18 07:44:10 +01:00
|
|
|
const struct bitcoin_blkid genesis_blockhash;
|
2017-07-04 18:51:39 +02:00
|
|
|
const int rpc_port;
|
2017-07-13 15:36:50 +02:00
|
|
|
const char *cli;
|
|
|
|
const char *cli_args;
|
2019-02-21 04:45:54 +01:00
|
|
|
const struct amount_sat dust_limit;
|
|
|
|
const struct amount_sat max_funding;
|
|
|
|
const struct amount_msat max_payment;
|
2018-02-15 23:09:55 +01:00
|
|
|
const u32 when_lightning_became_cool;
|
2017-07-04 18:51:39 +02:00
|
|
|
|
|
|
|
/* Whether this is a test network or not */
|
|
|
|
const bool testnet;
|
2019-03-11 20:03:14 +01:00
|
|
|
|
|
|
|
/* Version codes for BIP32 extended keys in libwally-core*/
|
|
|
|
const struct bip32_key_version bip32_key_version;
|
2017-07-04 18:51:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* chainparams_for_network - Look up blockchain parameters by its name
|
|
|
|
*/
|
|
|
|
const struct chainparams *chainparams_for_network(const char *network_name);
|
|
|
|
|
2017-10-26 04:57:19 +02:00
|
|
|
/**
|
|
|
|
* chainparams_by_bip173 - Helper to get a network by its bip173 name
|
|
|
|
*
|
|
|
|
* This lets us decode BOLT11 addresses.
|
|
|
|
*/
|
|
|
|
const struct chainparams *chainparams_by_bip173(const char *bip173_name);
|
2018-09-06 18:40:11 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* chainparams_by_chainhash - Helper to get a network by its genesis blockhash
|
|
|
|
*/
|
|
|
|
const struct chainparams *chainparams_by_chainhash(const struct bitcoin_blkid *chain_hash);
|
|
|
|
|
2017-07-04 18:51:39 +02:00
|
|
|
#endif /* LIGHTNING_BITCOIN_CHAINPARAMS_H */
|