Esempio n. 1
0
        public async Task Save()
        {
            if (Dirty)
            {
                using (StreamWriter writer = new StreamWriter(ListingFilename))
                {
                    writer.Write(JsonConvert.SerializeObject(this, Formatting.Indented));
                }

                string hashFilename = await IpfsApiWrapper.AddAsync(ListingFilename);

                await IpfsApiWrapper.PublishAsync(hashFilename);

                Dirty = false;
            }
        }
Esempio n. 2
0
        private async Task AddFileNotAlreadyExisting(string filename, object lockObject)
        {
            string hashFilename = await IpfsApiWrapper.AddAsync(filename);

            IpfsFile file = new IpfsFile
            {
                LocalFilename  = filename,
                RemoteFilename = hashFilename
            };

            file.ComputerAndStoreHash(filename);
            lock (lockObject)
            {
                Dirty = true;
                _Files.Add(file);
            }
        }
Esempio n. 3
0
        public async Task Save()
        {
            if (Dirty)
            {
                using (StreamWriter writer = new StreamWriter(ListingFilename))
                {
                    writer.Write(JsonConvert.SerializeObject(this, Formatting.Indented));
                }

                string hashFilename = await IpfsApiWrapper.AddAsync(ListingFilename);

                string filenameHashIpnsEntry = await IpfsApiWrapper.GetAdditionalInformation("salus");

                await IpfsApiWrapper.PublishAsync(hashFilename, filenameHashIpnsEntry);

                Dirty = false;
            }
        }