diff --git a/common/navigation-data.js b/common/navigation-data.js index 492ccf2f..c17ae7cd 100644 --- a/common/navigation-data.js +++ b/common/navigation-data.js @@ -159,6 +159,14 @@ export const generate = ({ library = [], slates = [] }) => [ filecoin: true, children: null, }, + { + id: "V1_NAVIGATION_MINERS", + decorator: "MINERS", + name: "Trusted miners", + pageTitle: "Trusted miners", + filecoin: true, + children: null, + }, ], }, { diff --git a/common/svg.js b/common/svg.js index b4a01d41..84d6e1d3 100644 --- a/common/svg.js +++ b/common/svg.js @@ -559,6 +559,7 @@ export const Miners = (props) => ( stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" + strokeWidth="1.5" > diff --git a/components/core/Application.js b/components/core/Application.js index 86c4294d..a7079ff6 100644 --- a/components/core/Application.js +++ b/components/core/Application.js @@ -32,6 +32,7 @@ import ScenePublicSlate from "~/scenes/ScenePublicSlate"; import SceneArchive from "~/scenes/SceneArchive"; import SceneMakeFilecoinDeal from "~/scenes/SceneMakeFilecoinDeal"; import SceneEncryptedData from "~/scenes/SceneEncryptedData"; +import SceneMiners from "~/scenes/SceneMiners"; // NOTE(jim): // Sidebars each have a decorator and can be shown to with _handleAction @@ -94,6 +95,7 @@ const SCENES = { FILECOIN: , MAKE_DEAL: , ENCRYPTED: , + MINERS: , }; export default class ApplicationPage extends React.Component { diff --git a/components/core/ApplicationNavigation.js b/components/core/ApplicationNavigation.js index 89aa9c8b..a740bd8f 100644 --- a/components/core/ApplicationNavigation.js +++ b/components/core/ApplicationNavigation.js @@ -24,6 +24,7 @@ const IconMap = { SETTINGS: , DIRECTORY: , FILECOIN: , + MINERS: , }; const STYLES_NAVIGATION = css` diff --git a/components/sidebars/SidebarFilecoinArchive.js b/components/sidebars/SidebarFilecoinArchive.js index fb1b55a2..a58292a8 100644 --- a/components/sidebars/SidebarFilecoinArchive.js +++ b/components/sidebars/SidebarFilecoinArchive.js @@ -89,7 +89,7 @@ export default class SidebarFilecoinArchive extends React.Component { fontSize: Constants.typescale.lvl3, }} > - Make storage deal + Archive your data diff --git a/scenes/SceneArchive.js b/scenes/SceneArchive.js index 81f9da68..b443a1c4 100644 --- a/scenes/SceneArchive.js +++ b/scenes/SceneArchive.js @@ -23,6 +23,8 @@ let mounted = false; export default class SceneArchive extends React.Component { state = { networkViewer: null, + allow_automatic_data_storage: this.props.viewer + .allow_automatic_data_storage, allow_encrypted_data_storage: this.props.viewer .allow_encrypted_data_storage, }; @@ -54,6 +56,7 @@ export default class SceneArchive extends React.Component { await Actions.updateViewer({ data: { + allow_automatic_data_storage: this.state.allow_automatic_data_storage, allow_encrypted_data_storage: this.state.allow_encrypted_data_storage, }, }); @@ -94,7 +97,7 @@ export default class SceneArchive extends React.Component { return ( - + Use this section to archive all of your data on to Filecoin through a storage deal. Once you make a storage deal, you can view the logs here.
@@ -111,7 +114,7 @@ export default class SceneArchive extends React.Component { }) } > - Make storage deal + Archive your data + + Allow Slate to make archive storage deals on your behalf to the + Filecoin Network. You will get a receipt in the Filecoin section. + + -
- { - return { - miner, - }; - } - ), - }} - /> -
-
-
- { - return { - miner, - }; - } - ), - }} - /> -
- { - this.setState({ [e.target.name]: e.target.value }); - }; + async componentDidMount() { + if (mounted) { + return null; + } + + mounted = true; + + let miners = []; + try { + const response = await fetch( + "https://sentinel.slate.host/api/static-global-miners" + ); + const json = await response.json(); + const sources = json.data.buckets; + + sources.forEach((group) => { + miners = [ + ...group.minerAddresses.map((name) => { + return { location: group.name, name }; + }), + ...miners, + ]; + }); + } catch (e) {} + + this.setState({ miners }); + } + + componentWillUnmount() { + mounted = false; + } render() { return ( - Miners -
+ + Whenever you make a deal against the Filecoin Network, Slate works + with Textile's infrastructure to find the best possible miner to store + your data. Here is the list of miners. + + +
{ + return { + miner: miner.name, + location: miner.location, + }; + }), }} - selectedRowId={this.state.table_miners} - onNavigateTo={this.props.onNavigateTo} - onAction={this.props.onAction} - onChange={this._handleChange} - name="table_miners" />
diff --git a/scenes/SceneSettings.js b/scenes/SceneSettings.js index 8649c705..ad7354fc 100644 --- a/scenes/SceneSettings.js +++ b/scenes/SceneSettings.js @@ -144,30 +144,6 @@ export default class SceneSettings extends React.Component { {this.state.networkViewer ? ( -
- { - return { - miner, - }; - } - ), - }} - /> -
- {/*