diff --git a/builder-cookbook/dapps/README.md b/builder-cookbook/dapps/README.md index e7aa27db0..c28d7d6c5 100644 --- a/builder-cookbook/dapps/README.md +++ b/builder-cookbook/dapps/README.md @@ -4,3 +4,4 @@ description: Various features from Filecoin ecosystem to build your dApps. # dApps +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps) diff --git a/builder-cookbook/dapps/chain-data-query.md b/builder-cookbook/dapps/chain-data-query.md index 8f76f326e..bbfeccfba 100644 --- a/builder-cookbook/dapps/chain-data-query.md +++ b/builder-cookbook/dapps/chain-data-query.md @@ -156,3 +156,7 @@ The expected transaction will be similar as follows. With this information, you ] }, ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/chain-data-query) diff --git a/builder-cookbook/dapps/cross-chain-bridges.md b/builder-cookbook/dapps/cross-chain-bridges.md index 58c78350e..9a8e03f2d 100644 --- a/builder-cookbook/dapps/cross-chain-bridges.md +++ b/builder-cookbook/dapps/cross-chain-bridges.md @@ -178,3 +178,7 @@ Note that there is an expected finality period when conducting inter-chain messa 2. [Ready-to-use EC finality calculator](https://github.com/filecoin-project/FIPs/discussions/919) Learn more about cross-chain bridges and which bridges are available on which networks in the Filecoin Docs [here](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/builder-cookbook/dapps/cross-chain-bridges) diff --git a/builder-cookbook/dapps/decentralized-database.md b/builder-cookbook/dapps/decentralized-database.md index 22df5d815..ca3f5f714 100644 --- a/builder-cookbook/dapps/decentralized-database.md +++ b/builder-cookbook/dapps/decentralized-database.md @@ -142,3 +142,7 @@ 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) diff --git a/builder-cookbook/dapps/oracles.md b/builder-cookbook/dapps/oracles.md index a01032198..e86cc2bc5 100644 --- a/builder-cookbook/dapps/oracles.md +++ b/builder-cookbook/dapps/oracles.md @@ -51,3 +51,7 @@ contract PriceContract is UsingTellor { Oracle contract address (on both Calibration Testnet and Mainnet): `0xb2CB696fE5244fB9004877e58dcB680cB86Ba444` To see additional addresses for Tellor Oracles, please see [this doc](https://docs.filecoin.io/smart-contracts/advanced/oracles). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/dapps/oracles) diff --git a/builder-cookbook/data-storage/README.md b/builder-cookbook/data-storage/README.md index 0227e3de7..a8a097589 100644 --- a/builder-cookbook/data-storage/README.md +++ b/builder-cookbook/data-storage/README.md @@ -4,3 +4,4 @@ description: Recipes of using Filecoin data storage features programmatically. # Data Storage +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage) diff --git a/builder-cookbook/data-storage/privacy-and-access-control.md b/builder-cookbook/data-storage/privacy-and-access-control.md index c68b00c59..8f7061262 100644 --- a/builder-cookbook/data-storage/privacy-and-access-control.md +++ b/builder-cookbook/data-storage/privacy-and-access-control.md @@ -295,3 +295,7 @@ Lighthouse also provides a number of methods to gate access a given data set. I ``` To review the Lighthouse documentation in its entirety, please visit: [https://docs.lighthouse.storage/lighthouse-1/](https://docs.lighthouse.storage/lighthouse-1/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage/privacy-and-access-control) diff --git a/builder-cookbook/data-storage/retrieve-data.md b/builder-cookbook/data-storage/retrieve-data.md index dfebae8c0..22d1b596a 100644 --- a/builder-cookbook/data-storage/retrieve-data.md +++ b/builder-cookbook/data-storage/retrieve-data.md @@ -8,7 +8,7 @@ description: >- ### Retrieve data using retrieval clients -To retrieve data stored on the Filecoin network, the basic process involves making retrieval requests to Service Providers (SPs) who initially stored the data, using either the Content ID (CID) or the storage deal ID. +To retrieve data stored on the Filecoin network, the basic process involves making retrieval requests to Service Providers (SPs) who initially stored the data, using either the Content ID (CID) or the storage deal ID. A programmatic option is to utilize Filecoin retrieval clients, which handle the intricate retrieval process behind the scenes. By simply providing a Content ID (CID), retrieval clients can efficiently return your data either via the command-line interface (CLI) or through the programmable method. @@ -16,7 +16,7 @@ A programmatic option is to utilize Filecoin retrieval clients, which handle the With a given CID, you can use any of the following retrieval clients to retrieve content. -* [Lassie](https://github.com/filecoin-project/lassie): optimizes for most efficient available retrieval protocols. +* [Lassie](https://github.com/filecoin-project/lassie): optimizes for most efficient available retrieval protocols. * [go-car](https://github.com/ipld/go-car): a content addressable archive utility. * [Saturn](https://saturn.tech/): a Web3 CDN in Filecoin’s retrieval market. @@ -31,13 +31,13 @@ The Lassie command line interface (CLI) provides the simplest method for retriev
lassie fetch -o - <CID> | car extract
 
-For example, +For example, ``` lassie fetch -p bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4 | car extract ``` -Lassie can also serve as a go library within your Golang application when programmatically retrieving content from the network. To utilize Lassie in your code, you need to install the dependency and import it into your program following the instructions [here](https://github.com/filecoin-project/lassie?tab=readme-ov-file#golang-library). +Lassie can also serve as a go library within your Golang application when programmatically retrieving content from the network. To utilize Lassie in your code, you need to install the dependency and import it into your program following the instructions [here](https://github.com/filecoin-project/lassie?tab=readme-ov-file#golang-library). The following example demonstrates how to use the Lassie library to fetch a CID. @@ -89,7 +89,7 @@ func main() { 2. **retrieving content with Saturn** {% hint style="info" %} -[Saturn Javascript Client](https://github.com/filecoin-saturn/js-client) is still a work in progress and not recommended for use in production yet. +[Saturn Javascript Client](https://github.com/filecoin-saturn/js-client) is still a work in progress and not recommended for use in production yet. {% endhint %} The following code example demonstrates how to use the Saturn in the Javascript program to fetch a CID. @@ -126,3 +126,5 @@ const options = { For quick retrieval of existing datasets with the methods above, check out the [Filecoin Dataset Explorer](https://dataset-explorer.vercel.app/). *** + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage/retrieve-data) diff --git a/builder-cookbook/data-storage/store-data.md b/builder-cookbook/data-storage/store-data.md index 6e0f25a5f..a64be827c 100644 --- a/builder-cookbook/data-storage/store-data.md +++ b/builder-cookbook/data-storage/store-data.md @@ -8,9 +8,9 @@ description: >- ### Prepare data for Filecoin storage -A CAR file is a standardized format for bundling and exchanging content-addressable data. It provides a way to organize and encapsulate data, ensuring it can be easily verified and retrieved. +A CAR file is a standardized format for bundling and exchanging content-addressable data. It provides a way to organize and encapsulate data, ensuring it can be easily verified and retrieved. -Before sending data to Filecoin storage providers, it is necessary to package the data into CAR (Content Addressable aRchive) files, regardless of whether you store the data via a smart contract or data onramp toolings. +Before sending data to Filecoin storage providers, it is necessary to package the data into CAR (Content Addressable aRchive) files, regardless of whether you store the data via a smart contract or data onramp toolings. To provide the data to the SP which we make storage deals with, we need to prepare data and provide the following information when making storage deals via smart contracts or aggregators. @@ -44,7 +44,7 @@ Upload files, generate CAR, and get CAR links - we can do all these on the FVM D `ipfs-car` is a thin wrapper over [@ipld/car](https://github.com/ipld/js-car) and [unix-fs](https://github.com/ipfs/js-ipfs-unixfs) which provides a library and CLI tool to pack and unpack CAR(Content Addressable aRchives) files. -After installing `ipfs-car` via NPM, we can use it as a CLI or JS library to pack your data into a CAR file. You can refer to[ ipfs-car GitHub](https://github.com/web3-storage/ipfs-car) to learn more about how to use it. +After installing `ipfs-car` via NPM, we can use it as a CLI or JS library to pack your data into a CAR file. You can refer to[ ipfs-car GitHub](https://github.com/web3-storage/ipfs-car) to learn more about how to use it. **Pack files using CLI** @@ -65,7 +65,7 @@ Then we can upload `a.car` file to the ipfs using [lighthouse.storage](https://w 3. **upload to IPFS Desktop** -Another option is to upload data to the IPFS network using an IPFS node, such as IPFS Desktop or Kubo. By following this [tutorial](https://docs.ipfs.tech/how-to/desktop-app/#add-local-files), you can learn how to add files using IPFS Desktop. +Another option is to upload data to the IPFS network using an IPFS node, such as IPFS Desktop or Kubo. By following this [tutorial](https://docs.ipfs.tech/how-to/desktop-app/#add-local-files), you can learn how to add files using IPFS Desktop. Afterward, you can obtain the CID or URL of the uploaded data to propose storage deals via FVM on the Filecoin network. @@ -79,7 +79,7 @@ Client Contract serves as a crucial component in making on-chain storage deal pr * pieceCID * CarLink -* car size +* car size * piece Size * starting and ending epoch @@ -91,7 +91,7 @@ Client Contract serves as a crucial component in making on-chain storage deal pr #### Instructions -The Client Contract library implements the basic functions to make storage deal proposals as well as callback functions for successful storage deal creation. +The Client Contract library implements the basic functions to make storage deal proposals as well as callback functions for successful storage deal creation. One of the key methods within this library is the `makeDealProposal` method, which is responsible for initiating a fully on-chain storage deal proposal. To invoke the `makeDealProposal` method, you will need to interact with the deployed DealClient contract on Calibration. This method accepts the required parameters for the storage deal, such as the data CID or URL, car size, piece size, the duration of the deal, and any other relevant details specific to your use case. @@ -157,15 +157,15 @@ A Javascript function to invoke the `makeDealProposal` method should be like: }; -The full tutorial of proposal storage deals through the client contract can be found [here](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial). +The full tutorial of proposal storage deals through the client contract can be found [here](https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial). *** ### Store small data with storage onramps -Filecoin is primarily designed for storing large data over extended periods. Due to economic considerations, it is generally not good for Service Providers (SPs) to accept small-scale datasets and allocate them to their 32 or 64 Gib storage sectors. As a result, it is unlikely that SPs will directly accept storage deals proposed by the client contract for small datasets. +Filecoin is primarily designed for storing large data over extended periods. Due to economic considerations, it is generally not good for Service Providers (SPs) to accept small-scale datasets and allocate them to their 32 or 64 Gib storage sectors. As a result, it is unlikely that SPs will directly accept storage deals proposed by the client contract for small datasets. -In the case of small datasets, a more viable option is to store them with [storage onramps](../../basics/how-storage-works/storage-onramps.md). Storage onramps combine multiple small datasets into a larger dataset and generate Proof of Deal Sub-piece Inclusion (PoDSI). PoDSI can be utilized to verify and provide evidence that the sub-piece datasets are included in a storage deal on the Filecoin network. +In the case of small datasets, a more viable option is to store them with [storage onramps](../../basics/how-storage-works/storage-onramps.md). Storage onramps combine multiple small datasets into a larger dataset and generate Proof of Deal Sub-piece Inclusion (PoDSI). PoDSI can be utilized to verify and provide evidence that the sub-piece datasets are included in a storage deal on the Filecoin network. One of the storage onramps we can use is [Lighthouse.storage](https://lighthouse.storage/) which is a perpetual file storage protocol that provides both on-chain and off-chain deal aggregation services. It provides a solution for storing small datasets on Filecoin while also enabling verification of deal inclusion using PoDSI. This combination of services can be valuable for ensuring the integrity and accessibility of small datasets stored on the Filecoin network. @@ -173,7 +173,7 @@ One of the storage onramps we can use is [Lighthouse.storage](https://lighthouse * [Lighthouse.storage](https://lighthouse.storage/) * [SDK](https://github.com/lighthouse-web3/lighthouse-package): a JavaScript library that allows you to upload files to the Filecoin network. - * [smart contract](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/DealStatus.sol): solidity contract to submit and process storage deal aggregation requests. + * [smart contract](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/DealStatus.sol): solidity contract to submit and process storage deal aggregation requests. #### Instructions @@ -181,7 +181,7 @@ Lighthouse.storage provides users with two options for uploading data and making 1. **store data with lighthouse SDK** -By creating an account with Lighthouse storage and generating an API key, you can easily upload data to the Filecoin network using the Lighthouse SDK within any JavaScript application. Data stored using lighthouse SDK will be automatically registered for deal aggregation as well as RaaS(replication, renewal, and repair). +By creating an account with Lighthouse storage and generating an API key, you can easily upload data to the Filecoin network using the Lighthouse SDK within any JavaScript application. Data stored using lighthouse SDK will be automatically registered for deal aggregation as well as RaaS(replication, renewal, and repair). First, install lighthouse SDK in your project with the command `npm install -g @lighthouse-web3/sdk`. Then use the following code to upload data to the lighthouse for deal aggregation. @@ -206,9 +206,9 @@ The expected output of `uploadResponse`. 2. **store data via lighthouse smart contract** -Lighthouse has also implemented an aggregator smart contract based on [IAggregatorOracle](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/interfaces/IAggregatorOracle.sol). This smart contract is deployed on the Filecoin Calibration testnet, allowing users to submit deal aggregation requests on-chain. +Lighthouse has also implemented an aggregator smart contract based on [IAggregatorOracle](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/interfaces/IAggregatorOracle.sol). This smart contract is deployed on the Filecoin Calibration testnet, allowing users to submit deal aggregation requests on-chain. -We can call the smart contract at `0x01ccBC72B2f0Ac91B79Ff7D2280d79e25f745960` and submit a CID for aggregation via `submit(bytes memory _cid) external returns (uint256)` methods. +We can call the smart contract at `0x01ccBC72B2f0Ac91B79Ff7D2280d79e25f745960` and submit a CID for aggregation via `submit(bytes memory _cid) external returns (uint256)` methods. A Javascript function to invoke the `submit` method should be like: @@ -252,16 +252,16 @@ The full tutorial for uploading data using Lighthouse SDK and smart contract can RaaS (Replication, Renewal, and Repair as a Service) refers to the service provided for data stored in storage deals on the Filecoin network. When making storage deals with deal aggregators, such as lighthouse.storage, users have the option to register the RaaS job for the stored data. Subsequently, the aggregators monitor the status of the registered storage deals and initiate the necessary actions for replication, renewal, and repair as required. -When storing data using either the Lighthouse SDK or smart contracts, we can register a RaaS job. +When storing data using either the Lighthouse SDK or smart contracts, we can register a RaaS job. * Lighthouse SDK: register replication, renew, and repair service by setting deal parameters when uploading data. -* Lighthouse smart contract: calling `submitRaaS` attaching RaaS parameters for the storage deal aggregation. +* Lighthouse smart contract: calling `submitRaaS` attaching RaaS parameters for the storage deal aggregation. #### Ingredients * [Lighthouse.storage](https://www.lighthouse.storage/) * [SDK](https://github.com/lighthouse-web3/lighthouse-package): a JavaScript library that allows you to upload files to the Filecoin network. - * [smart contract](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/DealStatus.sol): solidity contract to submit and process storage deal aggregation requests. + * [smart contract](https://github.com/lighthouse-web3/raas-starter-kit/blob/main/contracts/DealStatus.sol): solidity contract to submit and process storage deal aggregation requests. #### Instructions @@ -327,15 +327,15 @@ const SubmitRaaS = async () => { ### Monitor storage deal status from a smart contract -The [Deal Bounty Contract](https://github.com/FILCAT/deal-bounty-contract/tree/main) also demonstrates a way to monitor the status of a Filecoin Storage Deal. +The [Deal Bounty Contract](https://github.com/FILCAT/deal-bounty-contract/tree/main) also demonstrates a way to monitor the status of a Filecoin Storage Deal. -#### 1. Import the [MarketAPI](https://github.com/Zondax/filecoin-solidity-mock-api/blob/master/contracts/v0.8/MarketAPI.sol). +#### 1. Import the [MarketAPI](https://github.com/Zondax/filecoin-solidity-mock-api/blob/master/contracts/v0.8/MarketAPI.sol). ```solidity import { MarketAPI } from "../lib/filecoin-solidity/contracts/v0.8/MarketAPI.sol"; ``` -#### 2. Use the MarketAPI functions to check the current status of a deal. An example is shown in claim\_bounty(): +#### 2. Use the MarketAPI functions to check the current status of a deal. An example is shown in claim\_bounty(): ```solidity function claim_bounty(uint64 deal_id) public { @@ -357,21 +357,21 @@ function claim_bounty(uint64 deal_id) public { ### Incentivized data storage -There are two sides to incentivizing data onboarding –the first is to incentivize the client to upload data, which can be done with an ERC20 token included in a DataDAO that pays to wallets that upload data through the DataDAO. The second is to incentivize the storage providers to take a deal. Both are demonstrated in the [Deal Bounty Contract](https://github.com/FILCAT/deal-bounty-contract/tree/main). +There are two sides to incentivizing data onboarding –the first is to incentivize the client to upload data, which can be done with an ERC20 token included in a DataDAO that pays to wallets that upload data through the DataDAO. The second is to incentivize the storage providers to take a deal. Both are demonstrated in the [Deal Bounty Contract](https://github.com/FILCAT/deal-bounty-contract/tree/main). #### **Ingredients** -* [Foundry](https://github.com/foundry-rs/foundry/blob/master/README.md) +* [Foundry](https://github.com/foundry-rs/foundry/blob/master/README.md) * [Solidity](https://docs.soliditylang.org/en/v0.8.23/) -* [Filecoin Storage](https://dataonboarding.filecoin.io/) +* [Filecoin Storage](https://dataonboarding.filecoin.io/) * [Filecoin Retrieval](https://docs.filecoin.io/basics/how-retrieval-works/basic-retrieval) #### **Instructions** -Note that the full solidity file for the Deal Bounty Contract can be found [HERE](https://github.com/FILCAT/deal-bounty-contract/blob/main/src/DealRewarder.sol). This cookbook will pull relevant functions for you as a way to base your own code on. +Note that the full solidity file for the Deal Bounty Contract can be found [HERE](https://github.com/FILCAT/deal-bounty-contract/blob/main/src/DealRewarder.sol). This cookbook will pull relevant functions for you as a way to base your own code on. 1. The contract owner will deploy the contract, establishing the rules of the dataDAO. -2. Data pinners will add the deal CIDs intended to be incentivized to the list. This will allow storage providers to see which deals have additional incentives. +2. Data pinners will add the deal CIDs intended to be incentivized to the list. This will allow storage providers to see which deals have additional incentives. ```jsx function addCID(bytes calldata cidraw, uint size) public { @@ -402,7 +402,7 @@ function call_actor_id(uint64 method, uint256 value, uint64 flags, uint64 codec, ``` -4. Finally, the bounty is claimed by the storage providers that accepted the deal. This is done by using the MarketAPI to check the status of a deal. +4. Finally, the bounty is claimed by the storage providers that accepted the deal. This is done by using the MarketAPI to check the status of a deal. ```solidity function claim_bounty(uint64 deal_id) public { @@ -421,3 +421,5 @@ function claim_bounty(uint64 deal_id) public { ``` *** + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/data-storage/store-data) diff --git a/builder-cookbook/overview.md b/builder-cookbook/overview.md index a88f5b1eb..7a2baec72 100644 --- a/builder-cookbook/overview.md +++ b/builder-cookbook/overview.md @@ -23,3 +23,7 @@ Each recipe contains: ### **Quick Start**
Data StorageRecipes for programmable storage and retrieval of your public or private data on Filecoin.data-storagefvm-1.png
dApps DevelopmentRecipes of various features to build cross-networks dApps like DeFi, DeSci, NFT, and more.dappsfvm-2.png
+ + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/overview) diff --git a/builder-cookbook/table-of-contents.md b/builder-cookbook/table-of-contents.md index 9afbb78c6..40e2c48d2 100644 --- a/builder-cookbook/table-of-contents.md +++ b/builder-cookbook/table-of-contents.md @@ -33,3 +33,7 @@ description: >- * [Bridge wFIL with Axelar](dapps/cross-chain-bridges.md#bridge-wfil-with-axelar) * **Decentralized Database** * [Store data with Tableland](dapps/decentralized-database.md#store-data-with-tableland) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/builder-cookbook/table-of-contents) diff --git a/networks/calibration/README.md b/networks/calibration/README.md index 4a9eea11d..27b3b8367 100644 --- a/networks/calibration/README.md +++ b/networks/calibration/README.md @@ -4,10 +4,10 @@ description: >- Filecoin mainnet. --- -# Calibration testnet +# Calibration {% hint style="info" %} -Also see [Calibration RPCs](./rpcs.md) and [Calibration Explorers](./explorers.md). +Also see [Calibration RPCs](rpcs.md) and [Calibration Explorers](explorers.md). {% endhint %} Prospective storage providers can experience more realistic sealing performance and hardware requirements using final proofs constructions and parameters. Storage clients can store and retrieve _real data_ on the network. Clients can also participate in deal-making workflows and storage and retrieval functionality. The sector size on the Calibration testnet is the same as on the Filecoin mainnet; 32 GiB and 64 GiB sectors are supported. This testnet also includes the Filecoin EVM-runtime features found on the Filecoin mainnet. @@ -38,7 +38,7 @@ Developers can reference pre-existing deals that are already available on the ne Bootstrap peers for Calibration testnet can be found at: -`https://github.com/filecoin-project/lotus/blob/release/`**[latest release]**`/build/bootstrap/calibnet.pi` +`https://github.com/filecoin-project/lotus/blob/release/`**\[latest release]**`/build/bootstrap/calibnet.pi` The latest Lotus release can be found at https://github.com/filecoin-project/lotus/releases/latest/ @@ -63,3 +63,7 @@ The following storage providers are running on the Calibration testnet. * [Slack Channel for Questions: #fil-help](https://filecoinproject.slack.com/archives/CEGN061C5) * [Latest lightweight snapshot](https://forest-archive.chainsafe.dev/latest/calibnet/) generated with [Forest](http://github.com/ChainSafe/forest) by [ChainSafe](https://chainsafe.io/) * [Complete calibration net archival data](https://forest-archive.chainsafe.dev/list/) generated with [Forest](http://github.com/ChainSafe/forest) by [ChainSafe](https://chainsafe.io/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/calibration) diff --git a/networks/calibration/explorers.md b/networks/calibration/explorers.md index 0408e294e..a20407291 100644 --- a/networks/calibration/explorers.md +++ b/networks/calibration/explorers.md @@ -19,8 +19,13 @@ description: >- [calibration.filscan.io](https://calibration.filscan.io/) ## Blockscout Open-Source FEVM Explorer + [filecoin-testnet.blockscout.com](https://filecoin-testnet.blockscout.com) ## Starboard [fvm.starboard.ventures](https://fvm.starboard.ventures/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/calibration/explorers) diff --git a/networks/calibration/rpcs.md b/networks/calibration/rpcs.md index a4d53f9a9..0a3bc1324 100644 --- a/networks/calibration/rpcs.md +++ b/networks/calibration/rpcs.md @@ -5,7 +5,7 @@ description: Public RPC endpoints are available for the Calibration testnet. # RPCs {% hint style="info" %} -[Chainlist](https://chainlist.org/?search=filecoin&testnets=true) contains a dynamically updated list of available Filecoin RPCs. Select **Include Testnets** to view available test networks. [Find out more at chainlist.org's Filecoin listings](https://chainlist.org/?search=filecoin&testnets=true). +[Chainlist](https://chainlist.org/?search=filecoin\&testnets=true) contains a dynamically updated list of available Filecoin RPCs. Select **Include Testnets** to view available test networks. [Find out more at chainlist.org's Filecoin listings](https://chainlist.org/?search=filecoin\&testnets=true). {% endhint %} These endpoints are limited to [read-only Filecoin JSON RPC API calls](../../reference/json-rpc/) and [`MPoolPush`](../../reference/json-rpc/mpool.md) for sending messages that have already been signed. @@ -41,3 +41,7 @@ FULLNODE_API_INFO=wss://wss.calibration.node.glif.io/apigw/lotus lotus daemon -- * When using a lite-node, omit `/rpc/v1` from Glif’s WebSocket address. * [Glif documentation](https://hosting.glif.io/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/calibration/rpcs) diff --git a/networks/deprecated-networks/README.md b/networks/deprecated-networks/README.md index a6254af27..7e0849215 100644 --- a/networks/deprecated-networks/README.md +++ b/networks/deprecated-networks/README.md @@ -1,7 +1,3 @@ ---- -description: >- ---- - # Deprecated networks The following networks have been deprecated: @@ -17,3 +13,7 @@ The Spacenet test network was created for the Interplanetary Consensus (IPC) pro ## Wallaby The Wallaby test network, often just called _Wallaby_, was designed for internal Filecoin developers to test new features before rolling them out to the Hyperspace testnet, and then onto Mainnet. Wallaby was designed to be reset every week. It was deprecated on 2023-02-07. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/deprecated-networks) diff --git a/networks/local-testnet/README.md b/networks/local-testnet/README.md index 73c8558e6..d3a0bed72 100644 --- a/networks/local-testnet/README.md +++ b/networks/local-testnet/README.md @@ -26,8 +26,7 @@ To build the nodes, you’ll need some specific software. Run the following comm {% tabs %} {% tab title="MacOS" %} 1. Open a terminal window. -2. Check that you have [Homebrew](https://brew.sh/) installed.\ - +2. Check that you have [Homebrew](https://brew.sh/) installed.\\ ```shell brew --version @@ -38,8 +37,7 @@ To build the nodes, you’ll need some specific software. Run the following comm \ If you do not see a version number. or receive an error message, install [Homebrew](https://brew.sh/). -3. Ensure you have [XCode](https://developer.apple.com/xcode/) installed.\ - +3. Ensure you have [XCode](https://developer.apple.com/xcode/) installed.\\ ```shell xcode-select -p @@ -49,16 +47,12 @@ To build the nodes, you’ll need some specific software. Run the following comm \ If you do not see the output above. or receive an error message, install [XCode](https://developer.apple.com/xcode/). -4. Install the following dependencies:\ - +4. Install the following dependencies:\\ ```shell brew install go bzr jq pkg-config hwloc coreutils ``` - - -5. Install Rust:\ - +5. Install Rust:\\ ```shell curl https://sh.rustup.rs -sSf | sh -s -- -y @@ -68,10 +62,7 @@ To build the nodes, you’ll need some specific software. Run the following comm # Rust is installed now. Great! # ... ``` - - -6. Source the `~/.cargo/env` config file:\ - +6. Source the `~/.cargo/env` config file:\\ ```shell source "$HOME/.cargo/env" @@ -79,23 +70,17 @@ To build the nodes, you’ll need some specific software. Run the following comm {% endtab %} {% tab title="Ubuntu" %} -1. Install the following dependencies:\ - +1. Install the following dependencies:\\ ```shell sudo apt update -y sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y ``` - - -2. Install Go and add `/usr/local/go/bin` to your `$PATH` variable:\ - +2. Install Go and add `/usr/local/go/bin` to your `$PATH` variable:\\ ```shell wget -c https://golang.org/dl/go1.18.8.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local ``` - - 3. You may need to export `/usr/local/go/bin` to your `$PATH`. This process changes depending on which shell you’re using: | Shell | Export to $PATH example | @@ -120,77 +105,55 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We {% tabs %} {% tab title="MacOS Intel" %} -1. Clone the repository:\ - +1. Clone the repository:\\ ```shell git clone https://github.com/filecoin-project/lotus.git ~/lotus-devnet cd lotus ``` - - -2. Checkout to the latest stable branch:\ - +2. Checkout to the latest stable branch:\\ ```shell git checkout releases ``` - - 3. Done! You can move on to the [Build](https://docs.filecoin.io/networks/local-testnet/set-up/#build) section. {% endtab %} {% tab title="MacOS ARM" %} -1. Clone the repository into a new `~/lotus-devnet` directory:\ - +1. Clone the repository into a new `~/lotus-devnet` directory:\\ ```shell git clone https://github.com/filecoin-project/lotus.git ~/lotus-devnet cd ~/lotus-devnet ``` - - -2. Checkout to the latest stable branch:\ - +2. Checkout to the latest stable branch:\\ ```shell git checkout releases ``` - - -3. Create the necessary environment variables to allow Lotus to run on M1 architecture:\ - +3. Create the necessary environment variables to allow Lotus to run on M1 architecture:\\ ```shell export LIBRARY_PATH=/opt/homebrew/lib export FFI_BUILD_FROM_SOURCE=1 export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH" ``` - - 4. Done! You can move on to the [Build](https://docs.filecoin.io/networks/local-testnet/set-up/#build) section. {% endtab %} {% tab title="Ubuntu" %} -1. Clone the repository into a new `~/lotus-devnet` directory:\ - +1. Clone the repository into a new `~/lotus-devnet` directory:\\ ```shell git clone https://github.com/filecoin-project/lotus.git ~/lotus-devnet cd ~/lotus-devnet ``` - - -2. Checkout to the latest stable branch:\ - +2. Checkout to the latest stable branch:\\ ```shell git checkout releases ``` - - -3. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable the use of SHA extensions by adding these two environment variables:\ - +3. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable the use of SHA extensions by adding these two environment variables:\\ ```shell export RUSTFLAGS="-C target-cpu=native -g" @@ -205,16 +168,14 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We ### Build -1. Create the `2k` binary for Lotus:\ - +1. Create the `2k` binary for Lotus:\\ ```shell make 2k ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext git submodule update --init --recursive @@ -226,16 +187,14 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We \ This process will take about 5 minutes to complete. -2. Fetch the proving parameters for a 2048-byte sector size:\ - +2. Fetch the proving parameters for a 2048-byte sector size:\\ ```shell ./lotus fetch-params 2048 ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T10:44:43.058-0400 INFO paramfetch go-paramfetch@v0.0.4/paramfetch.go:244 Fetching /var/tmp/filecoin-proof-parameters/v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-8-0-559e581f022bb4e4ec6e719e563bf0e026ad6de42e56c18714a2c692b1b88d7e.vk from https://proofs.filecoin.io/ipfs @@ -246,16 +205,14 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We \ This process downloads a few files totalling to around 2 GiB in size. Depending on your internet speed, this process can take a few minutes to complete. -3. Pre-seal two sectors for the genesis block:\ - +3. Pre-seal two sectors for the genesis block:\\ ```shell ./lotus-seed pre-seal --sector-size 2KiB --num-sectors 2 ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext sector-id: {{1000 1} 5}, piece info: {2048 baga6ea4seaqf7ovs6euxa4ktencg2gza7lua32l2ugqu76uqgvnjocek6gtoufi} @@ -264,24 +221,19 @@ Before we can build the Lotus binaries, there’s some setup we need to do. We ... ``` -4. Create the genesis block:\ - +4. Create the genesis block:\\ ```shell ./lotus-seed genesis new localnet.json ``` - - -5. Create a pre-miner and an address with some funds:\ - +5. Create a pre-miner and an address with some funds:\\ ```shell ./lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T10:52:03.855-0400 INFO lotus-seed lotus-seed/genesis.go:129 Adding miner t01000 to genesis template @@ -297,16 +249,12 @@ As mentioned earlier, we will be running two types of a node: a storage provider #### Client 1. Open a new terminal window. -2. Move into the `~/lotus-devnet` directory:\ - +2. Move into the `~/lotus-devnet` directory:\\ ```shell cd ~/lotus-devnet ``` - - -3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\ - +3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\\ ```shell export LOTUS_PATH=~/.lotus-local-net @@ -318,16 +266,14 @@ As mentioned earlier, we will be running two types of a node: a storage provider \ Because environmental variables are reset when you open a new terminal window, these variables must be exported every time we start a new terminal. -4. Start the client node using `lotus daemon`:\ - +4. Start the client node using `lotus daemon`:\\ ```shell ./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T10:57:41.022-0400 INFO main lotus/daemon.go:218 lotus repo: /home/johnny/.lotus @@ -341,16 +287,12 @@ As mentioned earlier, we will be running two types of a node: a storage provider #### Storage provider 1. Open a new terminal window. -2. Move into the `~/lotus-devnet` directory:\ - +2. Move into the `~/lotus-devnet` directory:\\ ```shell cd ~/lotus-devnet ``` - - -3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\ - +3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\\ ```shell export LOTUS_PATH=~/.lotus-local-net @@ -359,30 +301,26 @@ As mentioned earlier, we will be running two types of a node: a storage provider export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` -4. Import the genesis miner key:\ - +4. Import the genesis miner key:\\ ```shell ./lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext imported key t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq successfully! ``` -5. Initialize the genesis miner:\ - +5. Initialize the genesis miner:\\ ```shell ./lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T11:04:46.148-0400 INFO main lotus-miner/init.go:130 Initializing lotus miner @@ -395,8 +333,7 @@ As mentioned earlier, we will be running two types of a node: a storage provider \ This process take a few minutes to complete. -6. Start the storage provider node with `lotus-miner run`:\ - +6. Start the storage provider node with `lotus-miner run`:\\ ```shell ./lotus-miner run --nosync @@ -416,16 +353,12 @@ Now that we’ve got our local devnet running let’s create a new wallet and se There are multiple ways to create a new wallet. The simplest way is to use the Lotus CLI directly: 1. Open a new terminal window. -2. Move into the `~/lotus-devnet` directory:\ - +2. Move into the `~/lotus-devnet` directory:\\ ```shell cd ~/lotus-devnet ``` - - -3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\ - +3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\\ ```shell export LOTUS_PATH=~/.lotus-local-net @@ -434,48 +367,39 @@ There are multiple ways to create a new wallet. The simplest way is to use the L export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` -4. Create a new wallet with `lotus wallet new`:\ - +4. Create a new wallet with `lotus wallet new`:\\ ```shell ./lotus wallet new ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq ``` - - -5. View the wallets available on this node with `lotus wallet list`:\ - +5. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X ``` - - 6. You can now close this terminal window, or you can keep it open for the next section. #### Send funds We can now send FIL from the pre-mined `t3q4o7g...` account to our new `t1snly7...` account with `lotus send`: -1. If you closed the terminal windows from the last section, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\ - +1. If you closed the terminal windows from the last section, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet @@ -485,18 +409,14 @@ We can now send FIL from the pre-mined `t3q4o7g...` account to our new `t1snly7. export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` - - -2. View the wallets available on this node with `lotus wallet list`:\ - +2. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext Address Balance Nonce Default @@ -506,42 +426,34 @@ We can now send FIL from the pre-mined `t3q4o7g...` account to our new `t1snly7. \ In the above example, the `t3q4o...` address is the _pre-mined_ address we created in an earlier step. This has a very large balance of FIL. We want to send FIL from this pre-mined address to our new `t1snl...` address. -3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\ - +3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\\ ```shell ./lotus send --from ``` \ - For example:\ - + For example:\\ ```shell ./lotus send --from t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 2000 # bafy2bzaceaqzbgiazwvtpago6wpkxl42puxfkvwv5cwjpime2irqatamji2bq ``` - - -4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\ - +4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\\ ```shell ./lotus wallet balance
``` \ - For example:\ - + For example:\\ ```shell ./lotus wallet balance t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq # 2000 FIL ``` - - 5. You can now close this terminal window, or you can keep it open for the next section. ### Stop and restart @@ -551,16 +463,14 @@ You’ll eventually want to stop your local devnet from running or may need to r #### Stop the devnet 1. Open the storage provider terminal window. -2. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\ - +2. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\\ ```plaintext # CTRL + c ``` \ - This will output something like:\ - + This will output something like:\\ ```shell ... @@ -569,12 +479,9 @@ You’ll eventually want to stop your local devnet from running or may need to r 2023-02-14T10:54:42.056-0400 INFO builder node/shutdown.go:44 miner shut down successfully 2023-02-14T10:54:42.056-0400 WARN builder node/shutdown.go:47 Graceful shutdown successful ``` - - 3. You can now close the storage provider terminal window. 4. Open the client terminal window. -5. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\ - +5. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\\ ```plaintext ... @@ -583,14 +490,11 @@ You’ll eventually want to stop your local devnet from running or may need to r 2023-02-14T10:55:42.502-0400 INFO builder node/shutdown.go:44 node shut down successfully 2023-02-14T10:55:42.502-0400 WARN builder node/shutdown.go:47 Graceful shutdown successful ``` - - 6. You can now close the client terminal window. #### Restart the devnet -1. Open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\ - +1. Open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet @@ -600,18 +504,14 @@ You’ll eventually want to stop your local devnet from running or may need to r export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` - - -2. Start the client node with `lotus daemon`:\ - +2. Start the client node with `lotus daemon`:\\ ```shell ./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T10:57:41.022-0400 INFO main lotus/daemon.go:218 lotus repo: /home/johnny/.lotus @@ -621,8 +521,7 @@ You’ll eventually want to stop your local devnet from running or may need to r \ This command will continue to run. Leave this window open. -3. For the storage provider node, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\ - +3. For the storage provider node, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet @@ -632,26 +531,20 @@ You’ll eventually want to stop your local devnet from running or may need to r export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` - - -4. Restart the storage provider node with `lotus-miner run`:\ - +4. Restart the storage provider node with `lotus-miner run`:\\ ```shell ./lotus-miner run --nosync ``` \ - This will output something like:\ - + This will output something like:\\ ```plaintext 2023-01-31T12:54:12.009-0400 INFO main lotus-miner/run.go:98 Checking full node sync status 2023-01-31T12:54:12.013-0400 INFO modules modules/core.go:64 memory limits initialized {"max_mem_heap": 0, "total_system_mem": 16444395520, "effective_mem_limit": 16444395520} 2023-01-31T12:54:12.013-0400 WARN modules modules/core.go:124 failed to initialize cgroup-driven watchdog; err: failed to load cgroup for process: cgroups: cgroup mountpoint does not exist ``` - - 5. This command will continue to run. Leave this window open. 6. You must run all further commands from a new terminal window. @@ -672,3 +565,7 @@ ERROR: could not get API info for FullNode: could not get api endpoint: API not ``` If you receive this error when trying to call your Lotus daemon, either your `lotus daemon` isn’t running (see [Restart the devnet](./#stop-and-restart)) or you haven’t re-exported the necessary variables (see the [Build section](./#build)). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/local-testnet) diff --git a/networks/local-testnet/get-test-tokens.md b/networks/local-testnet/get-test-tokens.md index e16a91759..47da6f7cd 100644 --- a/networks/local-testnet/get-test-tokens.md +++ b/networks/local-testnet/get-test-tokens.md @@ -9,77 +9,66 @@ description: >- Before we begin, you must have a local testnet running. Follow the [Run a local network guide](./) if you haven’t got a local testnet set up yet. -1. Change directory to where you created the `lotus` and `lotus-miner` binaries. If you followed the [Run a local network guide](./) these binaries will be in `~/lotus-devnet`:\ - +1. Change directory to where you created the `lotus` and `lotus-miner` binaries. If you followed the [Run a local network guide](./) these binaries will be in `~/lotus-devnet`:\\ ```shell cd ~/lotus-devnet ``` - - -2. View the wallets available on this node with `lotus wallet list`:\ - +2. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ - This command will output something like:\ - + This command will output something like:\\ ```plaintext Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X ``` - - -3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\ - +3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\\ ```shell ./lotus send --from ``` \ - For example:\ - + For example:\\ ```shell ./lotus send --from t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 2000 ``` \ - This command will output something like:\ - + This command will output something like:\\ ```plaintext bafy2bzaceaqzbgiazwvtpago6wpkxl42puxfkvwv5cwjpime2irqatamji2bq ``` - - -4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\ - +4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\\ ```shell ./lotus wallet balance
``` \ - For example:\ - + For example:\\ ```shell ./lotus wallet balance t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq ``` \ - This command will output something like:\ - + This command will output something like:\\ ```plaintext 2000 FIL ``` If you want to manage your local testnet tokens in MetaMask you will need to create a `t4` address. You can create a `t4` address using `lotus wallet new deleated`. Once you have a `t4` address you can connect MetaMask to your local testnet to see the new balance within the MetaMask extension. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/local-testnet/get-test-tokens) diff --git a/networks/mainnet/README.md b/networks/mainnet/README.md index 5121eacf6..f689b90a0 100644 --- a/networks/mainnet/README.md +++ b/networks/mainnet/README.md @@ -7,7 +7,7 @@ description: >- # Mainnet {% hint style="info" %} -Also see [Mainnet RPCs](./rpcs.md) and [Mainnet Explorers](./explorers.md). +Also see [Mainnet RPCs](rpcs.md) and [Mainnet Explorers](explorers.md). {% endhint %} **Maintainer**: [Protocol Labs](https://protocol.ai) @@ -34,11 +34,10 @@ Also see [Mainnet RPCs](./rpcs.md) and [Mainnet Explorers](./explorers.md). Bootstrap peers for mainnet can be found at: -`https://github.com/filecoin-project/lotus/blob/release/`**[latest release]**`/build/bootstrap/mainnet.pi` +`https://github.com/filecoin-project/lotus/blob/release/`**\[latest release]**`/build/bootstrap/mainnet.pi` The latest Lotus release can be found at https://github.com/filecoin-project/lotus/releases/latest/ - ## Resources * [Latest lightweight snapshot](https://forest-archive.chainsafe.dev/latest/mainnet/) generated with [Forest](http://github.com/ChainSafe/forest) by [ChainSafe](https://chainsafe.io/) @@ -47,3 +46,7 @@ The latest Lotus release can be found at https://github.com/filecoin-project/lot * [Slack Channel for Updates: #fil-network-announcements](https://filecoinproject.slack.com/archives/C01AC6999KQ) * [Slack Channel for Questions: #fil-help](https://filecoinproject.slack.com/archives/CEGN061C5) * [Mainnet block explorer: FilFOX](https://filfox.info/en) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/mainnet) diff --git a/networks/mainnet/explorers.md b/networks/mainnet/explorers.md index 88583a3ef..fafe6d88f 100644 --- a/networks/mainnet/explorers.md +++ b/networks/mainnet/explorers.md @@ -75,3 +75,7 @@ curl --location --request POST 'https://api.node.glif.io/rpc/v1' \ "id":1 }' | jq ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/mainnet/explorers) diff --git a/networks/mainnet/network-performance.md b/networks/mainnet/network-performance.md index 429f9e571..33cc097d2 100644 --- a/networks/mainnet/network-performance.md +++ b/networks/mainnet/network-performance.md @@ -39,3 +39,7 @@ In both methods, the data retrieval process after a retrieval deal is accepted i 3. **Data transfer**: The storage provider begins transferring the data back to the data requester. This is also transferred back at a rate similar to the original data transfer rate, which depends on several factors. Because of the various steps involved in the data retrieval process, Filecoin storage currently meets similar performance bars as traditional _warm_ or _cold_ storage. To get performance that is similar to other hot storage solutions, most users utilize Filecoin with a caching layer such as IPFS. These hybrid and multi-tiered storage solutions use IPFS for hot storage and Filecoin for affordable, frequent, and versioned backups. Some example hybrid storage products include [Lighthouse](https://www.lighthouse.storage/) and [web3.storage](https://web3.storage/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/networks/mainnet/network-performance) diff --git a/networks/mainnet/rpcs.md b/networks/mainnet/rpcs.md index 758ad5ee7..45619d7cf 100644 --- a/networks/mainnet/rpcs.md +++ b/networks/mainnet/rpcs.md @@ -4,32 +4,36 @@ description: Public RPC endpoints are available for the Filecoin mainnet. # RPCs -[Chainlist](https://chainlist.org/?search=filecoin&testnets=true) provides a dynamically updated list of [available Filecoin - Mainnet RPCs](https://chainlist.org/?search=filecoin&testnets=false). +[Chainlist](https://chainlist.org/?search=filecoin\&testnets=true) provides a dynamically updated list of [available Filecoin - Mainnet RPCs](https://chainlist.org/?search=filecoin\&testnets=false). These endpoints are limited to the read-only [Filecoin JSON RPC API](../../reference/json-rpc/) including read-only [Filecoin Eth RPC](../../reference/json-rpc/eth.md) methods, except for the write operations [`MPoolPush`](../../reference/json-rpc/mpool.md#mpoolpush) and [`EthSendRawTransaction`](../../reference/json-rpc/eth.md#ethsendrawtransaction) for sending already signed messages. -{% hint style="info" %} Please note that most publicly hosted endpoints only guarantee recent state, i.e. 2000 of the latest blocks (last 16.67 hours). To request an archival node you can contact a provider below. {% endhint %} +{% hint style="info" %} +Please note that most publicly hosted endpoints **only guarantee recent state, i.e. 2000 of the latest blocks (last 16.67 hours).** To request an archival node you can contact a provider below. +{% endhint %} In order to check the current benchmarked performance of each of the below endpoints, please see the [Filecoin ETH RPC Benchmark app](https://benchmark-rpc.vercel.app/). -Provider | HTTPS endpoint | WSS endpoint | Docs | API Support --- | -- | -- | -- | -- -[Glif Nodes](https://api.node.glif.io/) | `https://api.node.glif.io/rpc/v1` | `wss://wss.node.glif.io/apigw/lotus/rpc/v1` | [Glif Nodes - Docs](https://api.node.glif.io/) | All Filecoin and Eth JSON RPC methods including MPoolPush -[Ankr](https://ankr.com/) | `https://rpc.ankr.com/filecoin` | By request at: https://www.ankr.com/rpc/filecoin | [Ankr Docs - Filecoin](https://www.ankr.com/docs/rpc-service/chains/chains-list/#filecoin) | All Filecoin and Eth JSON RPC methods including MPoolPush -[Chainup Cloud](https://cloud.chainup.com/) | `https://filecoin.chainup.net/rpc/v1` | `wss://filecoin.chainup.net/rpc/v1` | [Chainup Cloud Docs - Filecoin](https://docs.chainupcloud.com/blockchain-api/filecoin/public-apis) |   -[NOWNodes](https://nownodes.io/) | `https://fil.nownodes.io` (Free for 1 month with signup) |   | [NOWNodes - Docs](https://documenter.getpostman.com/view/13630829/TVmFkLwy) |   -[GetBlock](https://getblock.io/nodes/fil) | `https://filecoin.getblock.io` (Free with signup) |   | [GetBlock - Docs](https://getblock.io/docs/getblock-explorer/get-started/) |   +| Provider | HTTPS endpoint | WSS endpoint | Docs | API Support | +| ------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | +| [Glif Nodes](https://api.node.glif.io/) | `https://api.node.glif.io/rpc/v1` | `wss://wss.node.glif.io/apigw/lotus/rpc/v1` | [Glif Nodes - Docs](https://api.node.glif.io/) | All Filecoin and Eth JSON RPC methods including MPoolPush | +| [Ankr](https://ankr.com/) | `https://rpc.ankr.com/filecoin` | By request at: https://www.ankr.com/rpc/filecoin | [Ankr Docs - Filecoin](https://www.ankr.com/docs/rpc-service/chains/chains-list/#filecoin) | All Filecoin and Eth JSON RPC methods including MPoolPush | +| [Chainup Cloud](https://cloud.chainup.com/) | `https://filecoin.chainup.net/rpc/v1` | `wss://filecoin.chainup.net/rpc/v1` | [Chainup Cloud Docs - Filecoin](https://docs.chainupcloud.com/blockchain-api/filecoin/public-apis) | | +| [NOWNodes](https://nownodes.io/) | `https://fil.nownodes.io` (Free for 1 month with signup) | | [NOWNodes - Docs](https://documenter.getpostman.com/view/13630829/TVmFkLwy) | | +| [GetBlock](https://getblock.io/nodes/fil) | `https://filecoin.getblock.io` (Free with signup) | | [GetBlock - Docs](https://getblock.io/docs/getblock-explorer/get-started/) | | ## Additional Notes: -* Glif Nodes offers a [Lotus Lite node](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) endpoint with the following command: +* Glif Nodes offers a [Lotus Lite node](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) endpoint with the following command: ```shell FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite ``` When using a Lotus Lite node, omit `/rpc/v1` from Glif’s WebSocket address. - + A Lotus Lite node is a stripped down version of a Lotus full-node capable of running on lower-end hardware. It also allows for local signing for storage deals without a full Lotus node. + +[Was this page helpful?](https://docs.filecoin.io/networks/mainnet/rpcs) diff --git a/nodes/full-nodes/README.md b/nodes/full-nodes/README.md index da8b3dcbb..57b7529f1 100644 --- a/nodes/full-nodes/README.md +++ b/nodes/full-nodes/README.md @@ -6,3 +6,4 @@ description: >- # Full-nodes +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/full-nodes) diff --git a/nodes/full-nodes/basic-setup.md b/nodes/full-nodes/basic-setup.md index 9ed7d37cf..ecb46ef32 100644 --- a/nodes/full-nodes/basic-setup.md +++ b/nodes/full-nodes/basic-setup.md @@ -37,3 +37,7 @@ cd /usr/local/bin/lotus-X.X.X ``` 9. This will start the Lotus miner, which will use your computer’s computing power to mine new blocks on the Filecoin network. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/full-nodes/basic-setup) diff --git a/nodes/full-nodes/node-providers.md b/nodes/full-nodes/node-providers.md index 6b379e017..dfc92c8c8 100644 --- a/nodes/full-nodes/node-providers.md +++ b/nodes/full-nodes/node-providers.md @@ -23,3 +23,7 @@ Node providers often limit the specifications of the nodes that they offer. Some ### Node providers There are multiple node providers for the Filecoin mainnet and each of the testnets. Checkout the [Networks section](https://docs.filecoin.io/nodes/full-nodes/node-providers/) for details. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/full-nodes/node-providers) diff --git a/nodes/full-nodes/pre-requisites.md b/nodes/full-nodes/pre-requisites.md index db42eab04..e99546032 100644 --- a/nodes/full-nodes/pre-requisites.md +++ b/nodes/full-nodes/pre-requisites.md @@ -19,3 +19,7 @@ Before installing Lotus on your computer, you will need to meet the following pr ## Lotus documentation To get more information, check out the official [Lotus documentation](https://lotus.filecoin.io/lotus/install/prerequisites/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/full-nodes/pre-requisites) diff --git a/nodes/implementations/README.md b/nodes/implementations/README.md index 58b1fb532..11c2e78ca 100644 --- a/nodes/implementations/README.md +++ b/nodes/implementations/README.md @@ -54,3 +54,7 @@ Forest is the Rust implementation of the Filecoin protocol with low hardware req Forest is currently used for generating up-to-date snapshots and managing archival copies of the Filecoin blockchain. Currently, the Forest team is hosting the entire Filecoin archival data for the community to use. This can be downloaded for free [here](https://forest-archive.chainsafe.dev/list/). You can learn more about Forest at the [codebase on GitHub](https://github.com/ChainSafe/forest) and [documentation site](https://docs.forest.chainsafe.io/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/implementations) diff --git a/nodes/implementations/lotus.md b/nodes/implementations/lotus.md index 9c2b9ce8f..b582f31b3 100644 --- a/nodes/implementations/lotus.md +++ b/nodes/implementations/lotus.md @@ -34,3 +34,7 @@ Many hosting service provide access to Lotus nodes on the Filecoin network. Chec ## More information For more information about Lotus, including advanced configuration, check out the Lotus documentation site [lotus.filecoin.io](https://lotus.filecoin.io). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/implementations/lotus) diff --git a/nodes/implementations/venus.md b/nodes/implementations/venus.md index 19a815afa..6bd04421a 100644 --- a/nodes/implementations/venus.md +++ b/nodes/implementations/venus.md @@ -32,3 +32,7 @@ If you are interested in contributing to the development of Venus itself, you ca ## More information For more information about Venus, including advanced configuration, see the [Venus documentation site](https://venus.filecoin.io). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/implementations/venus) diff --git a/nodes/lite-nodes/README.md b/nodes/lite-nodes/README.md index 7463a0285..a165b7b4e 100644 --- a/nodes/lite-nodes/README.md +++ b/nodes/lite-nodes/README.md @@ -6,3 +6,4 @@ description: >- # Lite-nodes +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/lite-nodes) diff --git a/nodes/lite-nodes/spin-up-a-lite-node.md b/nodes/lite-nodes/spin-up-a-lite-node.md index 36f971e48..837cdda16 100644 --- a/nodes/lite-nodes/spin-up-a-lite-node.md +++ b/nodes/lite-nodes/spin-up-a-lite-node.md @@ -1,6 +1,8 @@ --- description: >- - Lite-nodes are a simplified node option that allows developers to perform lightweight tasks on a local node. This page covers how to spin up a lite node on your local machine. + Lite-nodes are a simplified node option that allows developers to perform + lightweight tasks on a local node. This page covers how to spin up a lite node + on your local machine. --- # Spin up a lite-node @@ -20,13 +22,13 @@ To build the lite-node, you’ll need some specific software. Run the following {% tabs %} {% tab title="MacOS" %} 1. Ensure you have [XCode](https://developer.apple.com/xcode/) and [Homebrew](https://brew.sh/) installed. -2. Install the following dependencies: +2. Install the following dependencies: ```shell brew install go jq pkg-config hwloc coreutils rust ``` - {% endtab %} + {% tab title="Ubuntu" %} 1. Install the following dependencies: @@ -34,7 +36,6 @@ To build the lite-node, you’ll need some specific software. Run the following sudo apt update -y sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y ``` - 2. [Install Go](https://go.dev/doc/install) and add `/usr/local/go/bin` to your `$PATH` variable: ```shell @@ -42,14 +43,12 @@ To build the lite-node, you’ll need some specific software. Run the following sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.7.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc ``` - 3. [Install Rust](https://www.rust-lang.org/tools/install), choose the standard installation option, and source the `~/.cargo/env` config file: ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env" ``` - {% endtab %} {% endtabs %} @@ -65,7 +64,6 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. git clone https://github.com/filecoin-project/lotus.git cd lotus/ ``` - 2. Retrieve the latest Lotus release version: ```shell @@ -77,15 +75,14 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. ```output v1.29.0 ``` - -3. Using the value returned from the previous command, checkout to the latest release branch: +3. Using the value returned from the previous command, checkout to the latest release branch: ```shell git checkout v1.29.0 ``` - 4. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section. {% endtab %} + {% tab title="MacOS ARM" %} 1. Clone the repository and move into the `lotus` directory: @@ -93,7 +90,6 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. git clone https://github.com/filecoin-project/lotus.git cd lotus ``` - 2. Retrieve the latest Lotus release version: ```shell @@ -105,23 +101,21 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. ```output v1.29.0 ``` - -3. Using the value returned from the previous command, checkout to the latest release branch: +3. Using the value returned from the previous command, checkout to the latest release branch: ```shell git checkout v1.29.0 ``` - -4. Create the necessary environment variables to allow Lotus to run on M1 architecture: +4. Create the necessary environment variables to allow Lotus to run on M1 architecture: ```bash export LIBRARY_PATH=/opt/homebrew/lib export FFI_BUILD_FROM_SOURCE=1 export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH" ``` - -4. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section. +5. Done! You can move on to the [Build](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary) section. {% endtab %} + {% tab title="Ubuntu" %} 1. Clone the repository and move into the `lotus` directory: @@ -129,7 +123,6 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. git clone https://github.com/filecoin-project/lotus.git cd lotus ``` - 2. Retrieve the latest Lotus release version: ```shell @@ -141,21 +134,18 @@ Before we can build the Lotus binaries, we need to follow a few pre-build steps. ```output v1.29.0 ``` - -3. Using the value returned from the previous command, checkout to the latest release branch: +3. Using the value returned from the previous command, checkout to the latest release branch: ```shell git checkout v1.29.0 ``` - -4. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable SHA extensions by adding these two environment variables. If in doubt, ignore this command and move on to [the next section](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary). +4. If your processor was released later than an AMD Zen or Intel Ice Lake CPU, enable SHA extensions by adding these two environment variables. If in doubt, ignore this command and move on to [the next section](https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node/#build-the-binary). ```shell export RUSTFLAGS="-C target-cpu=native -g" export FFI_BUILD_FROM_SOURCE=1 ``` - -4. Done! You can move on to the Build section. +5. Done! You can move on to the Build section. {% endtab %} {% endtabs %} @@ -170,14 +160,12 @@ The last thing we need to do to get our node setup is to build the package. The ```shell mv ~/.lotus ~/.lotus-backup ``` - 2. Make the Lotus binaries and install them: ```shell make clean all sudo make install ``` - 3. Once the installation finishes, query the Lotus version to ensure everything is installed successfully and for the correct network: ```shell @@ -190,20 +178,19 @@ The last thing we need to do to get our node setup is to build the package. The lotus version 1.29.0+mainnet+git.1ff3b360b ``` {% endtab %} + {% tab title="Calibration" %} 1. Remove or delete any existing Lotus configuration files on your system: ```shell mv ~/.lotus ~/.lotus-backup ``` - 2. Make the Lotus binaries and install them: ```shell make clean && make calibrationnet sudo make install ``` - 3. Once the installation finishes, query the Lotus version to ensure everything is installed successfully and for the correct network: ```shell @@ -215,7 +202,6 @@ The last thing we need to do to get our node setup is to build the package. The ```plaintext lotus version 1.29.0+calibnet+git.1ff3b360b ``` - {% endtab %} {% endtabs %} @@ -225,7 +211,7 @@ Let's start the lite-node by connecting to a remote full-node. We can use the pu {% tabs %} {% tab title="Mainnet" %} -1. Create an environment variable called `FULLNODE_API_INFO` and set it to the WebSockets address of the node you want to connect to. At the same time, start the Lotus daemon with the `--lite` tag: +1. Create an environment variable called `FULLNODE_API_INFO` and set it to the WebSockets address of the node you want to connect to. At the same time, start the Lotus daemon with the `--lite` tag: ```shell FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite @@ -238,9 +224,9 @@ Let's start the lite-node by connecting to a remote full-node. We can use the pu 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... ``` - 2. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. {% endtab %} + {% tab title="Calibration" %} 1. Create an environment variable called `FULLNODE_API_INFO` and set it to the WebSockets address of the node you want to connect to. At the same time, start the Lotus daemon with the `--lite` tag: @@ -255,7 +241,6 @@ Let's start the lite-node by connecting to a remote full-node. We can use the pu 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... ``` - 2. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. {% endtab %} {% endtabs %} @@ -281,9 +266,8 @@ To send JSON-RPC requests to our lite-node, we need to expose the API. # RemoteListenAddress = "" ... ``` - 2. Open the terminal window where your lite-node is running and press `CTRL` + `c` to close the daemon. -3. In the same window, restart the lite-node: +3. In the same window, restart the lite-node: ```shell FULLNODE_API_INFO=wss://wss.node.glif.io/apigw/lotus lotus daemon --lite @@ -296,9 +280,9 @@ To send JSON-RPC requests to our lite-node, we need to expose the API. 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited ... ``` - 4. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. {% endtab %} + {% tab title="Calibration" %} 1. Open `~/.lotus/config.toml` and uncomment `ListenAddress` on line 6: @@ -316,7 +300,6 @@ To send JSON-RPC requests to our lite-node, we need to expose the API. ... ``` - 2. Open the terminal window where your lite-node is running and press `CTRL` + `c` to close the daemon. 3. In the same window, restart the lite-node: @@ -331,7 +314,6 @@ To send JSON-RPC requests to our lite-node, we need to expose the API. 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited. ... ``` - 4. The Lotus daemon will continue to run in this terminal window. All subsequent commands we use should be done in a separate terminal window. {% endtab %} {% endtabs %} @@ -353,7 +335,6 @@ To access privileged JSON-RPC methods, like creating a new wallet, we need to su ```plaintext eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.um-LqY7g-SDOsMheDRbQ9JIaFzus_Pan0J88VQ6ZLVE ``` - 2. Keep this key handy. We're going to use it in the next section. ## Send requests @@ -384,7 +365,6 @@ Let's run a couple of commands to see if the JSON-RPC API is set up correctly. }, ... ``` - 2. Next, let's try to create a new wallet. Since this is a privileged method, we need to supply our auth key `eyJhbGc...`: ```shell @@ -406,7 +386,6 @@ Let's run a couple of commands to see if the JSON-RPC API is set up correctly. ``` The result field is the public key for our address. The private key is stored within our lite-node. - 3. Set the new address as the default wallet for our lite-node. Remember to replace the Bearer token with our auth key `eyJhbGc...` and the `"params"` value with the wallet address, `f1vuc4...`, returned from the previous command: ```shell @@ -426,8 +405,11 @@ Let's run a couple of commands to see if the JSON-RPC API is set up correctly. "result": null } ``` - {% endcode %} ## Next steps You should now have a local lite-node connected to a remote full-node with an admin API key! You can use this setup to continue playing around with the JSON-RPC, or start building your applications on Filecoin! + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/nodes/lite-nodes/spin-up-a-lite-node) diff --git a/reference/built-in-actors/README.md b/reference/built-in-actors/README.md index 40ee728a2..4bf587f27 100644 --- a/reference/built-in-actors/README.md +++ b/reference/built-in-actors/README.md @@ -116,6 +116,10 @@ For more information on `SystemActor`, see the [source code](https://github.com/ ## Access and invoke built-in actors * _Protocol API_, maintained by [Protocol Labs](https://protocol.ai/), … -* _Filecoin.solidity_, maintained by [Protocol Labs](https://protocol.ai/), is a set of libraries that allows Solidity smart contracts to seamlessly call built-in actors methods. **Not all built-in actors and methods are supported** - for a complete list, see the [actors and methods supported](../built-in-actors/filecoin.sol.md). +* _Filecoin.solidity_, maintained by [Protocol Labs](https://protocol.ai/), is a set of libraries that allows Solidity smart contracts to seamlessly call built-in actors methods. **Not all built-in actors and methods are supported** - for a complete list, see the [actors and methods supported](filecoin.sol.md). For information on how invoke and access built-in actors in your smart contracts, see the [developers guide](https://docs.filecoin.io/smart-contracts/developing-contracts/call-built-in-actors/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/built-in-actors) diff --git a/reference/built-in-actors/filecoin.sol.md b/reference/built-in-actors/filecoin.sol.md index 4005636a5..8bc3e3489 100644 --- a/reference/built-in-actors/filecoin.sol.md +++ b/reference/built-in-actors/filecoin.sol.md @@ -4,30 +4,30 @@ description: This page covers the built-in actors Filecoin.sol API. # Filecoin.sol -For conceptual information on built-in actors, including their purposes, how they work and more, see the [conceptual guide](../../reference/built-in-actors/README.md). +For conceptual information on built-in actors, including their purposes, how they work and more, see the [conceptual guide](./). ## Prerequisites -Before you can call a built-in actor using the API, you must [import filecoin.solidity using one of the available methods](../../smart-contracts/developing-contracts#call-built-in-actors/#using-filecoinsolidity). +Before you can call a built-in actor using the API, you must [import filecoin.solidity using one of the available methods](../../smart-contracts/developing-contracts/#call-built-in-actors/#using-filecoinsolidity). ## Call a built-in actor -For available actors and methods see [Available actors and methods](../../smart-contracts/developing-contracts#call-built-in-actors/#available-actors-and-methods). +For available actors and methods see [Available actors and methods](../../smart-contracts/developing-contracts/#call-built-in-actors/#available-actors-and-methods). Once you’ve either imported particular contracts manually or simply installed `filecoin-solidity` using `npm`, create a callable method to access the built-in actor methods the way you normally would in a Solidity smart contract. Working examples of smart contracts that call built-in actor methods are available below. -* [Account](../../reference/built-in-actors/filecoin.sol.md#call-the-account-actor) -* [DataCap](../../reference/built-in-actors/filecoin.sol.md#call-the-datacap-actor) -* [Miner](../../reference/built-in-actors/filecoin.sol.md#call-the-miner-actor) -* [Storage market](../../reference/built-in-actors/filecoin.sol.md#call-the-storage-market-actor) -* [Storage power](../../reference/built-in-actors/filecoin.sol.md#call-the-storage-power-actor) -* [Verified registry](../../reference/built-in-actors/filecoin.sol.md#call-the-verified-registry-actor) +* [Account](filecoin.sol.md#call-the-account-actor) +* [DataCap](filecoin.sol.md#call-the-datacap-actor) +* [Miner](filecoin.sol.md#call-the-miner-actor) +* [Storage market](filecoin.sol.md#call-the-storage-market-actor) +* [Storage power](filecoin.sol.md#call-the-storage-power-actor) +* [Verified registry](filecoin.sol.md#call-the-verified-registry-actor) -For conceptual information on built-in actors, including their purposes, how they work and available types, see the [conceptual guide](../../reference/built-in-actors/README.md/). +For conceptual information on built-in actors, including their purposes, how they work and available types, see the [conceptual guide](./). ### Call the account actor -The following example imports the Account actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-account-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/account.test.sol). +The following example imports the Account actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-account-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/account.test.sol). ```solidity pragma solidity ^0.8.17; @@ -50,7 +50,7 @@ contract AccountApiTest { ### Call the DataCap actor -The following example imports the DataCap actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-datacap-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/datacap.test.sol). +The following example imports the DataCap actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-datacap-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/datacap.test.sol). ```solidity pragma solidity ^0.8.17; @@ -118,7 +118,7 @@ contract DataCapApiTest { ### Call the storage market actor -The following example imports the Storage market actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-storage-market-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol). +The following example imports the Storage market actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-storage-market-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol). ```solidity pragma solidity ^0.8.17; @@ -187,7 +187,7 @@ contract MarketApiTest { ### Call the miner actor -The following example imports the Account actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-miner-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol). +The following example imports the Account actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-miner-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/miner.test.sol). ```solidity pragma solidity ^0.8.17; @@ -264,7 +264,7 @@ contract MinerApiTest { ### Call the storage power actor -The following example imports the Storage power actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-storage-power-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/power.test.sol). +The following example imports the Storage power actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-storage-power-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/power.test.sol). ```solidity pragma solidity ^0.8.17; @@ -298,7 +298,7 @@ contract PowerApiTest { ### Call the verified registry actor -The following example imports the verified registry actor library and creates a callable method for each of the [available actor methods](../../reference/built-in-actors/filecoin.sol.md#call-the-verified-registry-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/verifreg.test.sol). +The following example imports the verified registry actor library and creates a callable method for each of the [available actor methods](filecoin.sol.md#call-the-verified-registry-actor). For the full code, see [the GitHub repository](https://github.com/filecoin-project/filecoin-solidity/blob/master/contracts/v0.8/tests/verifreg.test.sol). ```solidity pragma solidity ^0.8.17; @@ -331,3 +331,7 @@ contract VerifRegApiTest { } } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/built-in-actors/filecoin.sol) diff --git a/reference/built-in-actors/protocol-api.md b/reference/built-in-actors/protocol-api.md index d0251c11f..8ad51a2d6 100644 --- a/reference/built-in-actors/protocol-api.md +++ b/reference/built-in-actors/protocol-api.md @@ -1306,3 +1306,7 @@ Results: * `struct` BatchReturn * `uint32` SuccessCount - total successes in the batch * `struct` FailCodes\[] {`uint32` idx, `uint32` code} - list of failure code and index for all failures in batch. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/built-in-actors/protocol-api) diff --git a/reference/exchanges/README.md b/reference/exchanges/README.md index a1b3eb213..570cb8103 100644 --- a/reference/exchanges/README.md +++ b/reference/exchanges/README.md @@ -6,3 +6,4 @@ description: >- # Exchanges +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/exchanges) diff --git a/reference/exchanges/exchange-integration.md b/reference/exchanges/exchange-integration.md index 3b5621367..6f538147b 100644 --- a/reference/exchanges/exchange-integration.md +++ b/reference/exchanges/exchange-integration.md @@ -281,3 +281,7 @@ Join the [Filecoin Slack](https://filecoinproject.slack.com/signup) and post any * [Filecoin Networks](https://status.filecoin.io) * [Lotus](https://github.com/filecoin-project/lotus) - the reference implementation for the Filecoin network * [Block Explorers](https://docs.filecoin.io/networks/mainnet/explorers/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/exchanges/exchange-integration) diff --git a/reference/general/README.md b/reference/general/README.md index 83afb1328..455ec0165 100644 --- a/reference/general/README.md +++ b/reference/general/README.md @@ -23,7 +23,7 @@ description: >- * [Forest](https://github.com/ChainSafe/forest) - Rust. * Lotus Docker Hub Images (unofficial): * [`glif/lotus`](https://github.com/glifio/filecoin-docker) - * [`textile/lotus`](https://hub.docker.com/r/textile/lotus) + * [`textile/lotus`](https://hub.docker.com/r/textile/lotus) ### Networks @@ -78,14 +78,14 @@ Developer tools, API clients & storage services that developers can use to build * [Lighthouse](https://www.lighthouse.storage/) - Lighthouse offers a suite of tools to enable builders to store data on Filecoin when biulding apps. * [`NFT.storage`](https://nft.storage/) - Preserve your NFTs with our new low-cost, easy-to-use solution, ensuring verifiable long-term storage on Filecoin. * [`Web3.storage`](https://web3.storage/) - service from Protocol Labs for storing off-chain _dApp_ data on IPFS and Filecoin, with help from Pinata (a fast IPFS Pinning Service) to [distribute the content across IPFS](https://www.pinata.cloud/blog/protocol-labs-and-pinata) -* [`Textile.io's tools`](https://docs.textile.io/) - suite of tools for interacting with IPFS and Filecoin, including [Tableland](https://tableland.xyz/) and Filecoin bridges to Polygon and NEAR. -* [Fleek’s tools](https://fleek.co/) - provides access to Fleek’s hosted services using IPFS, Textile, Filecoin, Ethereum, etc. More Fleek developer resources are available at [Fleek.xyz](https://fleek.xyz/). +* [`Textile.io's tools`](https://docs.textile.io/) - suite of tools for interacting with IPFS and Filecoin, including [Tableland](https://tableland.xyz/) and Filecoin bridges to Polygon and NEAR. +* [Fleek’s tools](https://fleek.co/) - provides access to Fleek’s hosted services using IPFS, Textile, Filecoin, Ethereum, etc. More Fleek developer resources are available at [Fleek.xyz](https://fleek.xyz/). * [Space SDK](https://docs.fleek.co/space-sdk/overview/) - modular JavaScript/Typescript library and set of interfaces that packages tools and features enabled by Open Web protocols like IPFS, Textile, Filecoin, and Ethereum. * [Space Daemon](https://docs.fleek.co/space-daemon/overview/) - packages together IPFS and tools from Textile into one easy to install background service. ### Message signing tools -* [Filecoin Signing Tools](../built-in-actors/README.md) - _**Recommended**_ a pure JS or Rust / WASM / JSONRPC library for creating signed messages apart from a Filecoin node. +* [Filecoin Signing Tools](../built-in-actors/) - _**Recommended**_ a pure JS or Rust / WASM / JSONRPC library for creating signed messages apart from a Filecoin node. * For an open source example of how to use it see the [Glif web wallet](https://github.com/glifio/wallet) on GitHub. * [Filecoin JS Signer](https://github.com/blitslabs/filecoin-js-signer) - \[_last update: June 2021_] pure TS / JS library for creating signed messages and interacting with Filecoin’s built-in Actors (like Payment Channel and Multisig), used by the [Filecoin Loans grant project](https://github.com/blitslabs/filecoin.loans-monorepo). * On npm at [`@blitslabs/filecoin-js-signer`](https://www.npmjs.com/package/@blitslabs/filecoin-js-signer) @@ -99,7 +99,7 @@ Developer tools, API clients & storage services that developers can use to build > NOTE: making deep calls into the chain’s history may take some time to return and it may be more efficient to use a chain database (e.g. used by block explorers) that stores the chain’s history and is optimized for queries. -* [GLIF nodes](https://lotus.filecoin.io/lotus/developers/glif-nodes/) - A hosted endpoint to Filecoin mainnet and testnet. Note: as of Q1 2023, Infura no longer supports Filecoin. +* [GLIF nodes](https://lotus.filecoin.io/lotus/developers/glif-nodes/) - A hosted endpoint to Filecoin mainnet and testnet. Note: as of Q1 2023, Infura no longer supports Filecoin. * The GLIF endpoint supports read-only calls and `MPoolPush()` for sending signed transactions to the network (which can be signed using the [Message signing tools](https://docs.filecoin.io/reference/general/overview/#message-signing-tools)). * [**Lotus JSON-RPC API**](https://lotus.filecoin.io/lotus/get-started/what-is-lotus/) - Lotus offers the full feature set of its capabilities through API. * [lotus API Postman sample](https://documenter.getpostman.com/view/4872192/SWLh5mUd?version=latest) - (shows sample wallet calls only) @@ -164,3 +164,7 @@ For running a node cluster of load balanced Lotus JSON RPC API endpoints. ### Grants and accelerators * [**Filecoin Developer Grants**](https://www.fil.org/grants) - ongoing monthly developer grant program to support open source projects and new [Open Grants](https://github.com/filecoin-project/devgrants/blob/master/Program%20Resources/Open%20Grants%20README.md) on Filecoin. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/general) diff --git a/reference/general/glossary.md b/reference/general/glossary.md index 6f0874e73..d6b5ee92a 100644 --- a/reference/general/glossary.md +++ b/reference/general/glossary.md @@ -183,3 +183,7 @@ The Filecoin network expects constant availability of stored data. Failing to su _Winning Proof-of-Spacetime_ (WinningPoSt) is the mechanism by which [storage providers](https://docs.filecoin.io/reference/general/glossary/#storage-provider) are rewarded for their contributions to the Filecoin network. At the beginning of each [epoch](https://docs.filecoin.io/reference/general/glossary/#epoch), a small number of storage providers are [elected](https://docs.filecoin.io/reference/general/glossary/#election) to each mine a new [block](https://docs.filecoin.io/reference/general/glossary/#block). As a requirement for doing so, each provider is tasked with submitting a compressed [Proof-of-Storage](https://docs.filecoin.io/reference/general/glossary/#proof-of-storage) for a specified [sector](https://docs.filecoin.io/reference/general/glossary/#sector). Each elected provider who successfully creates a block is granted [FIL](https://docs.filecoin.io/reference/general/glossary/#fil), as well as the opportunity to charge other Filecoin participants fees to include [messages](https://docs.filecoin.io/reference/general/glossary/#message) in the block. Storage providers who fail to do this in the necessary window will forfeit their opportunity to mine a block, but will not otherwise incur penalties for their failure to do so. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/general/glossary) diff --git a/reference/general/specifications.md b/reference/general/specifications.md index 6c2662705..3bc9ef904 100644 --- a/reference/general/specifications.md +++ b/reference/general/specifications.md @@ -11,3 +11,7 @@ The Filecoin specification is the technical document that outlines the details o The Filecoin specification is a _living_ document, with frequent updates and changes as the Filecoin network grows. The specification is available to view at [specs.filecoin.io](https://spec.filecoin.io/). You can suggest changes to the specification [over on GitHub](https://github.com/filecoin-project/specs). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/general/specifications) diff --git a/reference/general/tools.md b/reference/general/tools.md index 6c34498de..7887eface 100644 --- a/reference/general/tools.md +++ b/reference/general/tools.md @@ -1,7 +1,7 @@ --- description: >- - This page lists a collection of tools and resources you can use to build on top - of the Filecoin network using the FVM. + This page lists a collection of tools and resources you can use to build on + top of the Filecoin network using the FVM. --- # Tools @@ -12,7 +12,7 @@ These infrastructure libraries and tools exist to speed up the development of so #### Filecoin signing tools -The [Filecoin signing tools](../general/README.md) provide basic functionality for signing Filecoin transactions in pure JavaScript, WASM and Rust. Currently, the Rust and WASM implementations support: +The [Filecoin signing tools](./) provide basic functionality for signing Filecoin transactions in pure JavaScript, WASM and Rust. Currently, the Rust and WASM implementations support: * Secp256k1 * BLS @@ -45,3 +45,7 @@ Filecoin improvement proposals (FIPs) are a way for the Filecoin community to di * [FVM Foundry Cohort Update Recordings](https://www.youtube.com/playlist?list=PL\_0VrY55uV18DBdFIkN0jdBMF8nadVxWQ) * [FVM Foundry Early Builders F/0 Cohort Showcase - Oct 3 2022](https://drive.google.com/file/d/1JLR45vSNScZX7edz9DxwlpYGnVfGm30Q/view?usp=sharing) * [FVM Foundry Early Builders F/1 Cohort Kick Off - Oct 5 2022](https://drive.google.com/file/d/1mV0PMunDUvIBqmuNw9VjUJIf4zE4z9LV/view?usp=sharing) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/general/tools) diff --git a/reference/json-rpc/README.md b/reference/json-rpc/README.md index 9973e290b..e4b70aa63 100644 --- a/reference/json-rpc/README.md +++ b/reference/json-rpc/README.md @@ -23,25 +23,23 @@ curl --location --request POST '' \ ## Step-by-step example -1. In a terminal window, use Curl to request the current chain head from a public [Glif](https://glif.io/en) node.\ +1. In a terminal window, use Curl to request the current chain head from a public [Glif](https://glif.io/en) node.\\ -- ```shell - curl -X POST 'https://api.node.glif.io' \ - -H 'Content-Type: application/json' \ - --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainHead","params":[]}' - ``` - - ```shell - {"jsonrpc":"2.0","result":{"Cids":[{"/":"bafy2bzaceayoigaf3v5muqmknpjfkguse43jp4t2zxhpmykhqynqhkdgpgybc"},{"/":"bafy2bzacecnrtzlhn6h75gm7tozhzuw77plvdhniwzfj7wgmyuju6wn573h22"},{"/":"bafy2bzacecygiaxfsqv7ecb2gvodzh74eret3pchwe5e4j5a3mzlwasvndi6i"},{"/":"bafy2bzacebe477tdmijfse4je2g63gnnkdgzj3ftq6zbygd7toszkrsjts6uu"},{"/":"bafy2bzacedoe6hcxy2cgqzbg4p7qolbd5imbjpjnz2tj4n7o3kw2md4uv2ttq"},{"/":"bafy2bzacec7wbqvskwvolireljmufszdu5nk37yyg4qtxgnrwbyipgoenmhc6"},{"/":"bafy2bzaceahxdiauteywlbjnwj3ntr72qcbamtq3nbvjzyn5wruithpyqyxbm"}],"Blocks":[{"Miner":"f0693008","Ticket":{"VRFProof":"uLR0LHfNBAfQzyYUVBiIEXzyblPv3yPIEsJQGTpaAvO1ZriPZ7wC2IFpw7mrz1RvDQEfsgRXGxb6APTRvrPiFEAe35RFNLKC9SYb64PNcDYwGY4de5LdlHfyUv+Ovwg5"}... - ``` - - The ChainHead endpoint doesn’t require any input parameters, so we’ve left `params` an empty array `[]`. +* ```shell + curl -X POST 'https://api.node.glif.io' \ + -H 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainHead","params":[]}' + ``` -- The above command will output a large chunk of JSON data. You can use [JSON processor JQ](https://stedolan.github.io/jq/) to _prettify_ the output: + ```shell + {"jsonrpc":"2.0","result":{"Cids":[{"/":"bafy2bzaceayoigaf3v5muqmknpjfkguse43jp4t2zxhpmykhqynqhkdgpgybc"},{"/":"bafy2bzacecnrtzlhn6h75gm7tozhzuw77plvdhniwzfj7wgmyuju6wn573h22"},{"/":"bafy2bzacecygiaxfsqv7ecb2gvodzh74eret3pchwe5e4j5a3mzlwasvndi6i"},{"/":"bafy2bzacebe477tdmijfse4je2g63gnnkdgzj3ftq6zbygd7toszkrsjts6uu"},{"/":"bafy2bzacedoe6hcxy2cgqzbg4p7qolbd5imbjpjnz2tj4n7o3kw2md4uv2ttq"},{"/":"bafy2bzacec7wbqvskwvolireljmufszdu5nk37yyg4qtxgnrwbyipgoenmhc6"},{"/":"bafy2bzaceahxdiauteywlbjnwj3ntr72qcbamtq3nbvjzyn5wruithpyqyxbm"}],"Blocks":[{"Miner":"f0693008","Ticket":{"VRFProof":"uLR0LHfNBAfQzyYUVBiIEXzyblPv3yPIEsJQGTpaAvO1ZriPZ7wC2IFpw7mrz1RvDQEfsgRXGxb6APTRvrPiFEAe35RFNLKC9SYb64PNcDYwGY4de5LdlHfyUv+Ovwg5"}... + ``` - ``` + The ChainHead endpoint doesn’t require any input parameters, so we’ve left `params` an empty array `[]`. +* The above command will output a large chunk of JSON data. You can use [JSON processor JQ](https://stedolan.github.io/jq/) to _prettify_ the output: - ``` + ``` + ``` 1. ```shell curl -X POST 'https://api.node.glif.io' \ @@ -73,16 +71,20 @@ curl --location --request POST '' \ Each method has specific permissions that must be met before you can receive a response from a Filecoin node. Methods with the `read` permission can be called by anyone at anytime, without the need for a token. All other permissions require you to send an authentication along with you request. -- `read`: Read node state, no private data. -- `write`: Write to local store / chain, and read permissions. -- `sign`: Use private keys stored in wallet for signing, read and write permissions. -- `admin`: Manage permissions, read, write, and sign permissions. +* `read`: Read node state, no private data. +* `write`: Write to local store / chain, and read permissions. +* `sign`: Use private keys stored in wallet for signing, read and write permissions. +* `admin`: Manage permissions, read, write, and sign permissions. ## Authentication Each node implementation has different ways to generate and manage authentication tokens. Take a look at your node’s specific documentation: -- [Lotus](https://lotus.filecoin.io) -- [Venus](https://venus.filecoin.io) +* [Lotus](https://lotus.filecoin.io) +* [Venus](https://venus.filecoin.io) If you are using a node provider service like [Glif](https://glif.io/en), take a look at your providers documentation to find out how to manage authentication tokens. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc) diff --git a/reference/json-rpc/auth.md b/reference/json-rpc/auth.md index 26adc7e6a..6a16c7bd0 100644 --- a/reference/json-rpc/auth.md +++ b/reference/json-rpc/auth.md @@ -27,3 +27,7 @@ Response: ```json ["write"] ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/auth) diff --git a/reference/json-rpc/chain.md b/reference/json-rpc/chain.md index 8def4876e..1a52be22f 100644 --- a/reference/json-rpc/chain.md +++ b/reference/json-rpc/chain.md @@ -1,7 +1,6 @@ # Chain -The Chain method group contains methods for interacting with the -blockchain, but that do not require any form of state computation. +The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation. ## ChainBlockstoreInfo @@ -21,8 +20,7 @@ Response: ## ChainCheckBlockstore -ChainCheckBlockstore performs an (asynchronous) health check on the chain/state blockstore -if supported by the underlying implementation. +ChainCheckBlockstore performs an (asynchronous) health check on the chain/state blockstore if supported by the underlying implementation. Perms: admin @@ -50,11 +48,7 @@ Response: `{}` ## ChainExport -ChainExport returns a stream of bytes with CAR dump of chain data. -The exported chain data includes the header chain from the given tipset -back to genesis, the entire genesis state, and the most recent 'nroots' -state trees. -If oldmsgskip is set, messages from before the requested roots are also not included. +ChainExport returns a stream of bytes with CAR dump of chain data. The exported chain data includes the header chain from the given tipset back to genesis, the entire genesis state, and the most recent 'nroots' state trees. If oldmsgskip is set, messages from before the requested roots are also not included. Perms: read @@ -79,14 +73,7 @@ Response: `"Ynl0ZSBhcnJheQ=="` ## ChainExportRangeInternal -ChainExportRangeInternal triggers the export of a chain -CAR-snapshot directly to disk. It is similar to ChainExport, -except, depending on options, the snapshot can include receipts, -messages and stateroots for the length between the specified head -and tail, thus producing "archival-grade" snapshots that include -all the on-chain data. The header chain is included back to -genesis and these snapshots can be used to initialize Filecoin -nodes. +ChainExportRangeInternal triggers the export of a chain CAR-snapshot directly to disk. It is similar to ChainExport, except, depending on options, the snapshot can include receipts, messages and stateroots for the length between the specified head and tail, thus producing "archival-grade" snapshots that include all the on-chain data. The header chain is included back to genesis and these snapshots can be used to initialize Filecoin nodes. Perms: admin @@ -196,16 +183,11 @@ Response: ChainGetBlockMessages returns messages stored in the specified block. -Note: If there are multiple blocks in a tipset, it's likely that some -messages will be duplicated. It's also possible for blocks in a tipset to have -different messages from the same sender at the same nonce. When that happens, -only the first message (in a block with lowest ticket) will be considered -for execution +Note: If there are multiple blocks in a tipset, it's likely that some messages will be duplicated. It's also possible for blocks in a tipset to have different messages from the same sender at the same nonce. When that happens, only the first message (in a block with lowest ticket) will be considered for execution NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK -DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET -Use ChainGetParentMessages, which will perform correct message deduplication +DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET Use ChainGetParentMessages, which will perform correct message deduplication Perms: read @@ -328,8 +310,7 @@ Response: ## ChainGetMessage -ChainGetMessage reads a message referenced by the specified CID from the -chain blockstore. +ChainGetMessage reads a message referenced by the specified CID from the chain blockstore. Perms: read @@ -434,8 +415,7 @@ Response: ## ChainGetParentMessages -ChainGetParentMessages returns messages stored in parent tipset of the -specified block. +ChainGetParentMessages returns messages stored in parent tipset of the specified block. Perms: read @@ -478,9 +458,7 @@ Response: ## ChainGetParentReceipts -ChainGetParentReceipts returns receipts for messages in parent tipset of -the specified block. The receipts in the list returned is one-to-one with the -messages returned by a call to ChainGetParentMessages with the same blockCid. +ChainGetParentReceipts returns receipts for messages in parent tipset of the specified block. The receipts in the list returned is one-to-one with the messages returned by a call to ChainGetParentMessages with the same blockCid. Perms: read @@ -511,8 +489,7 @@ Response: ## ChainGetPath -ChainGetPath returns a set of revert/apply operations needed to get from -one tipset to another, for example: +ChainGetPath returns a set of revert/apply operations needed to get from one tipset to another, for example: ``` to @@ -600,9 +577,7 @@ Response: ## ChainGetTipSetAfterHeight -ChainGetTipSetAfterHeight looks back for a tipset at the specified epoch. -If there are no blocks at the specified epoch, the first non-nil tipset at a later epoch -will be returned. +ChainGetTipSetAfterHeight looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, the first non-nil tipset at a later epoch will be returned. Perms: read @@ -634,9 +609,7 @@ Response: ## ChainGetTipSetByHeight -ChainGetTipSetByHeight looks back for a tipset at the specified epoch. -If there are no blocks at the specified epoch, a tipset at an earlier epoch -will be returned. +ChainGetTipSetByHeight looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned. Perms: read @@ -704,8 +677,7 @@ Response: ## ChainHotGC -ChainHotGC does online (badger) GC on the hot store; only supported if you are using -the splitstore +ChainHotGC does online (badger) GC on the hot store; only supported if you are using the splitstore Perms: admin @@ -725,8 +697,7 @@ Response: `{}` ## ChainNotify -ChainNotify returns channel with chain head updates. -First message is guaranteed to be of len == 1, and type == 'current'. +ChainNotify returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'. Perms: read @@ -749,8 +720,7 @@ Response: ## ChainPrune -ChainPrune forces compaction on cold store and garbage collects; only supported if you -are using the splitstore +ChainPrune forces compaction on cold store and garbage collects; only supported if you are using the splitstore Perms: admin @@ -783,8 +753,7 @@ Response: `{}` ## ChainReadObj -ChainReadObj reads ipld nodes referenced by the specified CID from chain -blockstore and returns raw bytes. +ChainReadObj reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes. Perms: read @@ -825,9 +794,7 @@ Response: `{}` ## ChainStatObj -ChainStatObj returns statistics about the graph referenced by 'obj'. -If 'base' is also specified, then the returned stat will be a diff -between the two objects. +ChainStatObj returns statistics about the graph referenced by 'obj'. If 'base' is also specified, then the returned stat will be a diff between the two objects. Perms: read @@ -875,3 +842,7 @@ Inputs: ``` Response: `"0"` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/chain) diff --git a/reference/json-rpc/client.md b/reference/json-rpc/client.md index 2bb2b7d3a..4ad8cf435 100644 --- a/reference/json-rpc/client.md +++ b/reference/json-rpc/client.md @@ -4,5 +4,8 @@ The Client methods are now deprecated and have been removed from Lotus (the Filecoin reference implemenation). {% endhint %} -Some similar functionality can be found by using the [Boostly](https://github.com/filecoin-shipyard/boostly) library, -which interacts with market actors provided by [Boost](https://boost.filecoin.io/). +Some similar functionality can be found by using the [Boostly](https://github.com/filecoin-shipyard/boostly) library, which interacts with market actors provided by [Boost](https://boost.filecoin.io/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/client) diff --git a/reference/json-rpc/create.md b/reference/json-rpc/create.md index 517a64167..1ccc45ad5 100644 --- a/reference/json-rpc/create.md +++ b/reference/json-rpc/create.md @@ -2,10 +2,7 @@ ## CreateBackup -CreateBackup creates node backup onder the specified file name. The -method requires that the lotus daemon is running with the -LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that -the path specified when calling CreateBackup is within the base path +CreateBackup creates node backup onder the specified file name. The method requires that the lotus daemon is running with the LOTUS\_BACKUP\_BASE\_PATH environment variable set to some path, and that the path specified when calling CreateBackup is within the base path Perms: admin @@ -16,3 +13,7 @@ Inputs: ``` Response: `{}` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/create) diff --git a/reference/json-rpc/eth.md b/reference/json-rpc/eth.md index b9942c088..7b70e2b1f 100644 --- a/reference/json-rpc/eth.md +++ b/reference/json-rpc/eth.md @@ -2,7 +2,7 @@ These methods are used for Ethereum-compatible JSON-RPC calls -EthAccounts will always return [] since we don't expect Lotus to manage private keys +EthAccounts will always return \[] since we don't expect Lotus to manage private keys ## EthAccounts @@ -38,26 +38,21 @@ FilecoinAddressToEthAddress converts any Filecoin address to an EthAddress. This method supports all Filecoin address types: -- `f0` and `f4` addresses: Converted directly. -- `f1/f2/f3` addresses: First converted to their corresponding `f0` ID address, then to an `0x` EthAddress. +* `f0` and `f4` addresses: Converted directly. +* `f1/f2/f3` addresses: First converted to their corresponding `f0` ID address, then to an `0x` EthAddress. > **Note:** -> -> f0 ID addresses are not permanent and can be affected by chain reorganizations. To account for this, -> the API includes a `blkNum` parameter, which specifies the block number that is used to determine the tipset state to use for converting an -> f1/f2/f3 address to an f0 address. This parameter functions similarly to the `blkNum` parameter in the existing `EthGetBlockByNumber` API. -> See [Alchemy Docs - eth_getBlockByNumber](https://docs.alchemy.com/reference/eth-getblockbynumber) for more details. +> +> f0 ID addresses are not permanent and can be affected by chain reorganizations. To account for this, the API includes a `blkNum` parameter, which specifies the block number that is used to determine the tipset state to use for converting an f1/f2/f3 address to an f0 address. This parameter functions similarly to the `blkNum` parameter in the existing `EthGetBlockByNumber` API. See [Alchemy Docs - eth\_getBlockByNumber](https://docs.alchemy.com/reference/eth-getblockbynumber) for more details. Requirements: -- For `f1/f2/f3` addresses, they must be instantiated on-chain, as `f0` ID addresses are only assigned to actors when they are created on-chain. - The simplest way to instantiate an address on chain is to send a transaction to the address. +* For `f1/f2/f3` addresses, they must be instantiated on-chain, as `f0` ID addresses are only assigned to actors when they are created on-chain. The simplest way to instantiate an address on chain is to send a transaction to the address. Parameters: -- filecoinAddress: The Filecoin address to convert. -- blkNum: The block number or state for the conversion. Defaults to "finalized" for maximum safety. - Possible values: "pending", "latest", "finalized", "safe", or a specific block number represented as hex. +* filecoinAddress: The Filecoin address to convert. +* blkNum: The block number or state for the conversion. Defaults to "finalized" for maximum safety. Possible values: "pending", "latest", "finalized", "safe", or a specific block number represented as hex. Perms: read @@ -309,8 +304,7 @@ Response: `"0x07"` ## EthGetFilterChanges -Polling method for a filter, returns event logs which occurred since last poll. -(requires write perm since timestamp of last filter execution will be written) +Polling method for a filter, returns event logs which occurred since last poll. (requires write perm since timestamp of last filter execution will be written) Perms: read @@ -328,8 +322,7 @@ Response: ## EthGetFilterLogs -Returns event logs matching filter with given id. -(requires write perm since timestamp of last filter execution will be written) +Returns event logs matching filter with given id. (requires write perm since timestamp of last filter execution will be written) Perms: read @@ -737,14 +730,11 @@ Response: `"0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"` ## EthSubscribe -Subscribe to different event types using websockets -eventTypes is one or more of: +Subscribe to different event types using websockets eventTypes is one or more of: -- newHeads: notify when new blocks arrive. -- pendingTransactions: notify when new messages arrive in the message pool. -- logs: notify new event logs that match a criteria - params contains additional parameters used with the log event type - The client will receive a stream of EthSubscriptionResponse values until EthUnsubscribe is called. +* newHeads: notify when new blocks arrive. +* pendingTransactions: notify when new messages arrive in the message pool. +* logs: notify new event logs that match a criteria params contains additional parameters used with the log event type The client will receive a stream of EthSubscriptionResponse values until EthUnsubscribe is called. Perms: read @@ -876,4 +866,8 @@ Inputs: ["0x37690cfec6c1bf4c3b9288c7a5d783e98731e90b0a4c177c2a374c7a9427355e"] ``` -Response: `true` \ No newline at end of file +Response: `true` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/eth) diff --git a/reference/json-rpc/gas.md b/reference/json-rpc/gas.md index ae19c785d..146498191 100644 --- a/reference/json-rpc/gas.md +++ b/reference/json-rpc/gas.md @@ -41,8 +41,7 @@ Response: `"0"` ## GasEstimateGasLimit -GasEstimateGasLimit estimates gas used by the message and returns it. -It fails if message fails to execute. +GasEstimateGasLimit estimates gas used by the message and returns it. It fails if message fails to execute. Perms: read @@ -80,8 +79,7 @@ Response: `9` ## GasEstimateGasPremium -GasEstimateGasPremium estimates what gas price should be used for a -message to have high likelihood of inclusion in `nblocksincl` epochs. +GasEstimateGasPremium estimates what gas price should be used for a message to have high likelihood of inclusion in `nblocksincl` epochs. Perms: read @@ -164,3 +162,7 @@ Response: } } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/gas) diff --git a/reference/json-rpc/i.md b/reference/json-rpc/i.md index c47ae047d..28998153a 100644 --- a/reference/json-rpc/i.md +++ b/reference/json-rpc/i.md @@ -7,3 +7,7 @@ Perms: read Inputs: `null` Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/i) diff --git a/reference/json-rpc/log.md b/reference/json-rpc/log.md index e1e22d3a6..291e5d093 100644 --- a/reference/json-rpc/log.md +++ b/reference/json-rpc/log.md @@ -53,3 +53,7 @@ Inputs: ``` Response: `{}` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/log) diff --git a/reference/json-rpc/market.md b/reference/json-rpc/market.md index 4e4ff58ea..89206c61b 100644 --- a/reference/json-rpc/market.md +++ b/reference/json-rpc/market.md @@ -87,3 +87,7 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/market) diff --git a/reference/json-rpc/miner.md b/reference/json-rpc/miner.md index 819be8c58..d85edbad6 100644 --- a/reference/json-rpc/miner.md +++ b/reference/json-rpc/miner.md @@ -191,3 +191,7 @@ Response: "EligibleForMining": true } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/miner) diff --git a/reference/json-rpc/mpool.md b/reference/json-rpc/mpool.md index e9769eb8a..f6f359110 100644 --- a/reference/json-rpc/mpool.md +++ b/reference/json-rpc/mpool.md @@ -1,7 +1,6 @@ # Mpool -The Mpool methods are for interacting with the message pool. The message pool -manages all incoming and outgoing 'messages' going over the network. +The Mpool methods are for interacting with the message pool. The message pool manages all incoming and outgoing 'messages' going over the network. ## MpoolBatchPush @@ -303,9 +302,7 @@ Response: ## MpoolClear -MpoolClear clears pending messages from the mpool. -If clearLocal is true, ALL messages will be cleared. -If clearLocal is false, local messages will be protected, all others will be cleared. +MpoolClear clears pending messages from the mpool. If clearLocal is true, ALL messages will be cleared. If clearLocal is false, local messages will be protected, all others will be cleared. Perms: write @@ -340,8 +337,7 @@ Response: ## MpoolGetNonce -MpoolGetNonce gets next nonce for the specified sender. -Note that this method may not be atomic. Use MpoolPushMessage instead. +MpoolGetNonce gets next nonce for the specified sender. Note that this method may not be atomic. Use MpoolPushMessage instead. Perms: read @@ -452,12 +448,9 @@ Response: ## MpoolPushMessage -MpoolPushMessage atomically assigns a nonce, signs, and pushes a message -to mempool. -maxFee is only used when GasFeeCap/GasPremium fields aren't specified +MpoolPushMessage atomically assigns a nonce, signs, and pushes a message to mempool. maxFee is only used when GasFeeCap/GasPremium fields aren't specified -When maxFee is set to 0, MpoolPushMessage will guess appropriate fee -based on current chain conditions +When maxFee is set to 0, MpoolPushMessage will guess appropriate fee based on current chain conditions Perms: sign @@ -674,3 +667,7 @@ Response: } } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/mpool) diff --git a/reference/json-rpc/msig.md b/reference/json-rpc/msig.md index fdbb4b073..74bc8eeea 100644 --- a/reference/json-rpc/msig.md +++ b/reference/json-rpc/msig.md @@ -1,13 +1,10 @@ # Msig -The Msig methods are used to interact with multisig wallets on the -filecoin network +The Msig methods are used to interact with multisig wallets on the filecoin network ## MsigAddApprove -MsigAddApprove approves a previously proposed AddSigner message -It takes the following params: , , , -, , +MsigAddApprove approves a previously proposed AddSigner message It takes the following params: , , , , , Perms: sign @@ -42,9 +39,7 @@ Response: ## MsigAddCancel -MsigAddCancel cancels a previously proposed AddSigner message -It takes the following params: , , , -, +MsigAddCancel cancels a previously proposed AddSigner message It takes the following params: , , , , Perms: sign @@ -79,9 +74,7 @@ Response: ## MsigAddPropose -MsigAddPropose proposes adding a signer in the multisig -It takes the following params: , , -, +MsigAddPropose proposes adding a signer in the multisig It takes the following params: , , , Perms: sign @@ -116,8 +109,7 @@ Response: ## MsigApprove -MsigApprove approves a previously-proposed multisig message by transaction ID -It takes the following params: , +MsigApprove approves a previously-proposed multisig message by transaction ID It takes the following params: , Perms: sign @@ -152,12 +144,7 @@ Response: ## MsigApproveTxnHash -MsigApproveTxnHash approves a previously-proposed multisig message, specified -using both transaction ID and a hash of the parameters used in the -proposal. This method of approval can be used to ensure you only approve -exactly the transaction you think you are. -It takes the following params: , , , , , -, , +MsigApproveTxnHash approves a previously-proposed multisig message, specified using both transaction ID and a hash of the parameters used in the proposal. This method of approval can be used to ensure you only approve exactly the transaction you think you are. It takes the following params: , , , , , , , Perms: sign @@ -192,8 +179,7 @@ Response: ## MsigCancel -MsigCancel cancels a previously-proposed multisig message -It takes the following params: , +MsigCancel cancels a previously-proposed multisig message It takes the following params: , Perms: sign @@ -228,9 +214,7 @@ Response: ## MsigCancelTxnHash -MsigCancel cancels a previously-proposed multisig message -It takes the following params: , , , , -, , +MsigCancel cancels a previously-proposed multisig message It takes the following params: , , , , , , Perms: sign @@ -265,9 +249,7 @@ Response: ## MsigCreate -MsigCreate creates a multisig wallet -It takes the following params: , , -, , +MsigCreate creates a multisig wallet It takes the following params: , , , , Perms: sign @@ -326,9 +308,7 @@ Response: `"0"` ## MsigGetPending -MsigGetPending returns pending transactions for the given multisig -wallet. Once pending transactions are fully approved, they will no longer -appear here. +MsigGetPending returns pending transactions for the given multisig wallet. Once pending transactions are fully approved, they will no longer appear here. Perms: read @@ -365,8 +345,7 @@ Response: ## MsigGetVested -MsigGetVested returns the amount of FIL that vested in a multisig in a certain period. -It takes the following params: , , +MsigGetVested returns the amount of FIL that vested in a multisig in a certain period. It takes the following params: , , Perms: read @@ -430,9 +409,7 @@ Response: ## MsigPropose -MsigPropose proposes a multisig message -It takes the following params: , , , -, , +MsigPropose proposes a multisig message It takes the following params: , , , , , Perms: sign @@ -467,11 +444,7 @@ Response: ## MsigRemoveSigner -MsigRemoveSigner proposes the removal of a signer from the multisig. -It accepts the multisig to make the change on, the proposer address to -send the message from, the address to be removed, and a boolean -indicating whether or not the signing threshold should be lowered by one -along with the address removal. +MsigRemoveSigner proposes the removal of a signer from the multisig. It accepts the multisig to make the change on, the proposer address to send the message from, the address to be removed, and a boolean indicating whether or not the signing threshold should be lowered by one along with the address removal. Perms: sign @@ -506,9 +479,7 @@ Response: ## MsigSwapApprove -MsigSwapApprove approves a previously proposed SwapSigner -It takes the following params: , , , -, , +MsigSwapApprove approves a previously proposed SwapSigner It takes the following params: , , , , , Perms: sign @@ -543,9 +514,7 @@ Response: ## MsigSwapCancel -MsigSwapCancel cancels a previously proposed SwapSigner message -It takes the following params: , , , -, +MsigSwapCancel cancels a previously proposed SwapSigner message It takes the following params: , , , , Perms: sign @@ -580,9 +549,7 @@ Response: ## MsigSwapPropose -MsigSwapPropose proposes swapping 2 signers in the multisig -It takes the following params: , , -, +MsigSwapPropose proposes swapping 2 signers in the multisig It takes the following params: , , , Perms: sign @@ -614,3 +581,7 @@ Response: "ValidNonce": true } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/msig) diff --git a/reference/json-rpc/net.md b/reference/json-rpc/net.md index b2ce1b729..96b9e46a3 100644 --- a/reference/json-rpc/net.md +++ b/reference/json-rpc/net.md @@ -470,3 +470,7 @@ Perms: read Inputs: `null` Response: `"string value"` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/net) diff --git a/reference/json-rpc/node.md b/reference/json-rpc/node.md index 21c22fc06..22fa0e4d6 100644 --- a/reference/json-rpc/node.md +++ b/reference/json-rpc/node.md @@ -32,3 +32,7 @@ Response: } } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/node) diff --git a/reference/json-rpc/paych.md b/reference/json-rpc/paych.md index 05b78306f..b4c54c940 100644 --- a/reference/json-rpc/paych.md +++ b/reference/json-rpc/paych.md @@ -92,8 +92,7 @@ Response: ## PaychFund -PaychFund gets or creates a payment channel between address pair. -The specified amount will be added to the channel through on-chain send for future use +PaychFund gets or creates a payment channel between address pair. The specified amount will be added to the channel through on-chain send for future use Perms: sign @@ -116,14 +115,9 @@ Response: ## PaychGet -PaychGet gets or creates a payment channel between address pair -The specified amount will be reserved for use. If there aren't enough non-reserved funds -available, funds will be added through an on-chain message. +PaychGet gets or creates a payment channel between address pair The specified amount will be reserved for use. If there aren't enough non-reserved funds available, funds will be added through an on-chain message. -- When opts.OffChain is true, this call will not cause any messages to be sent to the chain (no automatic - channel creation/funds adding). If the operation can't be performed without sending a message an error will be - returned. Note that even when this option is specified, this call can be blocked by previous operations on the - channel waiting for on-chain operations. +* When opts.OffChain is true, this call will not cause any messages to be sent to the chain (no automatic channel creation/funds adding). If the operation can't be performed without sending a message an error will be returned. Note that even when this option is specified, this call can be blocked by previous operations on the channel waiting for on-chain operations. Perms: sign @@ -532,3 +526,7 @@ Response: "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/paych) diff --git a/reference/json-rpc/raft.md b/reference/json-rpc/raft.md index 6bbe65e10..cde2e5f0b 100644 --- a/reference/json-rpc/raft.md +++ b/reference/json-rpc/raft.md @@ -22,3 +22,7 @@ Response: "MsgUuids": {} } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/raft) diff --git a/reference/json-rpc/start.md b/reference/json-rpc/start.md index eb7c93e49..4502aa705 100644 --- a/reference/json-rpc/start.md +++ b/reference/json-rpc/start.md @@ -7,3 +7,7 @@ Perms: read Inputs: `null` Response: `"0001-01-01T00:00:00Z"` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/start) diff --git a/reference/json-rpc/state.md b/reference/json-rpc/state.md index 293e4ced4..9d9599172 100644 --- a/reference/json-rpc/state.md +++ b/reference/json-rpc/state.md @@ -1,8 +1,6 @@ # State -The State methods are used to query, inspect, and interact with chain state. -Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. -A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. +The State methods are used to query, inspect, and interact with chain state. Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. ## StateAccountKey @@ -99,9 +97,7 @@ Response: StateCall runs the given message and returns its result without any persisted changes. -StateCall applies the message to the tipset's parent state. The -message is not applied on-top-of the messages in the passed-in -tipset. +StateCall applies the message to the tipset's parent state. The message is not applied on-top-of the messages in the passed-in tipset. Perms: read @@ -245,8 +241,7 @@ Response: ## StateChangedActors -StateChangedActors returns all the actors whose states change between the two given state CIDs -TODO: Should this take tipset keys instead? +StateChangedActors returns all the actors whose states change between the two given state CIDs TODO: Should this take tipset keys instead? Perms: read @@ -283,8 +278,7 @@ Response: ## StateCirculatingSupply -StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset. -This is not used anywhere in the protocol itself, and is only for external consumption. +StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset. This is not used anywhere in the protocol itself, and is only for external consumption. Perms: read @@ -307,39 +301,29 @@ Response: `"0"` ## StateCompute -StateCompute is a flexible command that applies the given messages on the given tipset. -The messages are run as though the VM were at the provided height. +StateCompute is a flexible command that applies the given messages on the given tipset. The messages are run as though the VM were at the provided height. When called, StateCompute will: -- Load the provided tipset, or use the current chain head if not provided -- Compute the tipset state of the provided tipset on top of the parent state - - (note that this step runs before vmheight is applied to the execution) - - Execute state upgrade if any were scheduled at the epoch, or in null - blocks preceding the tipset - - Call the cron actor on null blocks preceding the tipset - - For each block in the tipset - - Apply messages in blocks in the specified - - Award block reward by calling the reward actor - - Call the cron actor for the current epoch -- If the specified vmheight is higher than the current epoch, apply any - needed state upgrades to the state -- Apply the specified messages to the state - -The vmheight parameter sets VM execution epoch, and can be used to simulate -message execution in different network versions. If the specified vmheight -epoch is higher than the epoch of the specified tipset, any state upgrades -until the vmheight will be executed on the state before applying messages -specified by the user. - -Note that the initial tipset state computation is not affected by the -vmheight parameter - only the messages in the `apply` set are - -If the caller wants to simply compute the state, vmheight should be set to -the epoch of the specified tipset. - -Messages in the `apply` parameter must have the correct nonces, and gas -values set. +* Load the provided tipset, or use the current chain head if not provided +* Compute the tipset state of the provided tipset on top of the parent state + * (note that this step runs before vmheight is applied to the execution) + * Execute state upgrade if any were scheduled at the epoch, or in null blocks preceding the tipset + * Call the cron actor on null blocks preceding the tipset + * For each block in the tipset + * Apply messages in blocks in the specified + * Award block reward by calling the reward actor + * Call the cron actor for the current epoch +* If the specified vmheight is higher than the current epoch, apply any needed state upgrades to the state +* Apply the specified messages to the state + +The vmheight parameter sets VM execution epoch, and can be used to simulate message execution in different network versions. If the specified vmheight epoch is higher than the epoch of the specified tipset, any state upgrades until the vmheight will be executed on the state before applying messages specified by the user. + +Note that the initial tipset state computation is not affected by the vmheight parameter - only the messages in the `apply` set are + +If the caller wants to simply compute the state, vmheight should be set to the epoch of the specified tipset. + +Messages in the `apply` parameter must have the correct nonces, and gas values set. Perms: read @@ -525,8 +509,7 @@ Response: ## StateDealProviderCollateralBounds -StateDealProviderCollateralBounds returns the min and max collateral a storage provider -can issue. It takes the deal size and verified status as parameters. +StateDealProviderCollateralBounds returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters. Perms: read @@ -681,8 +664,7 @@ Response: ## StateGetAllocationForPendingDeal -StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if -pending allocation is not found. +StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if pending allocation is not found. Perms: read @@ -744,9 +726,7 @@ Response: `{}` ## StateGetBeaconEntry -StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If -the entry has not yet been produced, the call will block until the entry -becomes available +StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If the entry has not yet been produced, the call will block until the entry becomes available Perms: read @@ -1647,8 +1627,7 @@ Response: `"0"` ## StateMinerProvingDeadline -StateMinerProvingDeadline calculates the deadline at some epoch for a proving period -and returns the deadline-related calculations. +StateMinerProvingDeadline calculates the deadline at some epoch for a proving period and returns the deadline-related calculations. Perms: read @@ -1894,21 +1873,13 @@ Response: StateReplay replays a given message, assuming it was included in a block in the specified tipset. -If a tipset key is provided, and a replacing message is not found on chain, -the method will return an error saying that the message wasn't found +If a tipset key is provided, and a replacing message is not found on chain, the method will return an error saying that the message wasn't found -If no tipset key is provided, the appropriate tipset is looked up, and if -the message was gas-repriced, the on-chain message will be replayed - in -that case the returned InvocResult.MsgCid will not match the Cid param +If no tipset key is provided, the appropriate tipset is looked up, and if the message was gas-repriced, the on-chain message will be replayed - in that case the returned InvocResult.MsgCid will not match the Cid param -If the caller wants to ensure that exactly the requested message was executed, -they MUST check that InvocResult.MsgCid is equal to the provided Cid. -Without this check both the requested and original message may appear as -successfully executed on-chain, which may look like a double-spend. +If the caller wants to ensure that exactly the requested message was executed, they MUST check that InvocResult.MsgCid is equal to the provided Cid. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. -A replacing message is a message with a different CID, any of Gas values, and -different signature, but with all other parameters matching (source/destination, -nonce, params, etc.) +A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read @@ -2042,20 +2013,11 @@ Response: StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed -NOTE: If a replacing message is found on chain, this method will return -a MsgLookup for the replacing message - the MsgLookup.Message will be a different -CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the -result of the execution of the replacing message. +NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message - the MsgLookup.Message will be a different CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the result of the execution of the replacing message. -If the caller wants to ensure that exactly the requested message was executed, -they must check that MsgLookup.Message is equal to the provided 'cid', or set the -`allowReplaced` parameter to false. Without this check, and with `allowReplaced` -set to true, both the requested and original message may appear as -successfully executed on-chain, which may look like a double-spend. +If the caller wants to ensure that exactly the requested message was executed, they must check that MsgLookup.Message is equal to the provided 'cid', or set the `allowReplaced` parameter to false. Without this check, and with `allowReplaced` set to true, both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. -A replacing message is a message with a different CID, any of Gas values, and -different signature, but with all other parameters matching (source/destination, -nonce, params, etc.) +A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read @@ -2141,9 +2103,7 @@ Response: ## StateSectorGetInfo -StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found -NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate -expiration epoch +StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate expiration epoch Perms: read @@ -2224,12 +2184,9 @@ Response: ## StateSectorPreCommitInfo -StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector. -Returns nil and no error if the sector isn't precommitted. +StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector. Returns nil and no error if the sector isn't precommitted. -Note that the sector number may be allocated while PreCommitInfo is nil. This means that either allocated sector -numbers were compacted, and the sector number was marked as allocated in order to reduce size of the allocated -sectors bitfield, or that the sector was precommitted, but the precommit has expired. +Note that the sector number may be allocated while PreCommitInfo is nil. This means that either allocated sector numbers were compacted, and the sector number was marked as allocated in order to reduce size of the allocated sectors bitfield, or that the sector was precommitted, but the precommit has expired. Perms: read @@ -2274,8 +2231,7 @@ Response: ## StateVMCirculatingSupplyInternal -StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset. -This is the value reported by the runtime interface to actors code. +StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset. This is the value reported by the runtime interface to actors code. Perms: read @@ -2309,9 +2265,7 @@ Response: ## StateVerifiedClientStatus -StateVerifiedClientStatus returns the data cap for the given address. -Returns nil if there is no entry in the data cap table for the -address. +StateVerifiedClientStatus returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. Perms: read @@ -2358,9 +2312,7 @@ Response: `"f01234"` ## StateVerifierStatus -StateVerifierStatus returns the data cap for the given address. -Returns nil if there is no entry in the data cap table for the -address. +StateVerifierStatus returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. Perms: read @@ -2384,24 +2336,13 @@ Response: `"0"` ## StateWaitMsg -StateWaitMsg looks back up to limit epochs in the chain for a message. -If not found, it blocks until the message arrives on chain, and gets to the -indicated confidence depth. +StateWaitMsg looks back up to limit epochs in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. -NOTE: If a replacing message is found on chain, this method will return -a MsgLookup for the replacing message - the MsgLookup.Message will be a different -CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the -result of the execution of the replacing message. +NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message - the MsgLookup.Message will be a different CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the result of the execution of the replacing message. -If the caller wants to ensure that exactly the requested message was executed, -they must check that MsgLookup.Message is equal to the provided 'cid', or set the -`allowReplaced` parameter to false. Without this check, and with `allowReplaced` -set to true, both the requested and original message may appear as -successfully executed on-chain, which may look like a double-spend. +If the caller wants to ensure that exactly the requested message was executed, they must check that MsgLookup.Message is equal to the provided 'cid', or set the `allowReplaced` parameter to false. Without this check, and with `allowReplaced` set to true, both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. -A replacing message is a message with a different CID, any of Gas values, and -different signature, but with all other parameters matching (source/destination, -nonce, params, etc.) +A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) Perms: read @@ -2445,3 +2386,7 @@ Response: "Height": 10101 } ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/state) diff --git a/reference/json-rpc/sync.md b/reference/json-rpc/sync.md index 69f24e6c3..313be15dd 100644 --- a/reference/json-rpc/sync.md +++ b/reference/json-rpc/sync.md @@ -1,12 +1,10 @@ # Sync -The Sync method group contains methods for interacting with and -observing the lotus sync service. +The Sync method group contains methods for interacting with and observing the lotus sync service. ## SyncCheckBad -SyncCheckBad checks if a block was marked as bad, and if it was, returns -the reason. +SyncCheckBad checks if a block was marked as bad, and if it was, returns the reason. Perms: read @@ -47,8 +45,7 @@ Response: `{}` ## SyncIncomingBlocks -SyncIncomingBlocks returns a channel streaming incoming, potentially not -yet synced block headers. +SyncIncomingBlocks returns a channel streaming incoming, potentially not yet synced block headers. Perms: read @@ -110,8 +107,7 @@ Response: ## SyncMarkBad -SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced. -Use with extreme caution. +SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced. Use with extreme caution. Perms: admin @@ -165,8 +161,7 @@ Response: ## SyncSubmitBlock -SyncSubmitBlock can be used to submit a newly created block to the. -network through this node +SyncSubmitBlock can be used to submit a newly created block to the. network through this node Perms: write @@ -290,3 +285,7 @@ Inputs: ``` Response: `true` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/sync) diff --git a/reference/json-rpc/wallet.md b/reference/json-rpc/wallet.md index ac8587c30..cd92d70c8 100644 --- a/reference/json-rpc/wallet.md +++ b/reference/json-rpc/wallet.md @@ -108,9 +108,7 @@ Response: ## WalletNew -WalletNew creates a new address in the wallet with the given sigType. -Available key types: bls, secp256k1, secp256k1-ledger -Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated +WalletNew creates a new address in the wallet with the given sigType. Available key types: bls, secp256k1, secp256k1-ledger Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated Perms: write @@ -231,8 +229,7 @@ Response: `"f01234"` ## WalletVerify -WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. -The address does not have to be in the wallet. +WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet. Perms: read @@ -250,3 +247,7 @@ Inputs: ``` Response: `true` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/wallet) diff --git a/reference/json-rpc/web3.md b/reference/json-rpc/web3.md index fb4d3e44a..300d51c31 100644 --- a/reference/json-rpc/web3.md +++ b/reference/json-rpc/web3.md @@ -9,3 +9,7 @@ Perms: read Inputs: `null` Response: `"string value"` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/reference/json-rpc/web3) diff --git a/smart-contracts/advanced/README.md b/smart-contracts/advanced/README.md index ab262d0fa..ab457d663 100644 --- a/smart-contracts/advanced/README.md +++ b/smart-contracts/advanced/README.md @@ -6,3 +6,4 @@ description: >- # Advanced +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced) diff --git a/smart-contracts/advanced/aggregated-deal-making.md b/smart-contracts/advanced/aggregated-deal-making.md index 5d9608f38..487498671 100644 --- a/smart-contracts/advanced/aggregated-deal-making.md +++ b/smart-contracts/advanced/aggregated-deal-making.md @@ -1,13 +1,15 @@ --- description: >- - Learn about aggregated deal-making on the Filecoin blockchain, where developers can combine small storage deals into larger, more attractive deals for storage providers. + Learn about aggregated deal-making on the Filecoin blockchain, where + developers can combine small storage deals into larger, more attractive deals + for storage providers. --- # Aggregated deal-making -Filecoin is designed to store large data for extended periods. Small-scale data (<4 GiB) can be combined with other small deals into larger ones, either on-chain or off-chain. Smart contracts can handle programmatic data storing. This article explains the process, referring to small-scale data as _sub-piece data_. +Filecoin is designed to store large data for extended periods. Small-scale data (<4 GiB) can be combined with other small deals into larger ones, either on-chain or off-chain. Smart contracts can handle programmatic data storing. This article explains the process, referring to small-scale data as _sub-piece data_. -For context, a [_piece_](https://spec.filecoin.io/systems/filecoin_files/piece/) of data in Filecoin refers to a unit of negotiation for data to be stored on Filecoin. A sub-piece refers to a sub-unit of that larger piece. These are typically small data like NFT images, short videos and more. +For context, a [_piece_](https://spec.filecoin.io/systems/filecoin\_files/piece/) of data in Filecoin refers to a unit of negotiation for data to be stored on Filecoin. A sub-piece refers to a sub-unit of that larger piece. These are typically small data like NFT images, short videos and more. Aggregation is the process of combining multiple packages of _sub-piece data_ into a single package. This large package is stored on the Filecoin network instead of multiple smaller packages. Aggregation can be done off-chain or on-chain. @@ -16,12 +18,11 @@ Aggregation is the process of combining multiple packages of _sub-piece data_ in The base interface for aggregation requires the following components: 1. A client who has data to upload. -1. An aggregator platform that clients can interact with to request to make a storage deal and retrieve Proof of Deal Sub-piece Inclusion (PoDSI) from. -1. An aggregation node to aggregate the sub-piece data into a larger file and to provide PoDSI that can be called via an API endpoint. Aggregation of data always happens off-chain. This is typically hosted by the aggregator platform -1. An optional aggregation smart contract that clients can submit an on-chain request to, to request an off-chain aggregation node to make a storage deal - -Aggregation +2. An aggregator platform that clients can interact with to request to make a storage deal and retrieve Proof of Deal Sub-piece Inclusion (PoDSI) from. +3. An aggregation node to aggregate the sub-piece data into a larger file and to provide PoDSI that can be called via an API endpoint. Aggregation of data always happens off-chain. This is typically hosted by the aggregator platform +4. An optional aggregation smart contract that clients can submit an on-chain request to, to request an off-chain aggregation node to make a storage deal +![Aggregation](https://github.com/filecoin-project/filecoin-docs/assets/113331491/29d6cc11-680e-4aa1-9c3c-422cb12795c7) ## Proof of Deal Sub-piece Inclusion (PoDSI) @@ -31,42 +32,43 @@ PoDSI is a proof construction and is generated for each sub-piece CID (within th The proof consists of two elements: -1. An inclusion proof of a sub-tree, which contains the size and position of the sub-piece data in the larger aggregated data piece, corresponding to the tree of the aggregator's committed larger aggregated data piece. -1. An inclusion proof of the double leaf data segment descriptor, which describes the sub-piece data within the larger [data segment index](https://github.com/filecoin-project/go-data-segment), which is contained at the end of a deal, describing all the data segments contained within that deal. +1. An inclusion proof of a sub-tree, which contains the size and position of the sub-piece data in the larger aggregated data piece, corresponding to the tree of the aggregator's committed larger aggregated data piece. +2. An inclusion proof of the double leaf data segment descriptor, which describes the sub-piece data within the larger [data segment index](https://github.com/filecoin-project/go-data-segment), which is contained at the end of a deal, describing all the data segments contained within that deal. ### Requesting for aggregation off-chain To request for aggregation and PoDSI off-chain, developers interact with an aggregator platform: 1. The client submits sub-piece data to an aggregator platform. The aggregator prepares the data and generates the sub-piece CID, known as pCID, and URL to download the CAR file. -1. The aggregator hosts an off-chain aggregation node, which aggregates the sub-piece CAR files into a larger aggregated CAR file. -1. Simultaneously, the aggregator aggregates indexed data segments (based on specs [here](https://github.com/filecoin-project/FIPs/discussions/512)). It runs the proofing library and generates PoDSI proofs for each sub-piece pCID, storing them in an off-chain database. -1. The aggregator uses [programmatic deal-making](/smart-contracts/programmatic-storage/direct-deal-making) or [manual deal-making](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. -1. Storage Providers download the aggregated CAR file and publish storage deals. -1. Clients can query a proofing endpoint provided by the aggregator, which will look up the sub-piece CID (pCID) in the database and return the PoDSI proof, aggregated CID, and associated deal ID. -1. Clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. +2. The aggregator hosts an off-chain aggregation node, which aggregates the sub-piece CAR files into a larger aggregated CAR file. +3. Simultaneously, the aggregator aggregates indexed data segments (based on specs [here](https://github.com/filecoin-project/FIPs/discussions/512)). It runs the proofing library and generates PoDSI proofs for each sub-piece pCID, storing them in an off-chain database. +4. The aggregator uses [programmatic deal-making](../programmatic-storage/direct-deal-making/) or [manual deal-making](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. +5. Storage Providers download the aggregated CAR file and publish storage deals. +6. Clients can query a proofing endpoint provided by the aggregator, which will look up the sub-piece CID (pCID) in the database and return the PoDSI proof, aggregated CID, and associated deal ID. +7. Clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. [Lighthouse.storage](https://lighthouse.storage/) is the first aggregator platform available. You can find their [docs on how to utilize their SDK for the above process](https://docs.lighthouse.storage/). -Aggregation off-chain +![Aggregation off-chain](https://github.com/filecoin-project/filecoin-docs/assets/113331491/47691259-5665-43c7-bea6-79ed2b453f86) ### Requesting for aggregation on-chain On-chain aggregation and PoDSI requests go through aggregator oracle smart contracts: -1. The client [prepares the data](/storage-providers/filecoin-deals/storage-deals#data-preparation) and generates the sub-piece CID, known as pCID (CommPc). Here is an easy [data preparation tool](https://data.lighthouse.storage/) by [lighthouse.storage](https://lighthouse.storage). -1. The client submits a sub-piece CID (CommPc) with metadata (e.g. URL to download the sub-piece CAR file) directly to the aggregation smart contract. -1. The aggregator watches the aggregation contract, and when the aggregator decides there are enough sub-pieces, it downloads all sub-piece data, to generate the aggregated piece from the CAR file URL. -1. The aggregator aggregates indexed data segments into a larger data file for deal-making (based on specs [here](https://github.com/filecoin-project/FIPs/discussions/512)). -1. The aggregator combines the sub-piece data into the aggregated CommP (CommPa) by computing within aggregator's off-chain node. -1. The aggregator uses [programmatic deal-making](/smart-contracts/programmatic-storage/direct-deal-making) or [manual deal-making](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. -1. Storage Providers download the aggregated CAR file and publish storage deals. Upon the client's request, they can find the data via sub-piece CID. -1. Clients can query the aggregation smart contract, which notifies the aggregator platform to look up the sub-piece CID (pCID) in its aggregation node's database and return the PoDSI proof, aggregated CID, and associated deal ID. -1. Simultaneously, clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. +1. The client [prepares the data](../../storage-providers/filecoin-deals/storage-deals/#data-preparation) and generates the sub-piece CID, known as pCID (CommPc). Here is an easy [data preparation tool](https://data.lighthouse.storage/) by [lighthouse.storage](https://lighthouse.storage). +2. The client submits a sub-piece CID (CommPc) with metadata (e.g. URL to download the sub-piece CAR file) directly to the aggregation smart contract. +3. The aggregator watches the aggregation contract, and when the aggregator decides there are enough sub-pieces, it downloads all sub-piece data, to generate the aggregated piece from the CAR file URL. +4. The aggregator aggregates indexed data segments into a larger data file for deal-making (based on specs [here](https://github.com/filecoin-project/FIPs/discussions/512)). +5. The aggregator combines the sub-piece data into the aggregated CommP (CommPa) by computing within aggregator's off-chain node. +6. The aggregator uses [programmatic deal-making](../programmatic-storage/direct-deal-making/) or [manual deal-making](https://lotus.filecoin.io/tutorials/lotus/build-with-lotus-api/) to make storage deals with storage providers for the aggregated larger CAR file. +7. Storage Providers download the aggregated CAR file and publish storage deals. Upon the client's request, they can find the data via sub-piece CID. +8. Clients can query the aggregation smart contract, which notifies the aggregator platform to look up the sub-piece CID (pCID) in its aggregation node's database and return the PoDSI proof, aggregated CID, and associated deal ID. +9. Simultaneously, clients can use the sub-piece pCID for on-chain verification with the aggregation smart contract, which will verify the Merkle proof to ensure the sub-piece pCID (CommPc) matches the piece CID (CommPa) of the associated deal ID. -Aggregation on-chain +![Aggregation on-chain](https://github.com/filecoin-project/filecoin-docs/assets/113331491/3588073e-a98e-4245-8a85-a087f4e403d2) To build your own on-chain aggregator oracle smart contract, check out one of the implementations with [Filecoin Data Tools](https://github.com/application-research/fevm-data-segment). +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/aggregated-deal-making) diff --git a/smart-contracts/advanced/cross-chain-bridges.md b/smart-contracts/advanced/cross-chain-bridges.md index a8973078f..5437ce294 100644 --- a/smart-contracts/advanced/cross-chain-bridges.md +++ b/smart-contracts/advanced/cross-chain-bridges.md @@ -51,13 +51,17 @@ Celar’s CBridge supports both Filecoin Mainnet and Calibration testnet. | Name | Mainnet | Calibration | | ---------- | -------------------------------------------- | -------------------------------------------- | | wFIL | `0x60E1773636CF5E4A227d9AC24F20fEca034ee25A` | | -| ceUSDC | `0x2421db204968A367CC2C866CD057fA754Cb84EdF` | `0xf5C6825015280CdfD0b56903F9F8B5A2233476F5` | -| ceUSDT | `0x422849b355039bc58f2780cc4854919fc9cfaf94` | `0x7d43AABC515C356145049227CeE54B608342c0ad` | -| ceWBTC | `0x592786e04c47844aa3b343b19ef2f50a255a477f` | `0x265B25e22bcd7f10a5bD6E6410F10537Cc7567e8` | -| ceWETH | `0x522b61755b5ff8176b2931da7bf1a5f9414eb710` | `0x5471ea8f739dd37E9B81Be9c5c77754D8AA953E4` | +| ceUSDC | `0x2421db204968A367CC2C866CD057fA754Cb84EdF` | `0xf5C6825015280CdfD0b56903F9F8B5A2233476F5` | +| ceUSDT | `0x422849b355039bc58f2780cc4854919fc9cfaf94` | `0x7d43AABC515C356145049227CeE54B608342c0ad` | +| ceWBTC | `0x592786e04c47844aa3b343b19ef2f50a255a477f` | `0x265B25e22bcd7f10a5bD6E6410F10537Cc7567e8` | +| ceWETH | `0x522b61755b5ff8176b2931da7bf1a5f9414eb710` | `0x5471ea8f739dd37E9B81Be9c5c77754D8AA953E4` | | MessageBus | `0x6ff2130fbdd2837b0c92d7f56f6c017642d84f66` | `0xd5818D039A702DdccfD11A900A40B3dc6DA03CEc` | ### **Further Celer resources** * [cBridge docs](https://cbridge-docs.celer.network/) * [Celer IM Docs](https://im-docs.celer.network/developer/celer-im-overview) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/cross-chain-bridges) diff --git a/smart-contracts/advanced/multicall.md b/smart-contracts/advanced/multicall.md index 6d02cea3e..d3a4b5abf 100644 --- a/smart-contracts/advanced/multicall.md +++ b/smart-contracts/advanced/multicall.md @@ -1,38 +1,43 @@ --- description: >- - Multicall allows you to aggregate multiple contract reads into a single JSON-RPC request, and execute multiple state-changing calls in a single transaction on the FVM. + Multicall allows you to aggregate multiple contract reads into a single + JSON-RPC request, and execute multiple state-changing calls in a single + transaction on the FVM. --- -# Multicall3 +# Multicall -[Multicall3](https://www.multicall3.com/) is a powerful tool that offers batch contract calls to smart contracts on the Filecoin Virtual Machine (FVM). +## Multicall3 -Multicall3 is deployed on over 100 chains at `0xcA11bde05977b3631167028862bE2a173976CA11`. -A sortable, searchable list of all chains it's deployed on can be found [here](https://multicall3.com/deployments). +[Multicall3](https://www.multicall3.com/) is a powerful tool that offers batch contract calls to smart contracts on the Filecoin Virtual Machine (FVM). + +Multicall3 is deployed on over 100 chains at `0xcA11bde05977b3631167028862bE2a173976CA11`. A sortable, searchable list of all chains it's deployed on can be found [here](https://multicall3.com/deployments). The [multicall3 ABI](https://multicall3.com/abi) can be downloaded or copied to the clipboard in various formats, including: -- Solidity interface. -- JSON ABI, prettified. -- JSON ABI, minified. -- [ethers.js](https://docs.ethers.org/v5/) human readable ABI. -- [viem](https://viem.sh/) human readable ABI. +* Solidity interface. +* JSON ABI, prettified. +* JSON ABI, minified. +* [ethers.js](https://docs.ethers.org/v5/) human readable ABI. +* [viem](https://viem.sh/) human readable ABI. Alternatively, you can: -- Download the ABI from the [releases](https://github.com/mds1/multicall/releases) page. -- Copy the ABI from [Etherscan](https://etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code). -- Install [Foundry](https://github.com/gakonst/foundry/) and run `cast interface 0xcA11bde05977b3631167028862bE2a173976CA11`. +* Download the ABI from the [releases](https://github.com/mds1/multicall/releases) page. +* Copy the ABI from [Etherscan](https://etherscan.io/address/0xcA11bde05977b3631167028862bE2a173976CA11#code). +* Install [Foundry](https://github.com/gakonst/foundry/) and run `cast interface 0xcA11bde05977b3631167028862bE2a173976CA11`. + +### Contract address + +Multicall has the same, precomputed address for all of the networks it is deployed on. -## Contract address +| Name | Address | Mainnet | Calibration | +| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------- | ----------- | +| [Multicall - Mainnet](https://filfox.info/en/address/0xcA11bde05977b3631167028862bE2a173976CA11?t=3) | `0xcA11bde05977b3631167028862bE2a173976CA11` | ✔️ | ❌ | +| [Multicall - Calibration](https://calibration.filscan.io/en/address/0xcA11bde05977b3631167028862bE2a173976CA11/) | `0xcA11bde05977b3631167028862bE2a173976CA11` | ❌ | ✔️ | -Multicall has the same, precomputed address for all of the networks it is deployed on. -| Name | Address | Mainnet | Calibration | -| ---------------- | -------------------------------------------- | ------- | ----------- | -| [Multicall - Mainnet](https://filfox.info/en/address/0xcA11bde05977b3631167028862bE2a173976CA11?t=3) | `0xcA11bde05977b3631167028862bE2a173976CA11` | ✔️ | ❌ | -| [Multicall - Calibration](https://calibration.filscan.io/en/address/0xcA11bde05977b3631167028862bE2a173976CA11/) | `0xcA11bde05977b3631167028862bE2a173976CA11` | ❌ | ✔️ | +### Usage -## Usage To use Multicall3 to send batch contract read/write to your smart contract, you will need to: 1. Obtain the Multicall3 contract address for the network you're using (Filecoin mainnet or Calibration testnet). @@ -49,73 +54,66 @@ The steps above differ slightly for integrations using smart contracts, where st Many libraries and tools such as [ethers-rs](https://docs.rs/ethers/latest/ethers/), [viem](https://viem.sh/), and [ape](https://apeworx.io/) have native Multicall3 integration which can be used in your projects directly. To learn how to use Multicall3 with these tools, check out [Multicall3 examples folder](https://github.com/mds1/multicall/blob/main/examples) -### Batching Contract Reads +#### Batching Contract Reads + Batching contract reads, one of the most common use cases, allows a single `eth_call` JSON RPC request to return the results of multiple contract function calls. It has many benefits: 1. **Reduced JSON RPC Requests**: Multicall reduces the number of separate JSON RPC requests that need to be sent. This is particularly useful when using remote nodes, such as GLIF. By aggregating multiple contract reads into a single JSON-RPC request, Multicall (1) reduces RPC usage and therefore costs, and (2) reduces the number of round trips between the client and the node, which can significantly improve performance - 2. **Consistent Data from the Same Block**: Multicall guarantees that all values returned are from the same block. This ensures data consistency and reliability, as all the read operations are performed on the same state of the blockchain. - 3. **Detection of Stale Data**: Multicall enables the block number or timestamp to be returned with the read data. This feature helps in detecting stale data, as developers can compare the block number or timestamp with the current state of the blockchain to ensure the data is up-to-date. - When directly interacting with the Multicall3 contract to batch calls, you'll typically use the `aggregate3` method. This method allows you to execute multiple contract calls in a single transaction. Here's an explanation of how it works, along with examples: -1. Solidity Implementation: - The `aggregate3` method is implemented in the Multicall3 contract like this: - - ```solidity - function aggregate3(Call3[] calldata calls) public payable returns (Result[] memory returnData) { - uint256 length = calls.length; - returnData = new Result[](length); - for (uint256 i = 0; i < length;) { - (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData); - if (calls[i].allowFailure) { - returnData[i] = Result(success, ret); - } else { - require(success, "Multicall3: call failed"); - returnData[i] = Result(true, ret); - } - unchecked { ++i; } - } - } - ``` - -2. Example of sending multicalls to this smart contract: - Here's an example using ethers.js to interact with the Multicall3 contract: - - ```javascript - const { ethers } = require("ethers"); - - const provider = new ethers.providers.JsonRpcProvider("https://api.node.glif.io/rpc/v1"); - const multicallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11"; - const multicallAbi = [/* Multicall3 ABI */]; - const multicall = new ethers.Contract(multicallAddress, multicallAbi, provider); - - // Example: Batch balance checks for multiple addresses - async function batchBalanceChecks(addresses) { - const calls = addresses.map(address => ({ - target: "0x...", // ERC20 token address - allowFailure: false, - callData: ethers.utils.id("balanceOf(address)").slice(0, 10) + - ethers.utils.defaultAbiCoder.encode(["address"], [address]).slice(2) - })); - - const results = await multicall.aggregate3(calls); - return results.map(result => ethers.utils.defaultAbiCoder.decode(["uint256"], result.returnData)[0]); - } - - batchBalanceChecks(["0x123...", "0x456...", "0x789..."]).then(console.log); - ``` +1. Solidity Implementation: The `aggregate3` method is implemented in the Multicall3 contract like this: + + ```solidity + function aggregate3(Call3[] calldata calls) public payable returns (Result[] memory returnData) { + uint256 length = calls.length; + returnData = new Result[](length); + for (uint256 i = 0; i < length;) { + (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData); + if (calls[i].allowFailure) { + returnData[i] = Result(success, ret); + } else { + require(success, "Multicall3: call failed"); + returnData[i] = Result(true, ret); + } + unchecked { ++i; } + } + } + ``` +2. Example of sending multicalls to this smart contract: Here's an example using ethers.js to interact with the Multicall3 contract: + + ```javascript + const { ethers } = require("ethers"); + + const provider = new ethers.providers.JsonRpcProvider("https://api.node.glif.io/rpc/v1"); + const multicallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11"; + const multicallAbi = [/* Multicall3 ABI */]; + const multicall = new ethers.Contract(multicallAddress, multicallAbi, provider); + + // Example: Batch balance checks for multiple addresses + async function batchBalanceChecks(addresses) { + const calls = addresses.map(address => ({ + target: "0x...", // ERC20 token address + allowFailure: false, + callData: ethers.utils.id("balanceOf(address)").slice(0, 10) + + ethers.utils.defaultAbiCoder.encode(["address"], [address]).slice(2) + })); + + const results = await multicall.aggregate3(calls); + return results.map(result => ethers.utils.defaultAbiCoder.decode(["uint256"], result.returnData)[0]); + } + + batchBalanceChecks(["0x123...", "0x456...", "0x789..."]).then(console.log); + ``` This example demonstrates how to use Multicall3 to batch multiple `balanceOf` calls for an ERC20 token in a single transaction, significantly reducing the number of separate RPC calls needed. -### Batch Contract Writes - +#### Batch Contract Writes > :warning: Multicall3, while unaudited, can be safely used for batching on-chain writes when used correctly. As a stateless contract, it should never hold funds after a transaction ends, and users should never approve it to spend tokens. - When using Multicall3, it's crucial to understand two key aspects: the behavior of `msg.sender` in calls versus delegatecalls, and the risks associated with `msg.value` in multicalls. In FVM, there are two types of accounts: Externally Owned Accounts (EOAs) controlled by private keys, and Contract Accounts controlled by code. The `msg.sender` value during contract execution depends on whether a CALL or DELEGATECALL opcode is used. CALL changes the execution context, while DELEGATECALL preserves it. @@ -124,7 +122,10 @@ For EOAs, which can only use CALL, Multicall3's address becomes the `msg.sender` The handling of `msg.value` in multicalls requires caution. Since `msg.value` doesn't change with delegatecalls, relying on it within a multicall can lead to security vulnerabilities. To learn more about this, see [here](https://github.com/runtimeverification/verified-smart-contracts/wiki/List-of-Security-Vulnerabilities#payable-multicall) and [here](https://samczsun.com/two-rights-might-make-a-wrong/). -# Hints +## Hints Lotus FEVM RPC supports Ethereum batch transactions. The key difference between `multicall` and batch transactions is that `multicall` aggregates multiple RPC requests into a single call, while batch transactions are simply an array of transactions executed sequentially but sent in one request. For more details, please refer to the [Ethereum documentation](https://geth.ethereum.org/docs/interacting-with-geth/rpc/batch). + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/multicall) diff --git a/smart-contracts/advanced/multisig.md b/smart-contracts/advanced/multisig.md index 7418cb935..9245e0e66 100644 --- a/smart-contracts/advanced/multisig.md +++ b/smart-contracts/advanced/multisig.md @@ -1,9 +1,10 @@ --- description: >- - Multisig wallets enhance security and decentralization by requiring multiple signatures for transactions, distributing control among multiple participants. + Multisig wallets enhance security and decentralization by requiring multiple + signatures for transactions, distributing control among multiple participants. --- -# Multisig Wallets +# Multisig In the Filecoin network, multisig wallets allow multiple parties to jointly manage a wallet by requiring a predefined number of signatures (approvals) for a transaction to be executed. This enhances security and decentralization by distributing control among multiple participants. @@ -29,21 +30,25 @@ Safe is a popular smart account infrastructure provider that allows users to man Gnosis Safe’s smart contracts are live on the Filecoin Mainnet and Calibration testnet. -| Name | Address | Mainnet | Calibration | -| -------------------------------- | -------------------------------------------- | ------- | ----------- | -| [SimulateTxAccessor](https://filecoin.blockscout.com/address/0x3d4BA2E0884aa488718476ca2FB8Efc291A46199) | `0x3d4BA2E0884aa488718476ca2FB8Efc291A46199` | ✔️ | ✔️ | -| [SafeProxyFactory](https://filecoin.blockscout.com/address/0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67) | `0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67` | ✔️ | ✔️ | -| [TokenCallbackHandler](https://filecoin.blockscout.com/address/0xeDCF620325E82e3B9836eaaeFdc4283E99Dd7562) | `0xeDCF620325E82e3B9836eaaeFdc4283E99Dd7562` | ✔️ | ✔️ | -| [CompatibilityFallbackHandler](https://filecoin.blockscout.com/address/0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99) | `0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99` | ✔️ | ✔️ | -| [CreateCall](https://filecoin.blockscout.com/address/0x9b35Af71d77eaf8d7e40252370304687390A1A52) | `0x9b35Af71d77eaf8d7e40252370304687390A1A52` | ✔️ | ✔️ | -| [MultiSend](https://filecoin.blockscout.com/address/0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526) | `0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526` | ✔️ | ✔️ | -| [MultiSendCallOnly](https://filecoin.blockscout.com/address/0x9641d764fc13c8B624c04430C7356C1C7C8102e2) | `0x9641d764fc13c8B624c04430C7356C1C7C8102e2` | ✔️ | ✔️ | -| [SignMessageLib](https://filecoin.blockscout.com/address/0xd53cd0aB83D845Ac265BE939c57F53AD838012c9) | `0xd53cd0aB83D845Ac265BE939c57F53AD838012c9` | ✔️ | ✔️ | -| [SafeL2](https://filecoin.blockscout.com/address/0x29fcB43b46531BcA003ddC8FCB67FFE91900C762) | `0x29fcB43b46531BcA003ddC8FCB67FFE91900C762` | ✔️ | ✔️ | -| [Safe](https://filecoin.blockscout.com/address/0x41675C099F32341bf84BFc5382aF534df5C7461a) | `0x41675C099F32341bf84BFc5382aF534df5C7461a` | ✔️ | ✔️ | +| Name | Address | Mainnet | Calibration | +| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- | ------- | ----------- | +| [SimulateTxAccessor](https://filecoin.blockscout.com/address/0x3d4BA2E0884aa488718476ca2FB8Efc291A46199) | `0x3d4BA2E0884aa488718476ca2FB8Efc291A46199` | ✔️ | ✔️ | +| [SafeProxyFactory](https://filecoin.blockscout.com/address/0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67) | `0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67` | ✔️ | ✔️ | +| [TokenCallbackHandler](https://filecoin.blockscout.com/address/0xeDCF620325E82e3B9836eaaeFdc4283E99Dd7562) | `0xeDCF620325E82e3B9836eaaeFdc4283E99Dd7562` | ✔️ | ✔️ | +| [CompatibilityFallbackHandler](https://filecoin.blockscout.com/address/0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99) | `0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99` | ✔️ | ✔️ | +| [CreateCall](https://filecoin.blockscout.com/address/0x9b35Af71d77eaf8d7e40252370304687390A1A52) | `0x9b35Af71d77eaf8d7e40252370304687390A1A52` | ✔️ | ✔️ | +| [MultiSend](https://filecoin.blockscout.com/address/0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526) | `0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526` | ✔️ | ✔️ | +| [MultiSendCallOnly](https://filecoin.blockscout.com/address/0x9641d764fc13c8B624c04430C7356C1C7C8102e2) | `0x9641d764fc13c8B624c04430C7356C1C7C8102e2` | ✔️ | ✔️ | +| [SignMessageLib](https://filecoin.blockscout.com/address/0xd53cd0aB83D845Ac265BE939c57F53AD838012c9) | `0xd53cd0aB83D845Ac265BE939c57F53AD838012c9` | ✔️ | ✔️ | +| [SafeL2](https://filecoin.blockscout.com/address/0x29fcB43b46531BcA003ddC8FCB67FFE91900C762) | `0x29fcB43b46531BcA003ddC8FCB67FFE91900C762` | ✔️ | ✔️ | +| [Safe](https://filecoin.blockscout.com/address/0x41675C099F32341bf84BFc5382aF534df5C7461a) | `0x41675C099F32341bf84BFc5382aF534df5C7461a` | ✔️ | ✔️ | #### **Further Gnosis Safe resources** * [Safe Smart Account Docs](https://docs.safe.global/advanced/smart-account-overview) * [Create Your Own Multisig via. the Safe CLI](https://docs.safe.global/advanced/cli-overview) -* [Safe - Deploy a Recovery Safe Example](https://docs.safe.global/advanced/cli-guides/recovery-safe-deployment) \ No newline at end of file +* [Safe - Deploy a Recovery Safe Example](https://docs.safe.global/advanced/cli-guides/recovery-safe-deployment) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/multisig) diff --git a/smart-contracts/advanced/oracles.md b/smart-contracts/advanced/oracles.md index 1fb7d9f2e..80d6a2940 100644 --- a/smart-contracts/advanced/oracles.md +++ b/smart-contracts/advanced/oracles.md @@ -13,9 +13,9 @@ Oracles are an essential component of many blockchain applications, as they enab Oracles enable builders to integrate the following features into their projects: -- **Price feeds**: DeFi protocols like cross-chain lending rely on oracles for various token or token pair prices. -- **Cross-chain storage deal verification**: enable applications running on any blockchains to use the Filecoin decentralized storage and allow them to verify deal status and proofs. -- **Perpetual storage**: enable automated deal renewal and repair with the oracle providing deal status off-chain. +* **Price feeds**: DeFi protocols like cross-chain lending rely on oracles for various token or token pair prices. +* **Cross-chain storage deal verification**: enable applications running on any blockchains to use the Filecoin decentralized storage and allow them to verify deal status and proofs. +* **Perpetual storage**: enable automated deal renewal and repair with the oracle providing deal status off-chain. ## Available oracles @@ -42,9 +42,9 @@ Price Feed IDs for FIL are also available on various chains. These can be found #### **Further Pyth resources** -- [Pyth docs](https://docs.pyth.network/) -- [Pyth - Best Practices](https://docs.pyth.network/price-feeds/best-practices) -- [Pyth Benchmarks - historical price feeds](https://docs.pyth.network/benchmarks) +* [Pyth docs](https://docs.pyth.network/) +* [Pyth - Best Practices](https://docs.pyth.network/price-feeds/best-practices) +* [Pyth Benchmarks - historical price feeds](https://docs.pyth.network/benchmarks) ### [Tellor](https://tellor.io/) @@ -69,9 +69,9 @@ Tellor’s smart contracts are live on the Filecoin Mainnet and Calibration test #### **Further Tellor resources** -- [Tellor docs](https://docs.tellor.io/) -- [Filecoin Storage Insurance Contract](https://github.com/tellor-io/filecoin-query-insurance-impl/tree/main) -- [Getting Tellor Data for any use case](https://www.youtube.com/watch?v=AQIDqTLguyI) - FVM Dataverse Hackathon +* [Tellor docs](https://docs.tellor.io/) +* [Filecoin Storage Insurance Contract](https://github.com/tellor-io/filecoin-query-insurance-impl/tree/main) +* [Getting Tellor Data for any use case](https://www.youtube.com/watch?v=AQIDqTLguyI) - FVM Dataverse Hackathon ### [eOracle](https://www.eoracle.io/) @@ -100,6 +100,10 @@ eOracle's smart contracts are live on the Filecoin Calibration testnet. #### **Further eOracle resources** -- [eOracle docs](https://eoracle.gitbook.io/eoracle) -- [eOracle GitHub](https://github.com/eoracle) -- [eOracle Price Feed Integration Guide](https://eoracle.gitbook.io/eoracle/price-feeds/integration-guide) +* [eOracle docs](https://eoracle.gitbook.io/eoracle) +* [eOracle GitHub](https://github.com/eoracle) +* [eOracle Price Feed Integration Guide](https://eoracle.gitbook.io/eoracle/price-feeds/integration-guide) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/oracles) diff --git a/smart-contracts/advanced/wrapped-fil.md b/smart-contracts/advanced/wrapped-fil.md index 3670aa107..a6c439fe5 100644 --- a/smart-contracts/advanced/wrapped-fil.md +++ b/smart-contracts/advanced/wrapped-fil.md @@ -81,3 +81,7 @@ function withdraw(uint _amount) public virtual { ``` This process will burn the amount of wFIL from the caller’s balance and transfer the unwrapped FIL 1:1 back to the caller’s address. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/advanced/wrapped-fil) diff --git a/smart-contracts/developing-contracts/README.md b/smart-contracts/developing-contracts/README.md index 1f7f022e0..31f1b47e2 100644 --- a/smart-contracts/developing-contracts/README.md +++ b/smart-contracts/developing-contracts/README.md @@ -6,3 +6,4 @@ description: >- # Developing contracts +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts) diff --git a/smart-contracts/developing-contracts/best-practices.md b/smart-contracts/developing-contracts/best-practices.md index 33669ce2f..e334aa58f 100644 --- a/smart-contracts/developing-contracts/best-practices.md +++ b/smart-contracts/developing-contracts/best-practices.md @@ -96,3 +96,7 @@ Developers can easily do so through the following block explorers: * [Beryx contract verifier](https://beryx.zondax.ch/contract\_verifier) You can find this tutorial in the [FEVM ERC-20 Quickstart](../fundamentals/erc-20-quickstart.md). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/best-practices) diff --git a/smart-contracts/developing-contracts/call-built-in-actors.md b/smart-contracts/developing-contracts/call-built-in-actors.md index 966574754..345f99dc2 100644 --- a/smart-contracts/developing-contracts/call-built-in-actors.md +++ b/smart-contracts/developing-contracts/call-built-in-actors.md @@ -253,3 +253,7 @@ cd libs ### Call a built-in actor Once you’ve either imported particular contracts manually or simply installed `filecoin.sol` using npm, create a callable method to access the built-in actor methods the way you normally would in a Solidity smart contract. Working examples of smart contracts that call built-in actor methods are available in the [reference guide](call-built-in-actors.md#filecoin.sol). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/call-built-in-actors) diff --git a/smart-contracts/developing-contracts/client-contract-tutorial.md b/smart-contracts/developing-contracts/client-contract-tutorial.md index 3a477ac0f..e6b70bf09 100644 --- a/smart-contracts/developing-contracts/client-contract-tutorial.md +++ b/smart-contracts/developing-contracts/client-contract-tutorial.md @@ -1,9 +1,11 @@ --- description: >- - This page covers the client contract, and includes a tutorial on how developers can use the client contract to create storage deals programmatically. + This page covers the client contract, and includes a tutorial on how + developers can use the client contract to create storage deals + programmatically. --- -# Client contract tutorial +# Direct deal-making with Client contract In this tutorial we will cover the background of creating storage deals using smart contracts, and how to create storage deals with smart contracts on the [Filecoin virtual machine](../../reference/general/glossary.md#filecoin-virtual-machine). @@ -13,11 +15,11 @@ You can find a video form of this walkthrough on [ETHGlobal’s YouTube Channel] Before continuing, make sure you have the following software installed and prerequisites ready: -- Git -- NodeJS -- Yarn or NPM (Yarn is used in this tutorial) -- A code editor such as VS Code -- A wallet with Calibration testnet FIL +* Git +* NodeJS +* Yarn or NPM (Yarn is used in this tutorial) +* A code editor such as VS Code +* A wallet with Calibration testnet FIL ## Steps @@ -34,21 +36,18 @@ First, let’s grab the kit and set up the development environment. ``` This will copy the FVM deal-making kit into your current directory and initiate the `go-generate-car` submodule. - 2. Move into the `fvm-starter-kit-deal-making` directory and grab all the dependencies using `yarn`: ```shell cd fvm-starter-kit-deal-making yarn ``` - 3. Now that all the packages are downloaded, you need to create a `.env` file with your private key. This is so the Hardhat kit knows what wallet to use for transactions. Open up the repo in your code editor of choice and find the file titled `.env.example`. Rename the file to `.env`. You can do this in your terminal by running: ```shell mv .env.example .env ``` - -4. Within the `.env` file, replace the example private key with your actual private key. If you are using Metamask, follow [this tutorial to get your private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). +4. Within the `.env` file, replace the example private key with your actual private key. If you are using Metamask, follow [this tutorial to get your private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). {% hint style="info" %} Take precautions and never share your private key with anyone! Also make sure to not check your private key into Git. The `.gitignore` of the Hardhat kit is already set to ignore `.env` files. @@ -68,27 +67,27 @@ Before storing a file with a storage provider it needs to be prepared by turning 1. Go to the [FVM Data Depot website](https://data.lighthouse.storage/) and create an account. 2. Click **Upload File** and select a file you wish to upload. -3. Select the **File ID** of the file to read all the relevant metadata. Make a note of the: +3. Select the **File ID** of the file to read all the relevant metadata. Make a note of the: - - Piece CID - - Payload CID - - Car size - - Piece size - - URL + * Piece CID + * Payload CID + * Car size + * Piece size + * URL - We’ll use this information in the next step when invoking the `MakeDealProposal` method. + We’ll use this information in the next step when invoking the `MakeDealProposal` method. ### Invoke the `MakeDealProposal` method Now that we have the `.car` file prepared in the data depot, we can invoke the MakeDealProposal method on the smart contract we deployed earlier. To do this, we will run the `make-deal-proposal` task in Hardhat. There are quite a few parameters to include in this call: -- `contract`: the address of your deployed `ClientContract.sol`. -- `piece-cid: gathered from the previous step. -- `piece-size`: gathered from the previous step. -- `car-size`: gathered from the previous step. -- `start-epoch`: The block number you want the deal to begin on. It should be a block in the future. You can find the current block number on [Beryx](https://beryx.io/), making sure to select the correct network. -- `end-epoch`: The block number you want the deal to end on. It should be a block in the future and after the `Start-Epoch`. You can find the current block number on [FILFOX](http://47.109.105.51/en). -- `location-ref`: The location of where the storage provider can find the .car file. This is the `URL` from the previous step. +* `contract`: the address of your deployed `ClientContract.sol`. +* \`piece-cid: gathered from the previous step. +* `piece-size`: gathered from the previous step. +* `car-size`: gathered from the previous step. +* `start-epoch`: The block number you want the deal to begin on. It should be a block in the future. You can find the current block number on [Beryx](https://beryx.io/), making sure to select the correct network. +* `end-epoch`: The block number you want the deal to end on. It should be a block in the future and after the `Start-Epoch`. You can find the current block number on [FILFOX](http://47.109.105.51/en). +* `location-ref`: The location of where the storage provider can find the .car file. This is the `URL` from the previous step. When calling the `make-deal-proposal` task in Hardhat, your command will look something like this: @@ -124,3 +123,7 @@ After emitting an event and waiting for storage providers to accept your deal, y ## Conclusion During this tutorial, we have shown the significance of making deals using smart contracts and then walked through making a storage deal using the FVM deal-making kit and web3.storage. Developers can make use of this workflow to integrate decentralized storage on Filecoin with their smart contracts and decentralized applications. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/client-contract-tutorial) diff --git a/smart-contracts/developing-contracts/filecoin.sol.md b/smart-contracts/developing-contracts/filecoin.sol.md index dc765aa2a..80e57fefa 100644 --- a/smart-contracts/developing-contracts/filecoin.sol.md +++ b/smart-contracts/developing-contracts/filecoin.sol.md @@ -107,3 +107,7 @@ Check out these links to learn more about the Filecoin.sol library. * [Filecoin-Solidity GitHub](https://github.com/filecoin-project/filecoin-solidity) * [Built-In Actor APIs](../../reference/built-in-actors/filecoin.sol.md) * [FEVM-Hardhat-K](https://github.com/filecoin-project/FEVM-Hardhat-Kit/) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/filecoin.sol) diff --git a/smart-contracts/developing-contracts/foundry.md b/smart-contracts/developing-contracts/foundry.md index 07c3f7085..bafac2609 100644 --- a/smart-contracts/developing-contracts/foundry.md +++ b/smart-contracts/developing-contracts/foundry.md @@ -64,3 +64,7 @@ forge create --rpc-url https://api.calibration.node.glif.io/rpc/v1 --private-key 7. You can now interact with your contract using the contract address given by Foundry. Done! For more information, see the [Foundry book](https://book.getfoundry.sh/). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/foundry) diff --git a/smart-contracts/developing-contracts/get-test-tokens.md b/smart-contracts/developing-contracts/get-test-tokens.md index 8008b2ca2..fb553ccf4 100644 --- a/smart-contracts/developing-contracts/get-test-tokens.md +++ b/smart-contracts/developing-contracts/get-test-tokens.md @@ -13,15 +13,13 @@ MetaMask is one of the easier ways to manage addresses on the Calibration testne 1. In your browser, open MetaMask and copy your address to your clipboard. 2. Go to [faucet.calibnet.chainsafe-fil.io](https://faucet.calibnet.chainsafe-fil.io) and click **Send Funds**. -3. Paste your address into the address field and click **Send funds**: +3. Paste your address into the address field and click **Send funds**: ![The Calibration faucet website.](../../.gitbook/assets/smart-contracts-developing-contracts-get-test-tokens-send-funds.png) - -4. The webpage will give you a transaction ID: +4. The webpage will give you a transaction ID: ![A transaction ID returned by the Calibration faucet.](../../.gitbook/assets/smart-contracts-developing-contracts-get-test-tokens-id-returned.png) - -5. You can copy this ID into a block explorer to track the progress of your transaction: +5. You can copy this ID into a block explorer to track the progress of your transaction: ![A block explorer showing a pending transaction on the Calibration testnet.](../../.gitbook/assets/smart-contracts-developing-contracts-get-test-tokens-block-explorer.png) @@ -69,3 +67,7 @@ For example: ``` If you want to manage your local testnet tokens in MetaMask you will need to create a `t4` address. You can create a `t4` address using `lotus wallet new deleated`. Once you have a `t4` address you can [connect MetaMask to your local testnet](https://docs.filecoin.io/basics/assets/metamask-setup/) to see the new balance within the MetaMask extension. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/get-test-tokens) diff --git a/smart-contracts/developing-contracts/hardhat.md b/smart-contracts/developing-contracts/hardhat.md index b8d2328c9..277483652 100644 --- a/smart-contracts/developing-contracts/hardhat.md +++ b/smart-contracts/developing-contracts/hardhat.md @@ -110,3 +110,7 @@ yarn hardhat get-balance --contract '0xA855520fcCB6422976F7Ac78534edec2379Be5f6' ## Hardhat docs You can view the official Hardhat documentation over at [`hardhart.org/docs`](https://hardhat.org/docs). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/hardhat) diff --git a/smart-contracts/developing-contracts/remix.md b/smart-contracts/developing-contracts/remix.md index 078b12276..34c04503f 100644 --- a/smart-contracts/developing-contracts/remix.md +++ b/smart-contracts/developing-contracts/remix.md @@ -92,3 +92,7 @@ Remix uses a default of 2.5 nanoFIL per gas as a priority fee, which is usually 1. When the deployment transaction confirmation pop-up window shows up, click on **Site suggested**. 2. Switch to **Market**, **Aggressive**, or **Low**. The **Market** option is generally suitable for most situations. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/remix) diff --git a/smart-contracts/developing-contracts/solidity-libraries.md b/smart-contracts/developing-contracts/solidity-libraries.md index 8a889e367..ea35c8d0e 100644 --- a/smart-contracts/developing-contracts/solidity-libraries.md +++ b/smart-contracts/developing-contracts/solidity-libraries.md @@ -114,3 +114,7 @@ The 0x protocol library provides a set of secure smart contracts that facilitate * [Documentation](https://docs.0x.org/introduction/introduction-to-0x) * [GitHub](https://github.com/0xProject) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/solidity-libraries) diff --git a/smart-contracts/developing-contracts/using-raas.md b/smart-contracts/developing-contracts/using-raas.md index ad6c3558f..3ec53000c 100644 --- a/smart-contracts/developing-contracts/using-raas.md +++ b/smart-contracts/developing-contracts/using-raas.md @@ -69,3 +69,7 @@ async function initializeDealCreationListener() { To use this, call `yarn service` in the terminal and proceed through the frontend, as you normally would when uploading a file. Register the workers using the autocompleted CID that appears in the box. If you want to register the workers manually for a job that you didn't upload, paste in the known CID of your file into the box and register the jobs. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/using-raas) diff --git a/smart-contracts/developing-contracts/verify-a-contract.md b/smart-contracts/developing-contracts/verify-a-contract.md index 012dc2899..9758205e3 100644 --- a/smart-contracts/developing-contracts/verify-a-contract.md +++ b/smart-contracts/developing-contracts/verify-a-contract.md @@ -55,9 +55,11 @@ The following guide walks you through the process of contract verification using 13. Select your flattened `.sol` file. 14. Click **Verify and Publish**. -![](../../.gitbook/assets/smart-contracts-developing-contracts-verify-a-contract-verify-and -publish.jpg) +!\[]\(../../.gitbook/assets/smart-contracts-developing-contracts-verify-a-contract-verify-and -publish.jpg) - Success! Your contract is now verified. +``` +Success! Your contract is now verified. +``` ![](../../.gitbook/assets/smart-contracts-developing-contracts-verify-a-contract-success.jpg) @@ -66,8 +68,12 @@ The following guide walks you through the process of contract verification using ![](../../.gitbook/assets/smart-contracts-developing-contracts-verify-a-contract-contract-tab.jpg) - 2. Scroll down the contract page and select the **Contract** tab. +``` +2. Scroll down the contract page and select the **Contract** tab. - A **Contract Source Code Verified** banner is displayed, along with contract information and source code. You can also [view other verified contracts on Filfox](https://filfox.info/en/stats/verified-contracts). + A **Contract Source Code Verified** banner is displayed, along with contract information and source code. You can also [view other verified contracts on Filfox](https://filfox.info/en/stats/verified-contracts). +``` ![](../../.gitbook/assets/smart-contracts-developing-contracts-verify-a-contract-verified-contract-list.jpg) + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/developing-contracts/verify-a-contract) diff --git a/smart-contracts/filecoin-evm-runtime/README.md b/smart-contracts/filecoin-evm-runtime/README.md index af3876b1c..36af3edcc 100644 --- a/smart-contracts/filecoin-evm-runtime/README.md +++ b/smart-contracts/filecoin-evm-runtime/README.md @@ -6,3 +6,4 @@ description: >- # Filecoin EVM-runtime +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime) diff --git a/smart-contracts/filecoin-evm-runtime/actor-types.md b/smart-contracts/filecoin-evm-runtime/actor-types.md index 64174bb29..0a3e76dfa 100644 --- a/smart-contracts/filecoin-evm-runtime/actor-types.md +++ b/smart-contracts/filecoin-evm-runtime/actor-types.md @@ -52,3 +52,7 @@ An EVM smart contract may be called in one of three ways: 3. Finally, a native account can call method `3844450837` (`FRC42(InvokeEVM)`): 1. The input data should either be empty or encoded as a CBOR byte string. 2. The return data will either be empty or encoded as a CBOR byte string. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/actor-types) diff --git a/smart-contracts/filecoin-evm-runtime/address-types.md b/smart-contracts/filecoin-evm-runtime/address-types.md index 182d08188..279dd62b1 100644 --- a/smart-contracts/filecoin-evm-runtime/address-types.md +++ b/smart-contracts/filecoin-evm-runtime/address-types.md @@ -11,10 +11,10 @@ Filecoin has five address classes, and actors tend to have _multiple_ addresses. The goal of using different types of addresses is to provide a robust address format that is scalable, easy to use, and reliable. These addresses encode information including: -- Network prefix: indicates the network the actor belongs to. -- Protocol indicator: identify the type and version of this address. -- Payload: identify the actor according to the protocol. -- Checksum: validate the address. +* Network prefix: indicates the network the actor belongs to. +* Protocol indicator: identify the type and version of this address. +* Payload: identify the actor according to the protocol. +* Checksum: validate the address. Filecoin addresses can be represented either as raw bytes or a string. Raw bytes format will always be used on-chain. An address can also be encoded to a string, including a checksum and network prefix. The string format will never appear on-chain and is only for human-readable purposes. @@ -26,17 +26,17 @@ Filecoin address can be broken down like this: The network prefix is prepended to an address when encoding to a string. The network prefix indicates which network an address belongs to. Network prefixes never appear on-chain and are only used when encoding an address to a human-readable format. -- `f` - addresses on the Filecoin mainnet. -- `t` - addresses used on any Filecoin testnet. +* `f` - addresses on the Filecoin mainnet. +* `t` - addresses used on any Filecoin testnet. The protocol indicator identifies the address type, which describes how a method should interpret the information in the `payload` field of an address. -- `0`: An ID address. -- `1`: A wallet address generated from a secp256k public key. -- `2`: An actor address. -- `3`: A wallet address generated from BLS public key. -- `4`: A delegated address for user-defined foreign actors: - - `410`: Ethereum-compatible address space managed by the Ethereum address manager (EAM). Each 410 address is equivalent to an 0x address. +* `0`: An ID address. +* `1`: A wallet address generated from a secp256k public key. +* `2`: An actor address. +* `3`: A wallet address generated from BLS public key. +* `4`: A delegated address for user-defined foreign actors: + * `410`: Ethereum-compatible address space managed by the Ethereum address manager (EAM). Each 410 address is equivalent to an 0x address. Each address type is described below. @@ -70,8 +70,8 @@ Public key addresses allow devices, like hardware wallets, to derive a valid Fil Filecoin supports two types of public key addresses: -- [secp256k1 addresses](https://en.bitcoin.it/wiki/Secp256k1) that begin with the protocol indicator as `1`. -- [BLS addresses](https://en.wikipedia.org/wiki/BLS_digital_signature) that begin with the protocol indicator as `3`. +* [secp256k1 addresses](https://en.bitcoin.it/wiki/Secp256k1) that begin with the protocol indicator as `1`. +* [BLS addresses](https://en.wikipedia.org/wiki/BLS\_digital\_signature) that begin with the protocol indicator as `3`. `t1iandfn6d...ddboqxbhoeva` - a testnet wallet address generated using secp256k1. `t3vxj34sbdr3...road7cbygq` - a testnet wallet address generated using BLS. @@ -79,9 +79,9 @@ Filecoin supports two types of public key addresses: Filecoin supports extensible, user-defined actor addresses through the `4` address class, introduced in [Filecoin Improvement Proposal (FIP) 0048](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md). The `4` address class provides the following benefits to the network: -- Implement foreign addressing systems in Filecoin. -- A predictable addressing scheme to support interactions with addresses that do not yet exist on-chain. -- User-defined, programmable addressing systems without extensive changes and network upgrades. +* Implement foreign addressing systems in Filecoin. +* A predictable addressing scheme to support interactions with addresses that do not yet exist on-chain. +* User-defined, programmable addressing systems without extensive changes and network upgrades. For example, a testnet delegated address using the Ethereum Addressing System is structured as follows: @@ -145,16 +145,16 @@ The Filecoin EVM runtime introduces support for `0x` Ethereum-style addresses. F Addresses starting with `f0` can be converted to the `0x` format by: -- Extracting the `actor_id` (e.g., the `1234` in `f01234`). -- Hex encode with a `0xff` prefix: `sprintf("0xff0000000000000000000000%016x", actor_id)`. +* Extracting the `actor_id` (e.g., the `1234` in `f01234`). +* Hex encode with a `0xff` prefix: `sprintf("0xff0000000000000000000000%016x", actor_id)`. Addresses starting with `f410f` address can be converted to the `0x` format by: -- Removing the `f410f` prefix. -- Decoding the remainder as base 32 (RFC 4648 without padding). -- Trim off the last 4 bytes. This is a _checksum_ that can optionally be verified, but that’s beyond the scope of this documentation. -- Assert that the remaining address is 20 bytes long. -- Hex-encode: `sprintf(0x%040x", actor_id)`. +* Removing the `f410f` prefix. +* Decoding the remainder as base 32 (RFC 4648 without padding). +* Trim off the last 4 bytes. This is a _checksum_ that can optionally be verified, but that’s beyond the scope of this documentation. +* Assert that the remaining address is 20 bytes long. +* Hex-encode: `sprintf(0x%040x", actor_id)`. {% hint style="danger" %} `f0` addresses are **not** re-org stable and should not be used until the chain has settled. @@ -166,7 +166,11 @@ On the flip side, Ethereum-style addresses can be converted to a Filecoin addres Addresses starting with `0xff0000000000000000000000` can be converted to a Filecoin address by: -- Decoding the last 16 hex digits into a uint64 -- Format the address as `f0${decimal(id)}` where decimal(id) is the decimal representation of the decoded actor ID. +* Decoding the last 16 hex digits into a uint64 +* Format the address as `f0${decimal(id)}` where decimal(id) is the decimal representation of the decoded actor ID. Otherwise, it maps to f410f… + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/address-types) diff --git a/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md b/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md index 49b05bffe..a1a529583 100644 --- a/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md +++ b/smart-contracts/filecoin-evm-runtime/difference-with-ethereum.md @@ -60,3 +60,7 @@ However, the addresses returned by the CALLER, ORIGIN, and ADDRESS instructions ## Deferred execution model When calling an Ethereum method that allows the user to ask for the `latest` block, Filecoin will return the `chain head` - `1` block. This behavior was implemented for compatibility with the deferred execution mode that Filecoin uses. In this mode, messages submitted at a given `height` are only processed at `height` + `1`. This means that receipts for a block produced at `height` are only available at `height` + `1`. + + + +[Was this page helpful?](https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/difference-with-ethereum) diff --git a/smart-contracts/filecoin-evm-runtime/filforwarder.md b/smart-contracts/filecoin-evm-runtime/filforwarder.md index db991f432..74e33135f 100644 --- a/smart-contracts/filecoin-evm-runtime/filforwarder.md +++ b/smart-contracts/filecoin-evm-runtime/filforwarder.md @@ -108,7 +108,7 @@ Always be careful when dealing with your private key. Double-check that you’re #### **Invoke the contract** -The contract is deterministically deployed on all Filecoin networks at `0x2b3ef6906429b580b7b2080de5ca893bc282c225`. Any contract claiming to be a FilForwarder that does not reside at this address should not be trusted. Any dApp can connect to the wallet and use the ABI in this repository to call this method using any frontend. See the [Glif section](../../smart-contracts/filecoin-evm-runtime/filforwarder.md) above for steps on using a GUI. +The contract is deterministically deployed on all Filecoin networks at `0x2b3ef6906429b580b7b2080de5ca893bc282c225`. Any contract claiming to be a FilForwarder that does not reside at this address should not be trusted. Any dApp can connect to the wallet and use the ABI in this repository to call this method using any frontend. See the [Glif section](filforwarder.md) above for steps on using a GUI. Inside this repository is a Hardhat task called `forward`. This task will use the private key to send funds using the contract. This task uses the `fil-forwarder-{CHAIN_ID}.json` file to determine the deployed contract address for a given network. These addresses should always be the same, but these files prevent you from having to specify it each time. @@ -144,3 +144,7 @@ yarn hardhat forward \ --destination t010135 \ --amount 42.5 ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/filforwarder) diff --git a/smart-contracts/filecoin-evm-runtime/how-gas-works.md b/smart-contracts/filecoin-evm-runtime/how-gas-works.md index 28a1e2c5f..78009c876 100644 --- a/smart-contracts/filecoin-evm-runtime/how-gas-works.md +++ b/smart-contracts/filecoin-evm-runtime/how-gas-works.md @@ -110,3 +110,7 @@ echo $((16#31157)) * [FIP 0037](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0037.md) * [FIP 0054](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0054.md) * [Primitive Gas Price list](https://github.com/filecoin-project/ref-fvm/blob/master/fvm/src/gas/price\_list.rs) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/how-gas-works) diff --git a/smart-contracts/filecoin-evm-runtime/precompiles.md b/smart-contracts/filecoin-evm-runtime/precompiles.md index 1a2dc8c07..2c0b98f1a 100644 --- a/smart-contracts/filecoin-evm-runtime/precompiles.md +++ b/smart-contracts/filecoin-evm-runtime/precompiles.md @@ -120,3 +120,7 @@ Example: (bool success, bytes memory data) = address(0xfe00000000000000000000000000000000000005).delegatecall(abi.encode(method, value, flags, codec, params, id)); (int256 exit, uint64 return_codec, bytes memory return_value) = abi.deco ``` + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/filecoin-evm-runtime/precompiles) diff --git a/smart-contracts/fundamentals/README.md b/smart-contracts/fundamentals/README.md index 71c21faa1..4d6e49bcc 100644 --- a/smart-contracts/fundamentals/README.md +++ b/smart-contracts/fundamentals/README.md @@ -45,8 +45,8 @@ Let’s get building. Choose one of the following APIs. These are all storage he Examples: * [Polygon tutorial](https://github.com/protocol/nft-website/blob/main/docs/tutorial/mint-nftstorage-polygon.md) -* [Flow tutorial](https://github.com/protocol/nft-website/blob/main/docs/tutorial/flow-nft-marketplace.md) -* [Avalanche tutorial](https://github.com/protocol/nft-website/blob/main/docs/tutorial/avax-nft.md) +* [Flow tutorial](https://github.com/protocol/nft-website/blob/main/docs/tutorial/flow-nft-marketplace.md) +* [Avalanche tutorial](https://github.com/protocol/nft-website/blob/main/docs/tutorial/avax-nft.md) * [Using IPFS & Filecoin on Harmony](https://docs.harmony.one/home/developers/tutorials/ipfs-filecoin) ## Additional resources @@ -57,3 +57,7 @@ Examples: * [Developing on Filecoin](https://www.youtube.com/watch?v=aGCpq0Xf-w8) (video) * Textile tools: [video](https://www.youtube.com/watch?v=IZ8M9m9\_uJY) and [documentation](https://docs.textile.io/) * [Building decentralized apps using Fleek’s Space daemon](https://www.youtube.com/watch?v=pWJ5fty-7mA) (video) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals) diff --git a/smart-contracts/fundamentals/erc-20-quickstart.md b/smart-contracts/fundamentals/erc-20-quickstart.md index 66784ac70..186b97ae1 100644 --- a/smart-contracts/fundamentals/erc-20-quickstart.md +++ b/smart-contracts/fundamentals/erc-20-quickstart.md @@ -79,7 +79,7 @@ The development environment we’re going to be using is called Remix, viewable In Remix, workspaces are where you can create a contract, or group of contracts, for each project. Let’s create a new workspace to create our new ERC-20 token. 1. Open [remix.ethereum.org](https://remix.ethereum.org). -2. Open the dropdown menu and click **create a new workspace**. +2. Open the dropdown menu and click **create a new workspace**. ![Create a new workspace.](../../.gitbook/assets/smart-contracts-fundamentals-erc-20-quickstart-remix-dropdown.webp) 3. In the **Choose a template** dropdown, select **ERC20**. @@ -92,6 +92,7 @@ In Remix, workspaces are where you can create a contract, or group of contracts, ### Customize the contract The contract template we’re using is pretty simple. We just need to modify a couple of variables. + 1. Click the compiler icon to open the compiler panel. Update the compiler version by selecting `0.8.20` from the compiler dropdown. ![Update the compiler version](../../.gitbook/assets/smart-contracts-fundamentals-erc-20-quickstart-remix-compiler.webp) @@ -139,7 +140,6 @@ Now that we’ve successfully compiled our contract, we need to deploy it somewh 7. Under the **Contract** dropdown, ensure the contract you created is selected. ![Select contract in Remix.](../../.gitbook/assets/smart-contracts-fundamentals-erc-20-quickstart-remix-deploy-select.webp) - 8. Gather your MetaMask account address and populate the deploy field in Remix. ![Copy the address in MetaMask](../../.gitbook/assets/smart-contract-fundamentals-erc-20-quickstart-mm-account.webp) @@ -207,3 +207,7 @@ Currently, MetaMask has no idea what our token is or what it even does. We can f ### Share your tokens Having a bunch of tokens in your personal MetaMask is nice, but why not send some tokens to a friend? Your friend needs to create a wallet in MetaMask as we did in the [Create a wallet](erc-20-quickstart.md#create-a-wallet) and [Switch networks](erc-20-quickstart.md#switch-networks) sections. They will also need to import your contract deployment address like you did in the [Add your tokens to MetaMask](../../basics/assets/metamask-setup.md) section. Remember, you need to pay gas for every transaction that you make! If your friend tries to send some of your tokens to someone else but can’t, it might be because they don’t have any `tFil`. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/erc-20-quickstart) diff --git a/smart-contracts/fundamentals/faqs.md b/smart-contracts/fundamentals/faqs.md index 75c92528b..1a8701cfd 100644 --- a/smart-contracts/fundamentals/faqs.md +++ b/smart-contracts/fundamentals/faqs.md @@ -112,3 +112,7 @@ The intent of FEVM/FVM is to compute over state data (the metadata of your store ## **How do I close a storage deal on Filecoin and stop storage providers (SP) from storing my data on-chain** It’s not impossible but storage providers are incentivized not to close the storage deal as they are slashed for not providing [Proof of Spacetime (PoSt)](../../reference/general/glossary.md#proof-of-spacetime-post). Someone has to pay for the broken promise a miner makes to the chain and you need a custom market actor for it most likely to make the deal. You need to make deals for a certain amount of time - right now the boundaries are 6-18 months. You cannot ask a storage provider to take down your data without contacting them off-chain. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/faqs) diff --git a/smart-contracts/fundamentals/filecoin-evm-runtime.md b/smart-contracts/fundamentals/filecoin-evm-runtime.md index ac258a5ad..57f7da0b8 100644 --- a/smart-contracts/fundamentals/filecoin-evm-runtime.md +++ b/smart-contracts/fundamentals/filecoin-evm-runtime.md @@ -31,3 +31,7 @@ In both cases, you have access to all the awesome power of the Filecoin blockcha For a deeper dive into the concepts discussed on this page, see this presentation Ethereum compatibility of FVM, see: {% embed url="https://www.youtube.com/watch?v=lgUMVhM3FIM" %} + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/filecoin-evm-runtime) diff --git a/smart-contracts/fundamentals/roadmap.md b/smart-contracts/fundamentals/roadmap.md index f12f25a13..60b0a6112 100644 --- a/smart-contracts/fundamentals/roadmap.md +++ b/smart-contracts/fundamentals/roadmap.md @@ -92,3 +92,7 @@ Developers will be able to deploy custom smart contracts written in Rust, Assemb _To complete in 2023_ A series of additional incremental protocol upgrades (besides nv17) to move system functionality from privileged space to user space. The result will be a lighter and less opinionated base Filecoin protocol, where storage markets, deal-making, incentives, etc. are extensible, modular, and highly customizable through user-deployed actors. Enhanced programming features such as user-provided cron, asynchronous call patterns, and more will start to be developed at this stage. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/roadmap) diff --git a/smart-contracts/fundamentals/support.md b/smart-contracts/fundamentals/support.md index 018000c4c..ccef01dde 100644 --- a/smart-contracts/fundamentals/support.md +++ b/smart-contracts/fundamentals/support.md @@ -21,3 +21,7 @@ If you just need a general pointer or looking for technical FAQs, you can head o ## Developer grants The [Filecoin Grant Platform](https://github.com/filecoin-project/devgrants) connects grant makers with builders and researchers in the Filecoin community. Whether you represent a foundation that wants to move the space forward, a company looking to accelerate development on the features your application needs, or a developer team itching to hack on the FVM, [take a look at the supported grant types and available opportunities →](https://github.com/filecoin-project/devgrants) + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/support) diff --git a/smart-contracts/fundamentals/the-fvm.md b/smart-contracts/fundamentals/the-fvm.md index 1d66114d7..c38b62f0c 100644 --- a/smart-contracts/fundamentals/the-fvm.md +++ b/smart-contracts/fundamentals/the-fvm.md @@ -37,8 +37,12 @@ Additional use cases enabled by FVM include, but are not limited to, tokenized d If you’re ready to start building on the FVM, here are some resources you should explore: -* FVM Reference Implementation: The [Github repo](https://github.com/filecoin-project/ref-fvm) containing the reference implementation for FVM. +* FVM Reference Implementation: The [Github repo](https://github.com/filecoin-project/ref-fvm) containing the reference implementation for FVM. * FVM Quickstart Guide: The Quickstart guide will walk you through deploying your first ERC-20 contract on FVM. In addition to being provided this code, we also walk you through the developer environment set-up. * Developing Contracts: If you are ready to build your dApp on FVM, you can skip ahead and review our [best practices](../developing-contracts/best-practices.md) section for developing contracts. Here, you can find a guide for the Filecoin solidity libraries, details on tools such as Foundry, Remix, and Hardhat, and tutorials for calling built-in actors and building client contracts. The next page will walk you through the process of deciding whether you need to use FVM’s programmatic storage when building a dApp with storage on Filecoin. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/fundamentals/the-fvm) diff --git a/smart-contracts/programmatic-storage/README.md b/smart-contracts/programmatic-storage/README.md index 172858253..5bc775a83 100644 --- a/smart-contracts/programmatic-storage/README.md +++ b/smart-contracts/programmatic-storage/README.md @@ -1,6 +1,7 @@ --- description: >- - This section covers how to programmatically store data on the Filecoin network. + This section covers how to programmatically store data on the Filecoin + network. --- # Programmatic storage @@ -9,17 +10,17 @@ Programmatic storage is a concept where storage operations are controlled, autom ## Manual storage -A client must go through several steps to manually store something with a storage provider on Filecoin without using the FVM. These steps involve interacting with the Filecoin network, negotiating a deal with a storage provider, and performing various other operations to ensure the data is stored correctly and securely. We discuss how storage works in the [Basics section](../../basics/how-storage-works/README.md) but let's quickly summarize the process here: +A client must go through several steps to manually store something with a storage provider on Filecoin without using the FVM. These steps involve interacting with the Filecoin network, negotiating a deal with a storage provider, and performing various other operations to ensure the data is stored correctly and securely. We discuss how storage works in the [Basics section](../../basics/how-storage-works/) but let's quickly summarize the process here: 1. **Identify a storage provider (SP)**: Clients must identify storage providers who will store their data. Clients usually pick their storage providers based on geographic location and bandwidth limitations, although other factors may impact their decision. -1. **Negotiate a deal**: Clients negotiate deals with storage providers. These deals include terms like data size, price, deal duration, and collateral. The deal-making process happens off-chain, and once both parties agree to the terms of a deal, that deal is published on-chain for the rest of the network to see and validate. To successfully store data on Filecoin, clients need to have enough FIL to cover the deal's cost. -1. **Data preparation**: Before storing files on Filecoin, clients must import them into their local Filecoin node, which produces a data CID (Content Identifier) - an ID uniquely describing the content. Then, the data is transferred to the storage provider. -1. **Deal publication**: The deal is published on-chain, making the storage provider publicly accountable for the deal. -1. **Sealing and proving storage**: The storage provider stores the data in sectors. Sectors are the basic units of provable storage where storage providers store clients’ data and generate Proof-of-Spacetime (PoSt) on behalf of the Filecoin network. Sectors have standard sizes and a lifetime that storage providers can extend before reaching the end of the lifetime. +2. **Negotiate a deal**: Clients negotiate deals with storage providers. These deals include terms like data size, price, deal duration, and collateral. The deal-making process happens off-chain, and once both parties agree to the terms of a deal, that deal is published on-chain for the rest of the network to see and validate. To successfully store data on Filecoin, clients need to have enough FIL to cover the deal's cost. +3. **Data preparation**: Before storing files on Filecoin, clients must import them into their local Filecoin node, which produces a data CID (Content Identifier) - an ID uniquely describing the content. Then, the data is transferred to the storage provider. +4. **Deal publication**: The deal is published on-chain, making the storage provider publicly accountable for the deal. +5. **Sealing and proving storage**: The storage provider stores the data in sectors. Sectors are the basic units of provable storage where storage providers store clients’ data and generate Proof-of-Spacetime (PoSt) on behalf of the Filecoin network. Sectors have standard sizes and a lifetime that storage providers can extend before reaching the end of the lifetime. ## Programmatic storage -The [Filecoin virtual machine (FVM)](../filecoin-evm-runtime/README.md) is not designed to directly interact with data on Filecoin. Instead, it operates on blockchain state data, which includes metadata about stored data. The FVM's role is to compute over this state data and create logic around the storage and retrieval process. Storage and retrieval providers on the Filecoin network handle the actual process of storing and retrieving data. +The [Filecoin virtual machine (FVM)](../filecoin-evm-runtime/) is not designed to directly interact with data on Filecoin. Instead, it operates on blockchain state data, which includes metadata about stored data. The FVM's role is to compute over this state data and create logic around the storage and retrieval process. Storage and retrieval providers on the Filecoin network handle the actual process of storing and retrieving data. Developers can use FVM actors (also called smart-contracts) to implement various use cases related to data storage and retrieval on the Filecoin network. For instance, they can automate the process of renewing and repairing storage deals, replicating data across multiple storage providers for redundancy, or implement access control for data. @@ -40,8 +41,12 @@ Storage deals for more than 4 GiB don't suffer from the limitations of small-sca The client contract performs _direct_ deal making to automatically finds an SP to store your data. There are other considerations an SP must make when deciding to pick up your data deal proposals from the client contract. For example, some SPs may only deal with clients with whom they have an existing relationship with. For more information regarding client contracts and how they work, checkout the [client contract tutorial](../developing-contracts/client-contract-tutorial.md). 1. **Upload data to a data depot**: Data depots hold your data for the duration of this process so that you don't have to maintain your connection to the network. Once an SP verifiably holds your data, the data depot discards your data. After uploading your data to a depot, the depot will give you all the information you need to fill out the client contract. -1. **Deploy a client contract**: The deal client contract coordinates the handshaking required on FVM to load your data into the Filecoin network. -1. **Create a deal-proposal payload**: Once your data is ready in the data depot and your client contract has been deployed, you can create your deal-proposal payload. This payload contains everything a storage provider needs to download and store a copy of your data. -1. **Deal publication and activation**: An SP picks up your contract and downloads the data from the data depot. +2. **Deploy a client contract**: The deal client contract coordinates the handshaking required on FVM to load your data into the Filecoin network. +3. **Create a deal-proposal payload**: Once your data is ready in the data depot and your client contract has been deployed, you can create your deal-proposal payload. This payload contains everything a storage provider needs to download and store a copy of your data. +4. **Deal publication and activation**: An SP picks up your contract and downloads the data from the data depot. Check out the [Deal Making Starter Kit](https://github.com/filecoin-project/fvm-starter-kit-deal-making) for additional information on how this process works. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage) diff --git a/smart-contracts/programmatic-storage/aggregated-deal-making.md b/smart-contracts/programmatic-storage/aggregated-deal-making.md index 58f830563..0d2b7387a 100644 --- a/smart-contracts/programmatic-storage/aggregated-deal-making.md +++ b/smart-contracts/programmatic-storage/aggregated-deal-making.md @@ -71,3 +71,7 @@ On-chain aggregation and PoDSI requests go through aggregator oracle smart contr

Requesting for aggregation of data to store, via an on-chain smart contract

To build your own on-chain aggregator oracle smart contract, check out one of the implementations with [Filecoin Data Tools](https://github.com/application-research/fevm-data-segment). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/aggregated-deal-making) diff --git a/smart-contracts/programmatic-storage/direct-deal-making.md b/smart-contracts/programmatic-storage/direct-deal-making.md index f746da1e3..52e2d1c64 100644 --- a/smart-contracts/programmatic-storage/direct-deal-making.md +++ b/smart-contracts/programmatic-storage/direct-deal-making.md @@ -1,6 +1,7 @@ --- description: >- - This page explains the direct deal-making process in regards to the Filecoin network. + This page explains the direct deal-making process in regards to the Filecoin + network. --- # Direct deal-making @@ -46,3 +47,7 @@ Here is a diagram showing each of these steps in turn: ## Next steps For a complete tutorial on how to use the client contract to initiate a deal from FVM, see our [client contract tutorial](../developing-contracts/client-contract-tutorial.md). A full explanation of the client contract in the context of a direct deal-making starter kit can be found [here](https://github.com/filecoin-project/fvm-starter-kit-deal-making/tree/main). + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/direct-deal-making) diff --git a/smart-contracts/programmatic-storage/raas-interfaces.md b/smart-contracts/programmatic-storage/raas-interfaces.md index 3b80324cb..df203bb98 100644 --- a/smart-contracts/programmatic-storage/raas-interfaces.md +++ b/smart-contracts/programmatic-storage/raas-interfaces.md @@ -55,3 +55,7 @@ Check out the [RaaS starter kit](https://github.com/filecoin-project/raas-starte ## Aggregator-hosted RaaS The aggregator-hosted RaaS refers to a solution that requires an aggregator to host all the components of RaaS and provides a seamless interface to the client. [Lighthouse.storage](https://www.lighthouse.storage/) is the first FVM project to provide an aggregator-hosted RaaS, via its SDK. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/raas-interfaces) diff --git a/smart-contracts/programmatic-storage/raas.md b/smart-contracts/programmatic-storage/raas.md index 9053fd24d..967603962 100644 --- a/smart-contracts/programmatic-storage/raas.md +++ b/smart-contracts/programmatic-storage/raas.md @@ -102,3 +102,7 @@ async function initializeDealCreationListener() { To use this, call `yarn service` in the terminal and proceed through the frontend, as you normally would when uploading a file. Register the workers using the autocompleted CID that appears in the box. If you want to register the workers manually for a job that you didn't upload, paste in the known CID of your file into the box and register the jobs. + + + +[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/smart-contracts/programmatic-storage/raas)