Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
800 changes: 485 additions & 315 deletions .gitbook.yaml

Large diffs are not rendered by default.

275 changes: 128 additions & 147 deletions SUMMARY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion WELCOME.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ layout:

Choose your own path to start exploring Filecoin:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>💡 <strong>Learn the basics</strong></td><td>New to Filecoin and looking for foundational concepts? Start with the Basics section to understand the essentials and kick off your journey!</td><td></td><td><a href="basics/what-is-filecoin/">what-is-filecoin</a></td></tr><tr><td>🔧 <strong>Build with Filecoin</strong></td><td>Ready to develop on the Filecoin network? Head to the Developers section for guides and examples to help bring your project to life.</td><td></td><td><a href="smart-contracts/fundamentals/the-fvm.md">the-fvm.md</a></td></tr><tr><td>🏗️ <strong>Become a Storage Provider</strong></td><td>Thinking about running a provider node on Filecoin? Visit the Provider section for comprehensive guidance on getting started.</td><td></td><td><a href="storage-providers/basics/">basics</a></td></tr><tr><td>📊 <strong>Store data</strong></td><td>Looking to store large volumes of data? Explore the Store section to review the various storage options Filecoin offers.</td><td></td><td><a href="basics/what-is-filecoin/storage-model.md">storage-model.md</a></td></tr></tbody></table>
<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>💡 <strong>Learn the basics</strong></td><td>New to Filecoin and looking for foundational concepts? Start with the Basics section to understand the essentials and kick off your journey!</td><td></td><td><a href="getting-started/what-is-filecoin/">what-is-filecoin</a></td></tr><tr><td>🔧 <strong>Build with Filecoin</strong></td><td>Ready to develop on the Filecoin network? Head to the Developers section for guides and examples to help bring your project to life.</td><td></td><td><a href="core-concepts/filecoin-virtual-machine/">the-fvm.md</a></td></tr><tr><td>🏗️ <strong>Become a Storage Provider</strong></td><td>Thinking about running a provider node on Filecoin? Visit the Provider section for comprehensive guidance on getting started.</td><td></td><td><a href="storage-providers/getting-started.md">getting-started.md</a></td></tr><tr><td>📊 <strong>Store data</strong></td><td>Looking to store large volumes of data? Explore the Store section to review the various storage options Filecoin offers.</td><td></td><td><a href="getting-started/what-is-filecoin/storage-model.md">storage-model.md</a></td></tr></tbody></table>

[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/)
9 changes: 0 additions & 9 deletions basics/assets/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions basics/how-retrieval-works/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions basics/how-retrieval-works/saturn.md

This file was deleted.

11 changes: 0 additions & 11 deletions basics/how-storage-works/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions basics/project-and-community/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions basics/the-blockchain/README.md

This file was deleted.

25 changes: 25 additions & 0 deletions build/advanced/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: >-
Advanced tools and integrations for smart contract developers building on Filecoin.
---

# Advanced

This section covers advanced integrations and services available to smart contract developers on Filecoin, including bridges, oracles, databases, and automation tools.

## Table of contents

* [Filecoin Onchain Cloud](filecoin-onchain-cloud.md) — programmable storage, retrieval, and payments through the FOC service layer
* [Wrapped FIL](wrapped-fil.md) — ERC-20 token that bridges native FIL to other blockchains
* [Oracles](oracles.md) — connect smart contracts to external data sources
* [Multicall](multicall.md) — batch multiple contract calls into a single transaction
* [Multisig](multisig.md) — wallets that require multiple signatures for transactions
* [FEVM indexers](fevm-indexers.md) — query Filecoin chain data without running an archival node
* [Cross-chain bridges](cross-chain-bridges.md) — transfer assets between Filecoin and other networks
* [Contract automation](contract-automation.md) — trigger smart contract actions based on off-chain events
* [Relay](relay.md) — meta-transactions that let users interact without paying gas
* [Decentralized databases](decentralized-databases.md) — store application data using Tableland on Filecoin
* [Privacy and access control](privacy-and-access-control.md) — tools for managing data access and privacy
* [Interplanetary consensus](../../getting-started/interplanetary-consensus.md) — scalable consensus for cross-chain communication

[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/build/advanced)
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ Celar’s CBridge supports both Filecoin Mainnet and Calibration testnet.



[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges)
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/build/advanced/cross-chain-bridges)
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,30 @@ To learn more about what is tableland and how to use it, you can visit [https://

Ensure that you install and import the necessary dependencies in your projects.

* [Tableland](https://tableland.xyz/)
* [RaaS Starter Kit](https://github.com/filecoin-project/raas-starter-kit)
* [Openzeppelin](https://docs.openzeppelin.com/contracts/5.x/)
- [Tableland](https://tableland.xyz/)
- [Openzeppelin](https://docs.openzeppelin.com/contracts/5.x/)

#### **Instructions**

Let's take storage deal aggregator/RaaS as an example to demonstrate how to integrate it with Tableland.
Let's take storage deal aggregation as an example to demonstrate how to integrate it with Tableland.

When uploading data via aggregator/RaaS providers to the Filecoin network, you can choose to store its metadata in Tableland tables instead of storing it in the chain state. This metadata can then be easily accessed from the Tableland database and utilized directly within your application.
When uploading data via storage aggregation providers to the Filecoin network, you can choose to store its metadata in Tableland tables instead of storing it in the chain state. This metadata can then be easily accessed from the Tableland database and utilized directly within your application.

If you require sample datasets to use, you can use the [Filecoin Dataset Explorer](https://datasets.filecoin.io/).

As an example, let's design the deal aggregator table as follows. However, you can certainly add more columns to this table to include additional information, such as RaaS registration.
As an example, let's design the deal aggregator table as follows. You can add more columns to this table to include additional aggregation metadata.

| column | data Type |
| --------- | ------------ |
| ID | int |
| CID | bytes/string |
| deal\_ID | int |
| miner\_ID | int |
| status | string |
| column | data Type |
| -------- | ------------ |
| ID | int |
| CID | bytes/string |
| deal_ID | int |
| miner_ID | int |
| status | string |

1. **Create aggregator table**

To track all the deal aggregation/RaaS requests submitted to the smart contract, we need to create a database table. You can add the following code to create an aggregator table within the `constructor()` function of the aggregator contract. This way, when the aggregator/RaaS contract is deployed, an aggregator table will be created to store the metadata of the aggregation requests.
To track all deal aggregation requests submitted to the smart contract, we need to create a database table. You can add the following code to create an aggregator table within the `constructor()` function of the aggregator contract. This way, when the aggregator contract is deployed, an aggregator table will be created to store the metadata of aggregation requests.

```solidity
uint256 private tableId;
Expand All @@ -63,7 +62,7 @@ constructor() {

```solidity
function insertRecord(uint256 id, string memory val, string memory status) external {

TablelandDeployments.get().mutate(
address(this), // Table owner, i.e., this contract
_tableId,
Expand All @@ -79,7 +78,7 @@ function insertRecord(uint256 id, string memory val, string memory status) exter
));}
```

Whenever the `submit` or `submitRaaS` function is called, a record will be inserted into the aggregator table instead of being stored in the blockchain's state.
Whenever the `submit` function is called, a record will be inserted into the aggregator table instead of being stored in the blockchain's state.

<pre class="language-solidity"><code class="lang-solidity"><strong>function submit(bytes memory _cid) external returns (uint256) {
</strong> // Increment the transaction ID
Expand Down Expand Up @@ -131,16 +130,17 @@ function complete(

4. **Query aggregation records**

By using the Tableland SDK, you can easily query the aggregation or RaaS status of all the data stored with the aggregator using SQL statements. For instance, you can retrieve all records associated with a specific CID by executing a SELECT statement.
By using the Tableland SDK, you can query the aggregation status of all data stored with the aggregator using SQL statements. For instance, you can retrieve all records associated with a specific CID by executing a SELECT statement.

```jsx
const db = new Database();

const { results } = await db.prepare(`SELECT * FROM ${tableName} WHERE cid = ?`)
.bind(cid);
const { results } = await db
.prepare(`SELECT * FROM ${tableName} WHERE cid = ?`)
.bind(cid);
console.log(results);
```

To learn how to write different select statements using Tableland SDK, you can refer to [here](https://docs.tableland.xyz/sdk/database/prepared-statements).

[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/decentralized-database)
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/build/advanced/decentralized-databases)
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ description: >-

# FEVM Indexers

> _Not to be confused with_ [_IPNI Indexer_](https://docs.filecoin.io/storage-providers/architecture/network-indexer)
> _Not to be confused with_ [_IPNI Indexer_](../../storage-providers/architecture/network-indexer.md)

Blockchain indexers are used for accessing blockchain data efficiently. They process and organize storage-optimized raw blockchain data into retrieve-optimized and well-queryable formats. This benefits developers and users looking to retrieve specific information because they don't need to:

1. Run their own [archival node](https://docs.filecoin.io/networks/mainnet/rpcs).
2. Parse entire blockchain histories to crawl for events that might not exist for thousands of [tipsets](https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#tipsets).
1. Run their own [archival node](../../networks-and-tools/networks/mainnet/rpcs.md).
2. Parse entire blockchain histories to crawl for events that might not exist for thousands of [tipsets](../../core-concepts/filecoin-virtual-machine/blocks-and-tipsets.md#tipsets).
3. Spend significant time required to retrieve data from the blockchain node.
4. Determine complex interconnections between smart contracts.
5. Spend substantial compute power to calculate advanced queries.
Expand Down Expand Up @@ -107,7 +107,7 @@ Use the Goldsky Playground or integrate it into your app to consume indexed data

#### Querying Subgraphs on Filecoin FEVM

There are many ways to query existing subgraphs, including numerous well-known libraries for [JavaScript](https://thegraph.com/docs/en/querying/querying-from-an-application/) and [Python](https://thegraph.com/docs/en/querying/querying-with-python/). But even without any third-party tooling, querying a subgraph is no more complicated than querying [RPC nodes](https://docs.filecoin.io/reference/json-rpc). The only complexity is that you have to know the schema of the subgraph beforehand, similar to knowing SQL database tables and columns before being able to query them. Luckily, The Graph provides several ways to discover the subgraph schema. The most convenient one is called the ["Playground"](https://graphql.org/blog/2020-04-03-graphiql-graphql-playground/), and it is available upon a GET request to the subgraph query URL. Alternatively, you may use the discovery method that exists on every subgraph, called the [Introspection Query](https://graphql.org/learn/introspection/).
There are many ways to query existing subgraphs, including numerous well-known libraries for [JavaScript](https://thegraph.com/docs/en/querying/querying-from-an-application/) and [Python](https://thegraph.com/docs/en/querying/querying-with-python/). But even without any third-party tooling, querying a subgraph is no more complicated than querying [RPC nodes](../../reference/json-rpc/README.md). The only complexity is that you have to know the schema of the subgraph beforehand, similar to knowing SQL database tables and columns before being able to query them. Luckily, The Graph provides several ways to discover the subgraph schema. The most convenient one is called the ["Playground"](https://graphql.org/blog/2020-04-03-graphiql-graphql-playground/), and it is available upon a GET request to the subgraph query URL. Alternatively, you may use the discovery method that exists on every subgraph, called the [Introspection Query](https://graphql.org/learn/introspection/).

#### Developing Subgraphs on Filecoin FEVM

Expand All @@ -122,7 +122,7 @@ Just as with database data queried through SQL, subgraphs have to be stored some
[Protofire (aka Glif Nodes)](https://api.node.glif.io) offers public access to The Graph services, simplifying the process of deploying and managing subgraphs.

1. **Connect Your Wallet**
* On the [Protofire (Glif Nodes) platform - SUBGRAPHS](https://api.node.glif.io/graph), connect your [Filecoin-compatible wallet](https://docs.filecoin.io/basics/assets/wallets).
* On the [Protofire (Glif Nodes) platform - SUBGRAPHS](https://api.node.glif.io/graph), connect your [Filecoin-compatible wallet](../../networks-and-tools/assets/wallets.md).
2. **Create an API Key**
* Choose the **API keys** tab.
* Click **Create new key**.
Expand Down
39 changes: 39 additions & 0 deletions build/advanced/filecoin-onchain-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
description: >-
Filecoin Onchain Cloud is a programmable cloud platform built on Filecoin that provides verifiable storage, retrieval, and payments through smart contracts.
---

# Filecoin Onchain Cloud

Filecoin Onchain Cloud (FOC) is a service layer built on the Filecoin Virtual Machine that combines storage, data delivery, and payments into a single programmable stack. All operations are settled on-chain through smart contracts.

## Core components

FOC is composed of four layers that work independently but integrate through on-chain contracts:

* **FWSS (Filecoin Warm Storage Service)** — warm storage optimized for frequent retrieval and verifiable availability. Pricing starts at 2.5 USDFC/TiB/month with a minimum of 2 copies.
* **PDP (Proof of Data Possession)** — a cryptographic challenge-response protocol that verifies storage providers still hold your data without re-downloading it. See [PDP documentation](../../storage-providers/pdp/README.md).
* **Filecoin Pay** — the on-chain settlement engine that automates payments to providers through payment rails. Providers are paid only upon verified service delivery.
* **Filecoin Beam** — the data delivery layer for fast content retrieval (up to 0.014 USDFC/GiB egress).

## Developer tools

The **Synapse SDK** is the primary way to interact with FOC. It provides three packages:

* **Synapse SDK** — high-level API for payments, storage, provider discovery, and session keys
* **Synapse Core** — low-level building blocks for direct contract interaction and PieceCID utilities
* **Synapse React** — React hooks built on Wagmi and TanStack Query

## Documentation

For full guides, API references, and cookbooks, see the [Filecoin Onchain Cloud documentation](https://docs.filecoin.cloud/).

* [Quick start](https://docs.filecoin.cloud/getting-started)
* [Architecture](https://docs.filecoin.cloud/core-concepts/architecture)
* [FWSS overview](https://docs.filecoin.cloud/core-concepts/fwss-overview)
* [Filecoin Pay overview](https://docs.filecoin.cloud/core-concepts/filecoin-pay-overview)
* [PDP overview](https://docs.filecoin.cloud/core-concepts/pdp-overview)
* [Synapse SDK guide](https://docs.filecoin.cloud/developer-guides/synapse)
* [Contract addresses](https://docs.filecoin.cloud/resources/contracts)

[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/build/advanced/filecoin-onchain-cloud)
Loading
Loading