Filecoin Settings View Source



Here is an example of an experience for getting and setting Filecoin Settings from Textile's Powergate.


General
Hot Storage
Cold Storage
Repairable
If this is enabled and the network detects that a miner is no longer storing your file, it will automatically make a storage deal with a new miner to store the file.



Code



0
import * as React from "react";
1
import { FilecoinSettings } from "slate-react-system";
2
import { createPow } from "@textile/powergate-client";
3
4
const PowerGate = createPow({ host: "https://grpcweb.slate.textile.io" });
5
6
class Example extends React.Component {
7
  componentDidMount = async () => {
8
    const FFS = await PowerGate.ffs.create();
9
    const token = FFS.token ? FFS.token : null;
10
    PowerGate.setToken(token);
11
    const { addrsList } = await PowerGate.ffs.addrs();
12
    const { defaultStorageConfig } = await PowerGate.ffs.defaultStorageConfig();
13
    this.setState({ token, defaultStorageConfig, addrsList });
14
  };
15
16
  _handleSave = async (storageConfig) => {
17
    const response = await PowerGate.ffs.setDefaultStorageConfig(storageConfig);
18
  };
19
20
  render() {
21
    return (
22
      <FilecoinSettings
23
        defaultStorageConfig={this.state.defaultStorageConfig}
24
        addrsList={this.state.addrsList}
25
        onSave={this._handleSave}
26
      />
27
    );
28
  }
29
}
30
ExperiencesCreateFilecoinAddressCreateFilecoinStorageDealCreateTokenFilecoinBalancesListFilecoinDealsListFilecoinSettingsFriendsListPeersListSendAddressFilecoin

Components
Avatar GroupButtonsCard TabsCarouselCheckboxesColorsDatepickerDropdownsGlobeHover TileIconsInputsLine ChartList EditorLoadersModalsNotificationsRadiosSlidersStatsTablesTabsTogglesTooltipsTypography
View source