Skip to content

Commit cb629c7

Browse files
committed
refactor: hide GUI, prioritize CLI
1 parent 42fa8fc commit cb629c7

File tree

2 files changed

+42
-24
lines changed

2 files changed

+42
-24
lines changed

docs/how-to/pin-files.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Learn how to pin files in IPFS in order to keep your files and othe
88

99
Pinning is a very important concept in IPFS. IPFS semantics try to make it feel like every single object is local — there is no "retrieve this file for me from a remote server", just `ipfs cat` or `ipfs get`, which act the same way no matter where the actual object is located.
1010

11-
While this is nice, sometimes you want to be able to control what you keep around. **Pinning** is the mechanism that allows you to tell IPFS to always keep a given object somewhere — the default being your local node, though this can be different if you use a [third-party remote pinning service](#using-a-pinning-service). IPFS has a fairly aggressive caching mechanism that will keep an object local for a short time after you perform any IPFS operation on it, but these objects may get garbage-collected regularly. To prevent that garbage collection, simply pin the hash you care about. Objects added through `ipfs add` are pinned recursively by default.
11+
While this is nice, sometimes you want to be able to control what you keep around. **Pinning** is the mechanism that allows you to tell IPFS to always keep a given object somewhere — the default being your local node, though this can be different if you use a [third-party remote pinning service](#using-a-pinning-service). IPFS has a fairly aggressive caching mechanism that will keep an object local for a short time after you perform any IPFS operation on it, but these objects may get garbage-collected regularly. To prevent that garbage collection, simply pin the CID you care about, or add it to [MFS](/concepts/file-systems/#mutable-file-system-mfs). Objects added through `ipfs add` are pinned recursively by default. Things in MFS are not pinned by default, but are protected from garbage-collection, so one can think about MFS as a mechanism for implicit pinning.
1212

1313
Let's look at this example to explore pinning to your local IPFS node in a bit more depth:
1414

@@ -51,6 +51,10 @@ All the information above assumes that you're pinning items locally — that is,
5151

5252
While you can use a remote pinning service's own GUI, CLI, or other dev tools to manage IPFS files pinned to their service, you can also work directly with pinning services using your local IPFS installation — meaning that you don't need to learn a pinning service's unique API or other tooling.
5353

54-
- The [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/) offers a specification that enables developers to integrate any pinning service that supports the spec, using simple, standardized schemas and fields.
55-
- If you use go-ipfs from the command line, you can add your favorite pinning service(s), pin CIDs under human-readable names, get pin statuses, and more straight from the CLI. [Learn how →](/how-to/work-with-pinning-services/)
54+
- The [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/) offers a specification that enables developers to integrate any pinning service that supports the spec, or create their own. Thanks to the OpenAPI spec format, both clients and servers can be [generated](https://github.com/ipfs/pinning-services-api-spec#code-generation) from the YAML spec file.
55+
56+
- If you use go-ipfs 0.8+ from the command line, you have access to `ipfs pin remote` commands: the porcelain client for interacting with Pinning Service APIs. Add your favorite pinning service(s), pin CIDs under human-readable names, get pin statuses, and more straight from the CLI. [Learn how →](/how-to/work-with-pinning-services/)
57+
58+
<!-- commented out for now, ok to uncomment when https://github.com/ipfs/ipfs-gui/issues/91 is closed
5659
- [IPFS Desktop](https://github.com/ipfs-shipyard/ipfs-desktop) and its equivalent in-browser IPFS web interface, the [IPFS Web UI](https://github.com/ipfs-shipyard/ipfs-webui), both support remote pinning services, so you can pin to your favorite pinning service(s) straight from the UI. [Learn how →](/how-to/work-with-pinning-services/)
60+
-->

docs/how-to/work-with-pinning-services.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ description: Learn how to use or create remote pinning services with IPFS, the I
55

66
# Work with remote pinning services
77

8-
Depending on how you use IPFS, you might find it helpful to use a **remote pinning service** instead of, or in addition to, pinning files on your local IPFS node. Whether it happens remotely or locally, **pinning** an item in IPFS identifies it as something you always wish to keep available, exempting it from the routine _garbage collection_ that IPFS does on infrequently-used items in order to efficiently manage storage space. [Learn more about pinning →](/how-to/pin-files).
8+
Depending on how you use IPFS, you might find it helpful to use a **remote pinning service** instead of, or in addition to, pinning files on your local IPFS node. Whether it happens remotely or locally, **pinning** an item in IPFS identifies it as something you always wish to keep available, exempting it from the routine _garbage collection_ that IPFS does on infrequently-used items in order to efficiently manage storage space. [Learn more about local pinning →](/how-to/pin-files)
99

1010
If you've got just one local IPFS node that's always running, local pinning may be all you need to ensure your important items are persisted and never garbage-collected. However, using a remote pinning service — or creating your own — might be useful to you if:
1111

12-
- Your local node isn't always online, but you need items to be consistently available
12+
- Your local node isn't always online, but you need items to be consistently available.
1313
- You'd like to keep a persistent backup of your local node's files somewhere else.
1414
- You don't have all the disk space you need on your local node.
1515
- You run more than one IPFS node, and would like to use one of them as a "personal pinning service" as your preferred location for permanent storage.
1616

1717
There are a number of commercial pinning services that make it easy for you to purchase pinning capacity for your important files, some of which include Pinata, Temporal, Infura, and others. Each of these third-party services has its own unique interface for pinning files and managing those pins; this could include a GUI, an API, CLI commands, or other tooling.
1818

19-
However, you don't need to learn new commands or tools if your pinning service of choice supports the [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/) specification — because those pinning services are supported within IPFS itself through the command line, [IPFS Desktop](https://github.com/ipfs-shipyard/ipfs-desktop), and the [IPFS Web UI](https://github.com/ipfs-shipyard/ipfs-webui). And, if you're interested in creating your own pinning service for your own personal or shared use, you can directly integrate it with IPFS Desktop/Web UI and the IPFS CLI by using the IPFS Pinning Service API.
19+
However, you don't need to learn new commands or tools if your pinning service of choice supports vendor-agnostic [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/) specification those services are supported within IPFS itself through the command line: `ipfs pin remote --help`
2020

21-
As of January 2021, [Pinata](https://pinata.cloud/) supports the IPFS Pinning Service API, with more pinning services on the way!
21+
As of January 2021, [Pinata](https://pinata.cloud/) supports the [IPFS Pinning Service API endpoint](https://pinata.cloud/documentation#PinningServicesAPI), with more pinning services on the way! [Learn how to create your own →](#create-your-own-pinning-service)
2222

2323
## Use an existing pinning service
2424

2525
To add and use a remote pinning service directly in IPFS, you'll first need to have an account with that service. Once you've got an account, follow these steps to add and use it:
2626

27+
<!-- TODO: GUI section can be uncommented after https://github.com/ipfs/ipfs-gui/issues/91 is closed
28+
2729
### IPFS Desktop or IPFS Web UI
2830
2931
You can add your favorite pinning service(s) to IPFS Desktop/Web UI directly, enabling you to pin and unpin items from the Files screen in the same way as as you do local pins.
@@ -57,58 +59,70 @@ Now that you’re set up, you can pin or unpin files to your new pinning service
5759
5860
![Desktop/Web UI Files screen with the action menu open and "Set pinning" visible](https://user-images.githubusercontent.com/1507828/102558546-e6656000-408a-11eb-97b8-5fdb060602d2.png)
5961
62+
-->
63+
6064
### IPFS CLI
6165

62-
In addition to integrating your favorite pinning service into IPFS Desktop or Web UI, you can also use it directly from the command line using the `ipfs` command.
66+
Command line users benefit from `ipfs pin remote` commands, which provide porcelain that simplifies remote pinning operations. Built-in Pinning Service API client executes all the necessary remote calls under the hood.
6367

6468
#### Adding a new pinning service
6569

6670
To add a new pinning service, use the following command:
6771

68-
```bash
69-
ipfs pin remote service add nickname https://api.mypinningservice.com/endpoint myAccessToken
72+
```console
73+
$ ipfs pin remote service add nickname https://my-pin-service.example.com/api-endpoint myAccessToken
7074
```
7175

72-
- `nickname` is a unique name for this particular instantiation of a pinning service. TThis can be helpful if, for example, you want to add two accounts from the same service.
73-
- `https://api.mypinningservice.com/endpoint` is the endpoint supplied to you by the pinning service. Check the service's documentation for more info.
74-
- `myAccessToken` is the unique token provided to you by the pinning service. Check the service's documentation for more info.
76+
- `nickname` is a unique name for this particular instantiation of a pinning service. This can be helpful if, for example, you want to add two accounts from the same service.
77+
- `https://my-pin-service.example.com/api-endpoint` is the endpoint supplied to you by the pinning service. Check the service's documentation for more info.
78+
- `myAccessToken` is the unique secret token provided to you by the pinning service. Check the service's documentation for more info.
7579

7680
#### Using a pinning service
7781

7882
Here are a few CLI commands to get you started. In all examples, replace `nickname` with the unique name you gave the pinning service when you added it.
7983

8084
To pin a CID under under a human-readable name:
8185

82-
```bash
83-
ipfs pin remote add --service=nickname --name=war-and-peace.txt bafybeib32tuqzs2wrc52rdt56cz73sqe3qu2deqdudssspnu4gbezmhig4
86+
```console
87+
$ ipfs pin remote add --service=nickname --name=war-and-peace.txt bafybeib32tuqzs2wrc52rdt56cz73sqe3qu2deqdudssspnu4gbezmhig4
8488
```
8589

8690
To list successful pins:
8791

88-
```bash
89-
ipfs pin remote ls --service=nickname
92+
```console
93+
$ ipfs pin remote ls --service=nickname
9094
```
9195

92-
To list pending pins:
96+
To list all "pending" pins:
9397

94-
```bash
95-
ipfs pin remote ls --service=nickname --status=queued,pinning,failed
98+
```console
99+
$ ipfs pin remote ls --service=nickname --status=queued,pinning,failed
96100
```
97101

98102
For more commands and general help:
99103

100-
```bash
101-
ipfs pin remote --help
104+
```console
105+
$ ipfs pin remote --help
102106
```
103107

104108
## Create your own pinning service
105109

106-
As noted above, you aren't limited to adding the remote pinning services listed in the Settings screen of Desktop/Web UI. Any remote pinning service that uses the [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec) can be added as a custom pinning service — which also means that you can create your own! This might be useful in circumstances like:
110+
Obviously you aren't limited to a static list of pre-approved services. Any remote pinning service compatible with the [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec) can be added as a custom pinning service — which also means that you can create your own! This might be useful in circumstances like:
107111

108112
- Designating one of your own IPFS nodes to be a _personal pinning service_ as a preferred location for permanent storage.
109113
- Running a private pinning service for your friends or company.
110114
- Starting your own commercial pinning service.
111115

112-
As noted above, your service must use the [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec) in order to be interoperable with IPFS Desktop/Web UI and the IPFS CLI. You may also wish to read continuing details on how the API is evolving in the [Pinning Service API Spec GitHub repo](https://github.com/ipfs/pinning-services-api-spec), and be part of the discussion on its further development!
116+
As noted above, your service must use the [IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec) in order to be interoperable with client behind `ipfs pin remote` commands.
117+
118+
119+
::: tip
120+
If you're interested in creating your own pinning service for your own personal or shared use, you can [generate client and server from the OpenAPI spec](https://github.com/ipfs/pinning-services-api-spec#code-generation), reducing the development time.
121+
122+
You may also wish to read continuing details on how the API is evolving in the [Pinning Service API Spec GitHub repo](https://github.com/ipfs/pinning-services-api-spec), and be part of the discussion on its further development!
123+
:::
124+
113125

126+
<!-- TODO this call to action can be uncommented when https://github.com/ipfs/ipfs-gui/issues/91 is closed
114127
If you'd like to make your custom pinning service available to every IPFS user, we welcome your submissions. Once you're ready to open the doors to the public, make a PR against the [IPFS Web UI GitHub repo](https://github.com/ipfs-shipyard/ipfs-webui) in order to add it to the default list of pinning services that are displayed in the Desktop/Web UI Settings screen, and one of the core maintainers will be in touch.
128+
-->

0 commit comments

Comments
 (0)