MCPcopy Create free account
hub / github.com/ElementsProject/lightning / main

Function main

plugins/bcli.c:878–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

876}
877
878int main(int argc, char *argv[])
879{
880 setup_locale();
881
882 /* Initialize our global context object here to handle startup options. */
883 bitcoind = new_bitcoind(NULL);
884
885 plugin_main(argv, init, NULL, PLUGIN_STATIC, false /* Do not init RPC on startup*/,
886 NULL, commands, ARRAY_SIZE(commands),
887 NULL, 0, NULL, 0, NULL, 0,
888 plugin_option("bitcoin-datadir",
889 "string",
890 "-datadir arg for bitcoin-cli",
891 charp_option, NULL, &bitcoind->datadir),
892 plugin_option("bitcoin-cli",
893 "string",
894 "bitcoin-cli pathname",
895 charp_option, NULL, &bitcoind->cli),
896 plugin_option("bitcoin-rpcuser",
897 "string",
898 "bitcoind RPC username",
899 charp_option, NULL, &bitcoind->rpcuser),
900 plugin_option("bitcoin-rpcpassword",
901 "string-conceal",
902 "bitcoind RPC password",
903 charp_option, NULL, &bitcoind->rpcpass),
904 plugin_option("bitcoin-rpcconnect",
905 "string",
906 "bitcoind RPC host to connect to",
907 charp_option, NULL, &bitcoind->rpcconnect),
908 plugin_option("bitcoin-rpcport",
909 "int",
910 "bitcoind RPC host's port",
911 charp_option, NULL, &bitcoind->rpcport),
912 plugin_option("bitcoin-rpcclienttimeout",
913 "int",
914 "bitcoind RPC timeout in seconds during HTTP requests",
915 u64_option, u64_jsonfmt, &bitcoind->rpcclienttimeout),
916 plugin_option("bitcoin-retry-timeout",
917 "int",
918 "how long to keep retrying to contact bitcoind"
919 " before fatally exiting",
920 u64_option, u64_jsonfmt, &bitcoind->retry_timeout),
921 plugin_option_dev("dev-no-fake-fees",
922 "bool",
923 "Suppress fee faking for regtest",
924 bool_option, NULL, &bitcoind->dev_no_fake_fees),
925 plugin_option_dev("dev-ignore-ibd",
926 "bool",
927 "Never tell lightningd we're doing initial block download",
928 bool_option, NULL, &bitcoind->dev_ignore_ibd),
929 NULL);
930}

Callers

nothing calls this directly

Calls 4

setup_localeFunction · 0.85
new_bitcoindFunction · 0.70
plugin_mainFunction · 0.70
plugin_optionClass · 0.70

Tested by

no test coverage detected