Peers List View Source



Here is an example of an experience for getting peers from Textile's Powergate. This component will be expanded upon when there is more data from the endpoint.


idname
example-peer-id-1
node-de23500d-5d37-438e-9868-f0c100906128



Code



0
import * as React from "react";
1
import { PeersList } 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 { peersList } = await PowerGate.net.peers();
12
    this.setState({ peersList, token });
13
  };
14
15
  render() {
16
    return <PeersList data={this.state.peersList} />;
17
  }
18
}
19
ExperiencesCreateFilecoinAddressCreateFilecoinStorageDealCreateTokenFilecoinBalancesListFilecoinDealsListFilecoinSettingsFriendsListPeersListSendAddressFilecoin

Components
Avatar GroupButtonsCard TabsCarouselCheckboxesColorsDatepickerDropdownsGlobeHover TileIconsInputsLine ChartList EditorLoadersModalsNotificationsRadiosSlidersStatsTablesTabsTogglesTooltipsTypography
View source