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

Function main

plugins/bcli.c:871–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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