You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filecoin is a decentralized, peer-to-peer network enabling anyone to store and retrieve data over the internet. Economic incentives are built in, ensuring files are stored and accessible reliably over time.
4
-
cover: .gitbook/assets/home-hero-image-drives.png
5
-
coverY: 171
3
+
Filecoin is a decentralized, peer-to-peer network enabling anyone to store and
4
+
retrieve data over the internet. Economic incentives are built in, ensuring
<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>
62
29
63
30
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/)
Copy file name to clipboardExpand all lines: smart-contracts/advanced/contract-automation.md
+15-22Lines changed: 15 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
---
2
2
description: >-
3
-
Smart contract automation enables decentralized applications (dapps) to interact with both on-chain and off-chain data in an automated and trustless manner. Automation tools allow developers to build smart contracts that execute predefined actions based on external triggers, eliminating the need for manual intervention while ensuring secure and reliable execution.
3
+
Smart contract automation enables decentralized applications (dapps) to
4
+
interact with both on-chain and off-chain data in an automated and trustless
5
+
manner. Automation tools allow developers to build
4
6
---
5
7
6
-
# Contract Automation
8
+
# Contract automation
7
9
8
10
In the Filecoin network, smart contracts benefit from a secure, deterministic environment. While this ensures reliability, it also limits direct access to external data sources. However, developers can leverage automation services to seamlessly connect off-chain data with on-chain smart contracts. This unlocks advanced capabilities such as price feeds, data verification, and much more, empowering Filecoin dapps with dynamic, real-world functionality by integrating external data into on-chain logic.
9
11
@@ -17,35 +19,26 @@ Gelato's Web3 Functions is a powerful automation system designed to streamline a
17
19
18
20
Web3 Functions can be triggered by various events and allow developers to write both off-chain logic (TypeScript) and on-chain logic (Solidity). Once deployed, they handle automated smart contract interactions, providing real-time monitoring and flexibility.
19
21
20
-
**Off-chain Data or Computation?**
21
-
Sometimes, automation tasks require data that isn't readily available on the blockchain, or they might need computations that are better performed off-chain. In such cases, Typescript Functions should be the choice.
22
+
**Off-chain Data or Computation?** Sometimes, automation tasks require data that isn't readily available on the blockchain, or they might need computations that are better performed off-chain. In such cases, Typescript Functions should be the choice.
22
23
23
-
**All Checks On-chain?**
24
-
If all the conditions necessary for your automation task can be directly verified on the blockchain, you have the option to select between Typescript Functions, Solidity Functions & Automated Transactions
24
+
**All Checks On-chain?** If all the conditions necessary for your automation task can be directly verified on the blockchain, you have the option to select between Typescript Functions, Solidity Functions & Automated Transactions
25
25
26
26
## Triggers
27
27
28
-
1. Time Interval
29
-
Use this trigger to execute tasks at regular intervals, e.g., every 10 minutes or once every 24 hours. It's like setting a straightforward, recurring alarm.
30
-
2. Cron Expressions
31
-
This offers a more refined control compared to the Time Interval. With cron expressions, you can set tasks to run at specific moments, such as "every Tuesday at 3 PM" or "on the 1st of every month". It gives you precision in task scheduling.
32
-
3. On-Chain Event
33
-
Ideal for those wanting their tasks to respond dynamically to blockchain activities. Whenever a specified event occurs on the blockchain, this trigger springs your task into action. It's like a vigilant watcher, always ready to act.
34
-
4. Every Block
35
-
This function operates with the rhythm of the blockchain itself, executing your chosen function each time a new block is created.
28
+
1. Time Interval Use this trigger to execute tasks at regular intervals, e.g., every 10 minutes or once every 24 hours. It's like setting a straightforward, recurring alarm.
29
+
2. Cron Expressions This offers a more refined control compared to the Time Interval. With cron expressions, you can set tasks to run at specific moments, such as "every Tuesday at 3 PM" or "on the 1st of every month". It gives you precision in task scheduling.
30
+
3. On-Chain Event Ideal for those wanting their tasks to respond dynamically to blockchain activities. Whenever a specified event occurs on the blockchain, this trigger springs your task into action. It's like a vigilant watcher, always ready to act.
31
+
4. Every Block This function operates with the rhythm of the blockchain itself, executing your chosen function each time a new block is created.
Typescript Functions are decentralized cloud functions that work similarly to AWS Lambda or Google Cloud, just for web3. They enable developers to execute on-chain transactions based on arbitrary off-chain data (APIs / subgraphs, etc) & computation. These functions are written in Typescript, stored on IPFS and run by Gelato.
44
38
45
39
### Solidity Functions
46
40
47
-
Solidity Functions are crucial for making on-chain tasks automatic and more efficient. They connect set conditions with specific actions in a smart contract, providing a straightforward method to turn user needs into automated processes.
48
-
Consider them as a set of "if-then" rules: If certain conditions are met on the blockchain, then a specific function gets executed. This level of automation ensures that the decentralized application can operate with minimal manual intervention, providing a seamless user experience.
41
+
Solidity Functions are crucial for making on-chain tasks automatic and more efficient. They connect set conditions with specific actions in a smart contract, providing a straightforward method to turn user needs into automated processes. Consider them as a set of "if-then" rules: If certain conditions are met on the blockchain, then a specific function gets executed. This level of automation ensures that the decentralized application can operate with minimal manual intervention, providing a seamless user experience.
49
42
50
43
### Automated Transaction
51
44
@@ -125,7 +118,7 @@ For a detailed guide on creating and deploying Web3 Functions, including setting
Copy file name to clipboardExpand all lines: smart-contracts/advanced/fevm-indexers.md
+27-30Lines changed: 27 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
1
---
2
2
description: >-
3
-
FEVM Indexers allow users and developers to query Filecoin chain data in an extremely quick manner. Learn what FEVM indexers are available on Filecoin and how to use them through existing data providers.
3
+
FEVM Indexers allow users and developers to query Filecoin chain data in an
4
+
extremely quick manner. Learn what FEVM indexers are available on Filecoin and
5
+
how to use them through existing data provide
4
6
---
5
7
6
-
# FEVM Blockchain Indexers
7
-
> *Not to be confused with [IPNI Indexer](https://docs.filecoin.io/storage-providers/architecture/network-indexer)*
8
+
# FEVM Indexers
9
+
10
+
> _Not to be confused with_[_IPNI Indexer_](https://docs.filecoin.io/storage-providers/architecture/network-indexer)
8
11
9
12
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:
10
13
@@ -22,8 +25,8 @@ Additionally, blockchain indexers provide a better developer experience by lever
22
25
23
26
#### Glossary
24
27
25
-
-**Subgraphs**: Customizable schemas that define how to index data from specific blockchain smart contracts and events.
26
-
-**GraphQL**: A query language that allows clients to request exactly the data they need, making data fetching more efficient.
28
+
***Subgraphs**: Customizable schemas that define how to index data from specific blockchain smart contracts and events.
29
+
***GraphQL**: A query language that allows clients to request exactly the data they need, making data fetching more efficient.
27
30
28
31
#### Querying Subgraphs on Filecoin FEVM
29
32
@@ -42,40 +45,37 @@ Just as with database data queried through SQL, subgraphs have to be stored some
42
45
[Protofire (aka Glif Nodes)](https://api.node.glif.io) offers public access to The Graph services, simplifying the process of deploying and managing subgraphs.
43
46
44
47
1.**Connect Your Wallet**
45
-
- 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).
46
-
48
+
* 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).
47
49
2.**Create an API Key**
48
-
- Choose the **API keys** tab.
49
-
- Click **Create new key**.
50
-
- Generate an API key to authenticate your requests.
51
-
50
+
* Choose the **API keys** tab.
51
+
* Click **Create new key**.
52
+
* Generate an API key to authenticate your requests.
52
53
3.**Activate Your Free Subscription**
53
-
- Go to the **Subscription** tab.
54
-
- If you have created a key, you will see one The Graph subscription pending.
55
-
- Click **Pay** and proceed with providing your credit card details to activate a free subscription.
54
+
* Go to the **Subscription** tab.
55
+
* If you have created a key, you will see one The Graph subscription pending.
56
+
* Click **Pay** and proceed with providing your credit card details to activate a free subscription.
56
57
57
58
{% hint style="warning" %}
58
59
Glif Nodes currently offers this service completely **free of charge**. If this ever changes, you will be notified at least one month in advance. It is recommended to provide your contact details on the Glif Nodes website to receive updates. Credit card details are used solely for DDoS protection. No charges will be made without prior notification.
59
60
{% endhint %}
60
61
61
62
4.**Create a Subgraph**
62
-
- Switch back to the **Subgraphs** tab.
63
-
- Click on **Create a New Subgraph** to set up a new subgraph instance.
64
-
63
+
* Switch back to the **Subgraphs** tab.
64
+
* Click on **Create a New Subgraph** to set up a new subgraph instance.
65
65
5.**Manage Your Subgraphs**
66
-
- Select **MY** in the subgraphs switcher.
67
-
- Select the subgraph you just created to access deployment instructions and endpoints.
68
-
- Should you have any additional inquiries, do not hesitate to contact the Glif Nodes team through the **Contact us** button in the website header.
66
+
* Select **MY** in the subgraphs switcher.
67
+
* Select the subgraph you just created to access deployment instructions and endpoints.
68
+
* Should you have any additional inquiries, do not hesitate to contact the Glif Nodes team through the **Contact us** button in the website header.
69
69
70
70
### Querying Existing Subgraphs
71
71
72
72
One of the popular subgraphs is a subgraph containing information about all the blocks on the network, essentially providing an alternative to the `eth_getBlock...` subset of commands. Let's see how we can query the `eth_getBlockByNumber` using the Linux command-line interface and the Protofire (Glif Nodes) platform.
73
73
74
-
- Visit the [Protofire (Glif Nodes) platform](https://api.node.glif.io).
75
-
- Navigate to the **SUBGRAPHS** tab.
76
-
- Select the **[blocks](https://api.node.glif.io/graph/21/mainnet%2Fblocks)** subgraph.
77
-
- In the opened **Playground** tab, click the **Show GraphiQL Explorer** button (folder icon, 3rd from the top in the left bar) to verify the subgraph schema.
78
-
- Click the elements that you are looking to query and adjust the query if necessary. For the sake of this example, let's query the first block this subgraph supports (#2867000). The resulting query should look like the following:
74
+
* Visit the [Protofire (Glif Nodes) platform](https://api.node.glif.io).
75
+
* Navigate to the **SUBGRAPHS** tab.
76
+
* Select the [**blocks**](https://api.node.glif.io/graph/21/mainnet%2Fblocks) subgraph.
77
+
* In the opened **Playground** tab, click the **Show GraphiQL Explorer** button (folder icon, 3rd from the top in the left bar) to verify the subgraph schema.
78
+
* Click the elements that you are looking to query and adjust the query if necessary. For the sake of this example, let's query the first block this subgraph supports (#2867000). The resulting query should look like the following:
79
79
80
80
```graphql
81
81
queryMyQuery {
@@ -88,8 +88,7 @@ One of the popular subgraphs is a subgraph containing information about all the
88
88
}
89
89
}
90
90
```
91
-
92
-
- Click **Executequery** (alternatively Ctrl+Enter, the icon with white triangle in the red square) andadjustqueryifneeded.
91
+
* Click **Executequery** (alternatively Ctrl+Enter, the icon with white triangle in the red square) andadjustqueryifneeded.
93
92
94
93
```json
95
94
{
@@ -106,6 +105,4 @@ One of the popular subgraphs is a subgraph containing information about all the
0 commit comments