-
Couldn't load subscription status.
- Fork 312
Filecoin Pin docs: update landing page and add dApp demo and github action example #2425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
52b0c86
add pin assets
jennijuju a2fe58e
update pin page names
jennijuju 750fb0a
update pin readme:wq!
jennijuju a29bf17
Incorporating latest changes from Notion
BigLep 07b03df
Fixing links
BigLep f0fab37
Add in Github Actions doc that was in Jame's branch.
BigLep fad7240
Typo fix
BigLep 92c4e26
Minor title changes...
BigLep 9e3f8ce
Heading changes
BigLep 650760f
Adjust headings for CLI so that the table of contents renders correctly
BigLep 158c535
Updating the landing page
BigLep b2846a3
Apply suggestion from @momack2
BigLep ed2c21c
Apply suggestion from @momack2
BigLep 282992b
Update builder-cookbook/filecoin-pin/README.md
BigLep 8c6df01
Update builder-cookbook/filecoin-pin/pin-dapp.md
BigLep ffb3be7
Update builder-cookbook/filecoin-pin/pin-dapp.md
BigLep 7fe7c41
Incorporated comments. Expanded the README.
BigLep ee6fed2
Added youtube link.
BigLep 82dd3eb
Fixed description since hyperlinks don't render.
BigLep 94d65de
Update builder-cookbook/filecoin-pin/README.md
BigLep 6e7aadd
Update builder-cookbook/filecoin-pin/filecoin-pin-cli.md
BigLep a954a7b
Fixing links
BigLep 446fd3d
Trying other youtube link.
BigLep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| --- | ||
| description: How to use the Filecoin Pin CLI and creating GitHub Actions from the terminal | ||
| description: Learn about Filecoin Pin for easy storage in Filecoin with retrieval using standard IPFS Mainnet tooling. | ||
BigLep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| # Filecoin Pin | ||
|
|
||
| TODO: fill this in with content from FilOz blog post. | ||
|
|
||
| * [filecoin-pin-cli.md](filecoin-pin-cli.md "mention") | ||
| * [host-a-website-with-filecoin-pin-using-github-actions.md](host-a-website-with-filecoin-pin-using-github-actions.md "mention") | ||
| * [store-ipfs-files-on-filecoin-a-drag-and-drop-guide.md](store-ipfs-files-on-filecoin-a-drag-and-drop-guide.md "mention") | ||
| * [pin-github-actions.md](pin-github-actions.md "mention") | ||
BigLep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [pin-dapp.md](pin-dapp.md "mention") | ||
BigLep marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * [faq.md](faq.md "mention") | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...-cookbook/filecoin-pin/host-a-website-with-filecoin-pin-using-github-actions.md
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
| description: See an example of Filecoin Pin working end to end within a web context. | ||
| --- | ||
|
|
||
| # Filecoin Pin dApp Demo | ||
|
|
||
| ## What You'll Build | ||
|
|
||
| In this walkthrough, you’ll build a simple drag-and-drop file uploader that: | ||
|
|
||
| - Stores IPFS files directly on Filecoin with built-in payments, all in browser! | ||
BigLep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Tracks real-time upload progress through each step | ||
| - Retrieves data easily from IPFS Mainnet and the underlying Filecoin Service Provider | ||
| - Verifies persistent storage with on-chain Filecoin proofs | ||
| - Multi-user support with session-based authentication | ||
| - Seamlessly integrates with React, TypeScript, and Vite | ||
|
|
||
| ## Setup | ||
|
|
||
| We will start building by [forking the *filecoin-pin-website demo repo](https://github.com/filecoin-project/filecoin-pin-website/fork).* Make sure you have **Node.js 18+** and **npm 9+** installed. The dapp works with Filecoin Calibration testnet. | ||
|
|
||
| This will take ~10min. ⏲️ | ||
|
|
||
| ### Step 1: Fork, Clone, and Install Dependencies | ||
|
|
||
| ```bash | ||
| # Fork the repo using the command below | ||
| # or visit [https://github.com/filecoin-project/filecoin-pin-website/fork](https://github.com/filecoin-project/filecoin-pin-website/fork) | ||
| gh repo fork filecoin-project/filecoin-pin-website | ||
|
|
||
| git clone https://github.com/YOUR-USERNAME/filecoin-pin-website.git | ||
| cd filecoin-pin-website | ||
| npm install | ||
| ``` | ||
|
|
||
| ### **Step 2: Set Up Your Filecoin Wallet** | ||
|
|
||
| A Filecoin wallet is needed to send transactions on Filecoin and pay for the Filecoin storage service. | ||
|
|
||
| This demo dapp supports two authentication methods: | ||
|
|
||
| - **Private Key:** easiest for local development and learning. | ||
| - **Session Key:** recommended for production deployments - allows multiple users to share one wallet safely. | ||
|
|
||
| 💡 The demo repo supports deployment with a shared session key, allowing multiple users to safely upload files using the same wallet. It has hardcoded DEFAULT_WALLET_ADDRESS and DEFAULT_SESSION_KEY that are ready to go, but please do NOT use it for production. You can override these defaults with env vars, see instructions [here](https://github.com/filecoin-project/filecoin-pin-website/blob/main/CONTRIBUTING.md#local-setup)! | ||
|
|
||
| **2.1 Get test FIL and test USDFC** | ||
|
|
||
| If you are using your own wallet, you need to get test FIL and test USDFC to pay for the Filecoin storage service and transactions. | ||
|
|
||
| 1. Create or use an existing Filecoin wallet on the ****Calibration testnet**** ([such as MetaMask](https://docs.filecoin.io/basics/assets/metamask-setup#tab-calibration)). | ||
|
|
||
| 2. Visit the [Filecoin Calibration Faucet](https://faucet.calibnet.chainsafe-fil.io/funds.html) to get free test FIL (to pay for transaction gas). | ||
|
|
||
| 3. Visit the [Filecoin USDFC faucet]([https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc](https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc?__cf_chl_tk=qFwEfa7MNFkJlhKo32IUtR9rgP99qqf_XOmTs7qhusg-1758703656-1.0.1.1-gE8b6EQEmdp0lgg0gk5j2UZhF_69vRyYAAhtt..weyA)) to get test USDFC, which is a USD stable coin backed by FIL that can be used to pay for services. | ||
|
|
||
| ### **Step 3: Run Your dApp** | ||
|
|
||
| Fire up your local development server: | ||
|
|
||
| ```bash | ||
| npm run dev | ||
| ``` | ||
|
|
||
| Visit `http://localhost:5173` and you should see your dApp running! That is all it takes to set up your app. Now, let’s upload a file to see the magic happen! | ||
|
|
||
| ## Store IPFS Files on Filecoin | ||
|
|
||
| The magic happens in one key file [**`src/hooks/use-filecoin-upload.ts`**](https://github.com/filecoin-project/filecoin-pin-website/blob/main/src/hooks/use-filecoin-upload.ts). This is where your IPFS files get uploaded to Filecoin. | ||
|
|
||
| ### Step 1: Upload the data | ||
|
|
||
| - **Prepare Service** - Validates wallet balance and gets the Filecoin Warm Storage service initialized. | ||
| - **Create CAR** - Converts your file to an IPFS CAR (Content Addressed aRchive) file. | ||
| - **Upload** - Sends the CAR file to a Filecoin Storage Provider (SP). | ||
|
|
||
|  | ||
|
|
||
| ### Step 2: Announce CIDs and confirm the transaction | ||
|
|
||
| The Filecoin SP: | ||
|
|
||
| - indexes the IPFS CAR file and publishes all the contained CIDs to the IPFS network via IPNI. | ||
| - commits to the Filecoin network via onchain transactions to store the data. Once the transaction is confirmed, your data is paid to be persisted on Filecoin. | ||
|
|
||
|  | ||
|
|
||
| ### Step 3: Download the data | ||
|
|
||
| Your data is available from both the IPFS Mainnet network using standard traditional IPFS tooling and/or directly from Filecoin SPs. | ||
|
|
||
|  | ||
|
|
||
| ### **Step 4: Verify your data storage** | ||
|
|
||
| Filecoin storage providers submit cryptographic proofs regularly onchain to prove that they are storing your data, and you can verify and see it for yourself [on the PDP Scan](https://pdp.vxb.ai/calibration). | ||
BigLep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| That is it - you now have a dapp with a drag-and-drop interface to store IPFS Files on Filecoin! | ||
BigLep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Next Steps | ||
|
|
||
| 1. Check back on the [filecoin-pin-website repo](https://github.com/filecoin-project/filecoin-pin-website) - it will continue to be updated as new functionality is brought to filecoin-pin. | ||
| 2. Feel free to report any issues with the dApp demo to https://github.com/filecoin-project/filecoin-pin-website/issues | ||
| 3. Check out the the [other example uses of filecoin-pin](../). | ||
| 4. Ask questions or get help with filecoin-pin in the [supported communcation channels](https://github.com/filecoin-project/filecoin-pin?tab=readme-ov-file#support-info). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| description: Host a static website with Filecoin Pin using GitHub Actions | ||
| --- | ||
|
|
||
| # Filecoin Pin GitHub Action | ||
|
|
||
| `filecoin-pin` can be used in CI pipelines like GitHub Actions to upload assets to the Filecoin decentralized storage network. Static website assets are particularly good candidates, given the existing tooling within the IPFS ecosystem for static website retrieval. | ||
|
|
||
| The [Filecoin Pin repo](https://github.com/filecoin-project/filecoin-pin) has an [example upload to Filecoin GitHub Action](https://github.com/filecoin-project/filecoin-pin/tree/master/upload-action) that can be used directly or as a starting point for your own CI pipeline. | ||
|
|
||
| The example filecoin-pin upload action itself has a [usage example](https://github.com/filecoin-project/filecoin-pin/tree/master/upload-action/examples), and you can even see it in production as part of [filecoin-pin-website's CI pipeline](https://github.com/filecoin-project/filecoin-pin-website/tree/main/.github/workflows)! | ||
|
|
||
| Below is also a video walkthrough of the example GitHub Action in use! | ||
|
|
||
|
|
||
| <!-- TODO: FIX THIS AFTER UPLOADING https://drive.google.com/drive/folders/1H6_g9Vvnh5RnzO7ymE3liLjNAL5hmpW2?usp=sharing to YouTube --> | ||
| {% embed url="https://www.youtube.com/watch?v=D_uLM5i0Z4c=" %} | ||
|
|
||
| Note: there is more work coming soon to add "filecoin-pin functionality" directly to the robust [ipshipyard/ipfs-deploy-action](https://github.com/ipshipyard/ipfs-deploy-action) ([tracking issue](https://github.com/ipfs/ipfs-deploy-action/issues/39)). | ||
|
|
||
|
|
2 changes: 0 additions & 2 deletions
2
...der-cookbook/filecoin-pin/store-ipfs-files-on-filecoin-a-drag-and-drop-guide.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.