Class FilesystemPersister


  • public class FilesystemPersister
    extends Object
    FilesystemPersister persists channel data on disk, where each channel's data is stored in a file named after its funding outpoint. Warning: this module does the best it can with calls to persist data, but it can only guarantee that the data is passed to the drive. It is up to the drive manufacturers to do the actual persistence properly, which they often don't (especially on consumer-grade hardware). Therefore, it is up to the user to validate their entire storage stack, to ensure the writes are persistent. Corollary: especially when dealing with larger amounts of money, it is best practice to have multiple channel data backups and not rely only on one FilesystemPersister.
    • Method Detail

      • of

        public static FilesystemPersister of​(String path_to_channel_data)
        Initialize a new FilesystemPersister and set the path to the individual channels' files.
      • get_data_dir

        public String get_data_dir()
        Get the directory which was provided when this persister was initialized.
      • as_Persist

        public Persist as_Persist()
        Constructs a new Persist which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is