NavigationContentFooter
Jump toSuggest an edit

Getting started with Scaleway IPFS using CLI

Reviewed on 08 January 2024Published on 07 July 2023

Created by Protocol Labs, InterPlanetary File System (IPFS) is a decentralized protocol used to store and share content.

Scaleway IPFS Pinning allows you to permanently store a copy of your data from the public IPFS network on a Scaleway-owned node, thus providing you with an added layer of performance in the region of your choice. That way, your data remains available and accessible, even when your local machine is offline.

With your content now available on both your local node and our resilient and reliable external nodes, you drastically minimize the risk of disruptions thanks to redundancy. You can also enhance your data storage efficiency by pinning your content to your Scaleway node, and then remove it from your local node.

In this quickstart, we show you how you can create and manage your volumes and pins from the console, via the Scaleway Command Line Interface.

Important
  • Data is public: our IPFS nodes are bootstrapped with public IPFS nodes. This implies that any pinned content will be available on the public IPFS network.
  • Data is shared: public IPFS nodes can fetch and host your pinned content. This means your data could be hosted anywhere from America, Asia, and everything in between. Once the content is delivered to external peers, Scaleway cannot delete it.
  • Data is not encrypted: we do not apply any encryption algorithm to your data.

Scaleway Command Line Interface overview

The Scaleway Command Line Interface (CLI) allows you to pilot your Scaleway infrastructure directly from your terminal, providing a faster way to administer and monitor your resources. Scaleway CLI is an essential tool for operating efficiently in your cloud environment. It provides many functionalities, including the ability to create and manage volumes and pins.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • A valid API key
  • Configured your SSH key
  • Downloaded and installed the Scaleway CLI
  • Added data to your own local node and retrieved its CID

How to create a volume

A volume serves as a storage area for a set of pins. Think of it as Object Storage buckets.

Enter the following command to create your volume using the CLI. Make sure to replace the example values with your own, using the configuration table below:

SCW_ENABLE_LABS=true scw ipfs volume create project-id=00000000-0000-0000-0000-000000000000 region=fr-par name=my-volume

You should get a response like the following, providing details about your newly created volume.

ID 11111111-1111-1111-1111-111111111111
ProjectID 00000000-0000-0000-0000-000000000000
Region fr-par
CountPin 0
CreatedAt now
UpdatedAt now
Name my-volume

| Parameter | Description | | :----------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | project-id | ID of the Project you want to create your volume in. Your Project name can only contain alphanumeric characters, spaces, dots, and dashes. To find your Project ID, you can consult the Scaleway console | | region | Create a volume in this given region. Possible values are fr-par, pl-waw and nl-ams. Default value is fr-par. | name | Create a volume with this given name. |

How to pin content from a CID

Now that we have a volume, we can pin content from CIDs to it. Pinning a file essentially allows you to specify which particular content should always be stored and readily accessible on the IPFS network.

  1. Enter the following command to pin your content on your volume. Make sure to replace the example values with your own, using the configuration table below:

    scw ipfs pin create-by-cid volume-id=11111111-1111-1111-1111-111111111111 cid=Qmdi7ERksspfxWXfU8ATRUt7iCjZJbEbDrUoMDtjnbdTwo name=MyNewPinByCID
    ParameterDescription
    volume-idID of the volume you want to pin your content to. To find your volume ID, you can consult the Scaleway console
    cidRetrieve the Content Identifier (CID) of the content you added to your own local node using IPFS Desktop. You can find out more through our dedicated documentation
    nameCreate a pin with this given name.
  2. Enter the following command to check the status of your pin and see if the content was effectively pinned on a Scaleway-owned node:

    scw ipfs pin get pin-id=22222222-2222-2222-2222-222222222222 volume-id=11111111-1111-1111-1111-111111111111

    You should get a response like the following, providing details about your newly pinned content.

    PinID 0691fe5c-e8ba-40b3-b5cd-bfa69936aac5
    Status pinned
    CreatedAt 14 minutes ago
    Cid.Cid QmQ6znATkFZdgniHofhFUSm3imBWN5yf5yiU5sLp56VRCu
    Cid.Name MyPinByCID
    Cid.Meta.ID 2672dr5c-z9cd-80s3-c6de-bfa70039bbc6
    Delegates.0 /dnsaddr/delivery.ipfs.labs.scw.cloud/p2p/QmQ6znATkFZdgniHofhFUSm3imBWN5yf5yiU5sLp56VRCu
    Info.ID 0691fe5c-e8ba-40b3-b5cd-bfa69936aac5
    Info.URL -
    Info.Size 40733
    Info.Progress 100
    Info.StatusDetails pinned_ok

How to retrieve pinned content

Once your content is pinned on our service, you can fetch it via any compatible IPFS client connected to the public IPFS network. This can be Kubo, or IPFS desktop.

For the sake of this example, we are going to use Kubo. You can find out more about the Kubo CLI on our dedicated documentation.

  1. Run the following command to retrieve your content via Kubo CLI. Make sure to replace the example CID value with your own.

    ipfs get QmQ6znATkFZdgniHofhFUSm3imBWN5yf5yiU5sLp56VRCu

    You should get a response like the following, indicating that the content has properly been saved on your local machine.

    Saving file(s) to QmQ6znATkFZdgniHofhFUSm3imBWN5yf5yiU5sLp56VRCu
    39.78 KiB / 39.78 KiB [============================================] 100.00% 0s
  2. Navigate your files to retrieve the content. The content is saved under a name that matches its CID.

How to unpin content

If you no longer wish to store a content on your Scaleway-owned node, you can delete it.

Run the following command to delete your content:

scw ipfs pin delete pin-id=0691fe5c-e8ba-40b3-b5cd-bfa69936aac5 volume-id=11111111-1111-1111-1111-111111111111

You should get the following output, confirming your pin has been successfully deleted on Scaleway’s end.

✅ Pin has been successfully deleted.

How to delete a volume

You can delete an entire volume. This will remove all attached pins.

Run the following command to delete your volume:

scw ipfs volume delete volume-id=11111111-1111-1111-1111-111111111111

You should get the following output, confirming your volume has been deleted.

✅ Volume has been successfully deleted.
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway