You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2016 The Starwels developers
  3. // Distributed under the MIT software license, see the accompanying
  4. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. #ifndef STARWELS_INIT_H
  6. #define STARWELS_INIT_H
  7. #include <string>
  8. class CScheduler;
  9. class CWallet;
  10. namespace boost
  11. {
  12. class thread_group;
  13. } // namespace boost
  14. void StartShutdown();
  15. bool ShutdownRequested();
  16. /** Interrupt threads */
  17. void Interrupt(boost::thread_group& threadGroup);
  18. void Shutdown();
  19. //!Initialize the logging infrastructure
  20. void InitLogging();
  21. //!Parameter interaction: change current parameters depending on various rules
  22. void InitParameterInteraction();
  23. /** Initialize starwels: Basic context setup.
  24. * @note This can be done before daemonization. Do not call Shutdown() if this function fails.
  25. * @pre Parameters should be parsed and config file should be read.
  26. */
  27. bool AppInitBasicSetup();
  28. /**
  29. * Initialization: parameter interaction.
  30. * @note This can be done before daemonization. Do not call Shutdown() if this function fails.
  31. * @pre Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.
  32. */
  33. bool AppInitParameterInteraction();
  34. /**
  35. * Initialization sanity checks: ecc init, sanity checks, dir lock.
  36. * @note This can be done before daemonization. Do not call Shutdown() if this function fails.
  37. * @pre Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.
  38. */
  39. bool AppInitSanityChecks();
  40. /**
  41. * Lock starwels data directory.
  42. * @note This should only be done after daemonization. Do not call Shutdown() if this function fails.
  43. * @pre Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.
  44. */
  45. bool AppInitLockDataDirectory();
  46. /**
  47. * Starwels main initialization.
  48. * @note This should only be done after daemonization. Call Shutdown() if this function fails.
  49. * @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
  50. */
  51. bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler);
  52. /** The help message mode determines what help message to show */
  53. enum HelpMessageMode {
  54. HMM_STARWELSD,
  55. HMM_STARWELS_QT
  56. };
  57. /** Help for options shared between UI and daemon (for -help) */
  58. std::string HelpMessage(HelpMessageMode mode);
  59. /** Returns licensing information (for -version) */
  60. std::string LicenseInfo();
  61. #endif // STARWELS_INIT_H