diff --git a/docs/1-intro.mdx b/docs/1-intro.mdx index 6bfa580f..92748614 100644 --- a/docs/1-intro.mdx +++ b/docs/1-intro.mdx @@ -21,16 +21,16 @@ import useBaseUrl from "@docusaurus/useBaseUrl"; ## Getting started -- [Deploy your first smart contract](../guides/deploy-first-contract) — Build and deploy your first on-chain Flare smart contract, using only your browser. +- [Deploy your first smart contract](/network/getting-started) — Build and deploy your first on-chain Flare smart contract, using only your browser. - [Learn how to use FTSOv2](./ftso/overview) — Leverage the latest upgrades to the Flare Time Series Oracle, with feeds now updating every ≈1.8 seconds - Start building on Flare with programming languages you may already know - - [JavaScript](../guides/flare-for-javascript-developers) - - [Python](../guides/flare-for-python-developers) - - [Rust](../guides/flare-for-rust-developers) - - [Go](../guides/flare-for-go-developers) + - [JavaScript](/network/guides/flare-for-javascript-developers) + - [Python](/network/guides/flare-for-python-developers) + - [Rust](/network/guides/flare-for-rust-developers) + - [Go](/network/guides/flare-for-go-developers) ## Understand the architecture @@ -38,8 +38,6 @@ Build a strong understanding of the core concepts that set Flare apart from othe - Flare's data protocols, [Flare Time Series Oracle (FTSO)](./ftso/overview) and [Flare Data Connector (FDC)](./fdc/overview), are enshrined into the core protocol of Flare, and inherit the economic security of the entire network. -- [Delegated Proof-of-Stake (DPoS)](../guides/flare-dpos-mechanism) — Flare's users are incentivized to reward honest validators, and punish dishonest ones. - */} @@ -1319,7 +1320,7 @@ Successful non existence proofs: And there is a sub-specification for each chain that specifies the rules for the address validity for each chain. Be careful: Bitcoin and Dogecoin have different rules for validity on the mainnet and testnet, so make sure to check the correct specification with the correct verifier. -This is a very simple attestation type that can prove that a string constitutes a valid address on the specified chain. Importantly, unlike the `Payment` type we saw in [Part 1](/guides/how-to-state-connector), this type does not require a transaction to be proven. It just offloads the computation of the address validity to the verifier so that expensive computation does not have to be done on-chain. +This is a very simple attestation type that can prove that a string constitutes a valid address on the specified chain. Importantly, unlike the `Payment` type we saw in [Part 1](state-connector), this type does not require a transaction to be proven. It just offloads the computation of the address validity to the verifier so that expensive computation does not have to be done on-chain. This is useful if you want to ensure that the address is valid before using it in your protocol. For example, fAssets need to make sure that an address is valid before they can be used in the protocol, and this is a good way to offload difficult computation regarding when the bitcoin address is valid to off-chain entities. @@ -1685,6 +1686,6 @@ This approach ensures that complex and resource-intensive computations can be pe Congratulations — you made it this far! Now you see what the State Connector can do, how to use it, and some details you need to be careful about. As usual, check the repository for the full code and try to play around. -In [Part 3](/guides/evm-connectivity), we will explore how information from EVM chains can be relayed and what we can do with it. +In [Part 3](evm-connectivity), we will explore how information from EVM chains can be relayed and what we can do with it. A word of warning: while it might be tempting to save the whole proof structure in your smart contract (if you want to do some later operations), this is terribly inefficient from a gas standpoint, as you are writing a lot of data to memory and decoding nested structures is expensive. Additionally, since the structures are nested, even operating on them when in memory (or copying them from `calldata` to `memory`) generates large bytecode, which makes contract deployment more expensive or even impossible if you exceed the limit. diff --git a/guides/2024-06-13-evm-connectivity.mdx b/docs/fdc/guides/part3-evm-connectivity.mdx similarity index 99% rename from guides/2024-06-13-evm-connectivity.mdx rename to docs/fdc/guides/part3-evm-connectivity.mdx index ec7fdc87..1c7c25b4 100644 --- a/guides/2024-06-13-evm-connectivity.mdx +++ b/docs/fdc/guides/part3-evm-connectivity.mdx @@ -2,12 +2,13 @@ title: Part 3 - EVM Connectivity slug: evm-connectivity authors: [lukaavbreht, filipkoprivec] -description: Learn how to connect EVM chains with the Flare State Connector and what kind of attestations you can get from it. +description: Learn how to connect EVM chains to Flare. tags: [intermediate, ethereum, fdc] keywords: [ethereum, flare-data-connector, evm, flare-network] +sidebar_position: 3 --- -In [Part 1](/guides/how-to-state-connector) and [Part 2](/guides/attestation-types) of the series, you you have learned how the State Connector works and what kind of different attestations you can get from it. In this guide, you will: +In [Part 1](state-connector) and [Part 2](attestation-types) of the series, you you have learned how the State Connector works and what kind of different attestations you can get from it. In this guide, you will: - Move from the world of UTXO chains to the world of EVM chains with a new `EVMTransaction` attestation type. - Understand the implications of connecting account-based chains, and the additional possibilities that smart contracts bring. diff --git a/docs/ftso/1-getting-started.mdx b/docs/ftso/1-getting-started.mdx index 356da24c..4c22d5b8 100644 --- a/docs/ftso/1-getting-started.mdx +++ b/docs/ftso/1-getting-started.mdx @@ -27,7 +27,7 @@ import QueryLatestFeeds from "/static/img/ftso-getting-started/6-query-latest-fe You can use FTSOv2 to connect your smart contracts with real-world data feeds. FTSOv2 leverages Flare's network of 100 independent data providers to fetch off-chain data and deliver it on-chain. This section demonstrates how to consume FTSOv2's block-latency feeds on Flare using an on-chain Solidity contract. :::info -If you are new to smart contract development, learn how to [deploy your first smart contract](/guides/deploy-first-contract) before you start this guide. +If you are new to smart contract development, learn how to [deploy your first smart contract](/network/getting-started) before you start this guide. ::: ## Sample contract @@ -95,7 +95,7 @@ contract FtsoV2FeedConsumer { ## Compile, deploy, and run the contract :::info -If you have not already configured your MetaMask wallet to support Flare Testnet Coston2 and funded it with testnet C2FLR, learn how to [deploy your first smart contract](../../guides/deploy-first-contract). +If you have not already configured your MetaMask wallet to support Flare Testnet Coston2 and funded it with testnet C2FLR, learn how to [deploy your first smart contract](/network/getting-started). You can get testnet C2FLR from the [Coston2 Faucet](https://faucet.flare.network/coston2). ::: diff --git a/docs/ftso/guides/change-quote-feed.mdx b/docs/ftso/guides/change-quote-feed.mdx index bb5f63e1..d1869557 100644 --- a/docs/ftso/guides/change-quote-feed.mdx +++ b/docs/ftso/guides/change-quote-feed.mdx @@ -113,9 +113,7 @@ contract FtsoV2ChangeQuoteFeed {

-:::warning - -When compiling and deploying the contract: +:::warning[When compiling and deploying the contract] - **Using Remix:** Set EVM version to `london` in the **Advanced Configurations** section of the **Solidity Compiler** tab: diff --git a/docs/ftso/guides/make-volatility-incentive.mdx b/docs/ftso/guides/make-volatility-incentive.mdx index 94118673..7eaa653f 100644 --- a/docs/ftso/guides/make-volatility-incentive.mdx +++ b/docs/ftso/guides/make-volatility-incentive.mdx @@ -26,7 +26,7 @@ Before reading this guide, make sure you understand the [FTSOv2 Architecture](/f This guide provides code examples demonstrating how to make an FTSOv2 volatility incentive offer using various programming languages. To make a volatility incentive offer, you need three key pieces of information: -1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can use a node provider service or point to your own client. A comprehensive list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](../../network#configuration) page. +1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can use a node provider service or point to your own client. A comprehensive list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](/network/overview#configuration) page. 2. **Contract Address:** The address for the `FastUpdateIncentiveManager` contract varies by network. You can obtain this address in two ways: @@ -35,10 +35,10 @@ This guide provides code examples demonstrating how to make an FTSOv2 volatility **OR** - **Query the FlareContractRegistry Contract:** The `FlareContractRegistry` contract has the same address across all networks. You can query it to get the `FastUpdateIncentiveManager` contract address. Refer to the specific language guides for examples: - - [JavaScript](/guides/flare-for-javascript-developers#make-query) - - [Python](/guides/flare-for-python-developers#make-query) - - [Rust](/guides/flare-for-rust-developers#make-query) - - [Go](/guides/flare-for-go-developers#make-query) + - [JavaScript](/network/guides/flare-for-javascript-developers#make-query) + - [Python](/network/guides/flare-for-python-developers#make-query) + - [Rust](/network/guides/flare-for-rust-developers#make-query) + - [Go](/network/guides/flare-for-go-developers#make-query) 3. **Cost of Increasing the Sample Size:** FTSOv2 allows you to dynamically increase the sample size, i.e., the expected number of providers who can submit a block-latency feed update. The cost for this increases dynamically with the expected sample size. A single volatility incentive lasts for a period of 8 blocks. diff --git a/docs/ftso/guides/query-feed-configuration.mdx b/docs/ftso/guides/query-feed-configuration.mdx index 38471f3a..0ce0ced2 100644 --- a/docs/ftso/guides/query-feed-configuration.mdx +++ b/docs/ftso/guides/query-feed-configuration.mdx @@ -22,7 +22,7 @@ import Tabs from "@theme/Tabs"; This guide provides code examples demonstrating how to read FTSOv2 feed configurations off-chain using various programming languages. To achieve this, you need two key pieces of information: -1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can either use a node provider service or point to your own client. A list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](../../network#configuration) page. +1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can either use a node provider service or point to your own client. A list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](/network/overview#configuration) page. 2. **Contract Address:** The address for the `FastUpdatesConfiguration` contract varies by network. You can obtain this address in two ways: @@ -31,10 +31,10 @@ This guide provides code examples demonstrating how to read FTSOv2 feed configur **OR** - **Query the FlareContractRegistry Contract:** The `FlareContractRegistry` contract has the same address across all networks. You can query it to get the `FastUpdatesConfiguration` contract address. Refer to the specific language guides for examples: - - [JavaScript](/guides/flare-for-javascript-developers#make-query) - - [Python](/guides/flare-for-python-developers#make-query) - - [Rust](/guides/flare-for-rust-developers#make-query) - - [Go](/guides/flare-for-go-developers#make-query) + - [JavaScript](/network/guides/flare-for-javascript-developers#make-query) + - [Python](/network/guides/flare-for-python-developers#make-query) + - [Rust](/network/guides/flare-for-rust-developers#make-query) + - [Go](/network/guides/flare-for-go-developers#make-query) :::tip diff --git a/docs/ftso/guides/read-feeds-offchain.mdx b/docs/ftso/guides/read-feeds-offchain.mdx index ee097d76..81cb2e26 100644 --- a/docs/ftso/guides/read-feeds-offchain.mdx +++ b/docs/ftso/guides/read-feeds-offchain.mdx @@ -22,7 +22,7 @@ import Tabs from "@theme/Tabs"; This guide provides code examples demonstrating how to read FTSOv2 feeds off-chain using various programming languages. To read a block-latency feed off-chain, you need three key pieces of information: -1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can use a node provider service or point to your own client. A comprehensive list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](../../network#configuration) page. +1. **RPC Endpoint URL:** The RPC Endpoint URL determines which network your code will interact with. You can use a node provider service or point to your own client. A comprehensive list of public and private RPC endpoints for all Flare networks is available on the [Network Configuration](/network/overview#configuration) page. 2. **Contract Address:** The address for the `FastUpdater` contract varies by network. You can obtain this address in two ways: @@ -31,10 +31,10 @@ This guide provides code examples demonstrating how to read FTSOv2 feeds off-cha **OR** - **Query the FlareContractRegistry Contract:** The `FlareContractRegistry` contract has the same address across all networks. You can query it to get the `FastUpdater` contract address. Refer to the specific language guides for examples: - - [JavaScript](/guides/flare-for-javascript-developers#make-query) - - [Python](/guides/flare-for-python-developers#make-query) - - [Rust](/guides/flare-for-rust-developers#make-query) - - [Go](/guides/flare-for-go-developers#make-query) + - [JavaScript](/network/guides/flare-for-javascript-developers#make-query) + - [Python](/network/guides/flare-for-python-developers#make-query) + - [Rust](/network/guides/flare-for-rust-developers#make-query) + - [Go](/network/guides/flare-for-go-developers#make-query) 3. **Feed Indexes:** The feeds you want to read are uniquely identified by their index. A list of feed indexes is provided on the [Block-Latency Feeds](../feeds) page. diff --git a/docs/ftso/guides/read-feeds-onchain.mdx b/docs/ftso/guides/read-feeds-onchain.mdx index b2e9abd2..c8550b02 100644 --- a/docs/ftso/guides/read-feeds-onchain.mdx +++ b/docs/ftso/guides/read-feeds-onchain.mdx @@ -20,7 +20,7 @@ This guide provides code examples demonstrating how to read FTSOv2 feeds off-cha 2. **Feed Indexes:** The feeds you want to read are uniquely identified by their index. A list of feed indexes is provided on the [Block-Latency Feeds](../feeds) page. :::info -If you are familiar with Hardhat or Foundry, use the [Hardhat and Foundry Starter Kit](/guides/hardhat-foundry-starter-kit) to get started with Flare development. +If you are familiar with Hardhat or Foundry, use the [Hardhat and Foundry Starter Kit](/network/guides/hardhat-foundry-starter-kit) to get started with Flare development. ::: @@ -123,9 +123,7 @@ If you are familiar with Hardhat or Foundry, use the [Hardhat and Foundry Starte

-:::warning - -When compiling and deploying the contract: +:::warning[When compiling and deploying the contract] - **Using Remix:** Set EVM version to `london` in the **Advanced Configurations** section of the **Solidity Compiler** tab: diff --git a/docs/2-network.mdx b/docs/network/0-overview.mdx similarity index 96% rename from docs/2-network.mdx rename to docs/network/0-overview.mdx index 8fb0c1f2..ea627797 100644 --- a/docs/2-network.mdx +++ b/docs/network/0-overview.mdx @@ -1,6 +1,5 @@ --- -sidebar_position: 2 -slug: network +slug: overview title: Network description: Learn about the different Flare networks, configuration, supported wallets, transaction format, smart contracts, consensus, and more. keywords: @@ -117,16 +116,6 @@ Several browser and mobile app based wallets such as MetaMask, Rabby and Bifrost - **RPC-API:** [Ethereum RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) - **Supported opcodes:** All [opcodes](https://www.evm.codes/?fork=london) up to the London hard fork are supported. In the standard Solidity JSON interface: - ```json - { - "settings": { - "optimizer": { - /* ... */ - }, - "evmVersion": "london" - } - } - ``` ## Consensus @@ -144,12 +133,12 @@ Several browser and mobile app based wallets such as MetaMask, Rabby and Bifrost - **Consensus participants:** Validators vote on block proposals and serve as leaders. To serve as a validator, a node must meet a minimum self-bond set by governance. Validators are randomly selected as leaders to propose new blocks. The probability of a node being elected leader is proportional to the node's stake. -- **Enshrined protocols:** In addition to consensus, Flare validators are also data providers for [FTSO](./run-a-node/ftso-data-provider) and attestation providers for [FDC](./run-a-node/fdc-attestation-provider). +- **Enshrined protocols:** In addition to consensus, Flare validators are also data providers for [FTSO](/run-a-node/ftso-data-provider) and attestation providers for [FDC](/run-a-node/fdc-attestation-provider). :::note Adding Flare's native token FLR to your exchange Flare is just like Ethereum. To add it to your exchange: -- Set up an [observer node](./run-a-node/observer-node) +- Set up an [observer node](/run-a-node/observer-node) - Use the appropriate [network configuration](#configuration) for Flare Mainnet Additional info: [Media & Branding](https://flare.network/media/), [Flare source code](https://github.com/flare-foundation/go-flare) diff --git a/guides/2024-05-21-deploy-first-contract.mdx b/docs/network/1-getting-started.mdx similarity index 95% rename from guides/2024-05-21-deploy-first-contract.mdx rename to docs/network/1-getting-started.mdx index 5e4eccf6..09573b5e 100644 --- a/guides/2024-05-21-deploy-first-contract.mdx +++ b/docs/network/1-getting-started.mdx @@ -1,8 +1,7 @@ --- -slug: deploy-first-contract -title: Deploy your first smart contract -description: Learn how to deploy your first smart contract on Flare using MetaMask and Remix. -tags: [solidity, quickstart] +slug: getting-started +title: Getting Started +description: Deploy a smart contract on Flare using your browser. keywords: [solidity, smart-contract, metamask, remix, flare-network, blockchain] --- @@ -174,7 +173,7 @@ Let's break down the `HelloWorld` contract: ```solidity title="HelloWorld.sol" // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity 0.8.19; /** * THIS IS AN EXAMPLE CONTRACT. @@ -194,7 +193,7 @@ contract HelloWorld { } ``` -1. **Pragma Directive:** The `pragma solidity ^0.8.20;` statement specifies the version of the Solidity compiler the contract should use. In this case, it's indicating that the contract is compatible with Solidity versions from 0.8.20 up to, but not including, version 0.9.0. +1. **Pragma Directive:** The `pragma solidity 0.8.19;` statement specifies the version of the Solidity compiler the contract should use. 2. **Contract Declaration:** The `contract HelloWorld { ... }` statement defines a new Solidity contract named `HelloWorld`. diff --git a/guides/2024-05-27-flare-for-go-developers.mdx b/docs/network/guides/flare-for-go-developers.mdx similarity index 97% rename from guides/2024-05-27-flare-for-go-developers.mdx rename to docs/network/guides/flare-for-go-developers.mdx index a1ec6a03..ac6a520b 100644 --- a/guides/2024-05-27-flare-for-go-developers.mdx +++ b/docs/network/guides/flare-for-go-developers.mdx @@ -3,8 +3,9 @@ slug: flare-for-go-developers title: Flare for Go Devs authors: [dineshpinto] tags: [go, quickstart, solidity] -description: Learn how to interact with Flare using Go, including querying a contract, compiling a contract, and deploying a contract. +description: Interact with Flare using geth. keywords: [go, quickstart, solidity, smart-contract, flare-network] +sidebar_position: 4 --- import Tabs from "@theme/Tabs"; @@ -51,7 +52,7 @@ go get github.com/ethereum/go-ethereum/accounts/keystore@v1.14.3 ### Usage -You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network#configuration) page will work. For this guide, you can use the Ankr RPC. +You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Ankr RPC. @@ -272,7 +273,7 @@ This will generate a new account and save the keystore file in the current direc ### Fund account -- For testnet, you can use the testnet faucets on the [Network Configuration](/network#configuration) page to get some testnet C2FLR. +- For testnet, you can use the testnet faucets on the [Network Configuration](/network/overview#configuration) page to get some testnet C2FLR. - For mainnet, you need to buy FLR in a cryptocurrency exchange such as Coinbase, Kraken etc. ### Deploy contract diff --git a/guides/2024-05-24-flare-for-javascript-developers.mdx b/docs/network/guides/flare-for-javascript-developers.mdx similarity index 95% rename from guides/2024-05-24-flare-for-javascript-developers.mdx rename to docs/network/guides/flare-for-javascript-developers.mdx index 2a9f5722..72a38585 100644 --- a/guides/2024-05-24-flare-for-javascript-developers.mdx +++ b/docs/network/guides/flare-for-javascript-developers.mdx @@ -2,9 +2,19 @@ slug: flare-for-javascript-developers title: Flare for JavaScript Devs authors: [dineshpinto] -description: Learn how to interact with Flare using JavaScript. In this guide, you will learn how to query a contract, compile a Solidity contract, and deploy your compiled contract on Flare. +description: Interact with Flare using web3.js and ethers.js. tags: [javascript, quickstart, solidity] -keywords: [rust, quickstart, solidity, smart-contract, flare-network] +keywords: + [ + javascript, + web3.js, + ethers.js, + quickstart, + solidity, + smart-contract, + flare-network, + ] +sidebar_position: 1 --- import Tabs from "@theme/Tabs"; @@ -61,7 +71,7 @@ Install web3.js using either `npm` or `yarn`: ### Usage -You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network#configuration) page will work. For this guide, you can use the Ankr RPC. +You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Ankr RPC. @@ -235,7 +245,7 @@ You can also import the raw hex private key to MetaMask and any other wallet - t ### Fund account -- For testnet, you can use the testnet faucets on the [Network Configuration](/network#configuration) page to get some testnet C2FLR. +- For testnet, you can use the testnet faucets on the [Network Configuration](/network/overview#configuration) page to get some testnet C2FLR. - For mainnet, you need to buy FLR in a cryptocurrency exchange such as Coinbase, Kraken etc. ### Deploy with web3 @@ -316,7 +326,7 @@ With the account ready, you can now deploy the contract. In a `deployContract.js -You can now run the `deployContract.js` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain Explorer, linked on the [Network Configuration](/network#configuration) page. +You can now run the `deployContract.js` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain Explorer, linked on the [Network Configuration](/network/overview#configuration) page. Congratulations! You have now successfully deployed a contract on Flare using Python. diff --git a/guides/2024-05-25-flare-for-python-developers.mdx b/docs/network/guides/flare-for-python-developers.mdx similarity index 97% rename from guides/2024-05-25-flare-for-python-developers.mdx rename to docs/network/guides/flare-for-python-developers.mdx index 4284bc9e..2f04a44c 100644 --- a/guides/2024-05-25-flare-for-python-developers.mdx +++ b/docs/network/guides/flare-for-python-developers.mdx @@ -2,9 +2,10 @@ slug: flare-for-python-developers title: Flare for Python Devs authors: [dineshpinto] -description: Learn how to interact with Flare using Python. This guide will help you query a contract on Flare, compile a Solidity contract, and deploy your compiled contract on Flare. +description: Interact with Flare using web3.py. tags: [python, quickstart, solidity] -keywords: [rust, quickstart, solidity, smart-contract, flare-network] +keywords: [python, web3.py, quickstart, solidity, smart-contract, flare-network] +sidebar_position: 2 --- import Tabs from "@theme/Tabs"; @@ -39,7 +40,7 @@ This guide is for developers who want to interact with Flare using Python. In th ### Usage -You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network#configuration) page will work. For this guide, you can use the Ankr RPC. +You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Ankr RPC. @@ -386,7 +387,7 @@ You can also import the raw hex private key to MetaMask and any other wallet - t ### Fund account -- For testnet, you can use the testnet faucets on the [Network Configuration](/network#configuration) page to get some testnet C2FLR. +- For testnet, you can use the testnet faucets on the [Network Configuration](/network/overview#configuration) page to get some testnet C2FLR. - For mainnet, you need to buy FLR in a cryptocurrency exchange such as Coinbase, Kraken etc. ### Set up helpers @@ -491,7 +492,7 @@ With the functions and account ready, you can now deploy the contract. In a `dep -You can now run the `deploy_contract.py` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain Explorer, linked on the [Network Configuration](/network#configuration) page. +You can now run the `deploy_contract.py` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain Explorer, linked on the [Network Configuration](/network/overview#configuration) page. diff --git a/guides/2024-05-26-flare-for-rust-developers.mdx b/docs/network/guides/flare-for-rust-developers.mdx similarity index 95% rename from guides/2024-05-26-flare-for-rust-developers.mdx rename to docs/network/guides/flare-for-rust-developers.mdx index 7a5f2572..20ef8b40 100644 --- a/guides/2024-05-26-flare-for-rust-developers.mdx +++ b/docs/network/guides/flare-for-rust-developers.mdx @@ -2,9 +2,10 @@ slug: flare-for-rust-developers title: Flare for Rust Devs authors: [dineshpinto] -description: Learn how to interact with Flare using Rust. In this guide, you will learn how to query a contract, compile a Solidity contract, and deploy your compiled contract on Flare. +description: Interact with Flare using alloy-rs. tags: [rust, quickstart, solidity] -keywords: [rust, quickstart, solidity, smart-contract, flare-network] +keywords: [rust, alloy-rs, quickstart, solidity, smart-contract, flare-network] +sidebar_position: 3 --- import Tabs from "@theme/Tabs"; @@ -52,7 +53,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] } ### Usage -You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network#configuration) page will work. For this guide, you can use the Ankr RPC. +You need to connect to testnet or mainnet via an RPC, any RPC listed on the [Network Configuration](/network/overview#configuration) page will work. For this guide, you can use the Ankr RPC. @@ -286,7 +287,7 @@ You can also import the raw hex private key to MetaMask and any other wallet - t ### Fund account -- For testnet, you can use the testnet faucets on the [Network Configuration](/network#configuration) page to get some testnet C2FLR. +- For testnet, you can use the testnet faucets on the [Network Configuration](/network/overview#configuration) page to get some testnet C2FLR. - For mainnet, you need to buy FLR in a cryptocurrency exchange such as Coinbase, Kraken etc. ### Deploy with alloy @@ -359,7 +360,7 @@ With the account ready, you can now deploy the contract. In a `deploy_contract.r -You can now run the `deploy_contract.rs` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain explorer, linked on the [Network Configuration](/network#configuration) page. +You can now run the `deploy_contract.rs` script to deploy the contract. The contract address will be printed once the deployment is successful. You can check the contract address on a Flare Blockchain explorer, linked on the [Network Configuration](/network/overview#configuration) page. ```bash cargo run --bin deploy_contract diff --git a/guides/2024-05-22-hardhat-foundry-starter-kit.mdx b/docs/network/guides/hardhat-foundry-starter-kit.mdx similarity index 97% rename from guides/2024-05-22-hardhat-foundry-starter-kit.mdx rename to docs/network/guides/hardhat-foundry-starter-kit.mdx index 941d7e4b..4d98fe0e 100644 --- a/guides/2024-05-22-hardhat-foundry-starter-kit.mdx +++ b/docs/network/guides/hardhat-foundry-starter-kit.mdx @@ -3,10 +3,10 @@ slug: hardhat-foundry-starter-kit title: Hardhat and Foundry Starter Kit tags: [quickstart, hardhat, foundry, solidity] authors: [filipkoprivec] -description: Starter kits for integrating Flare with Hardhat and Foundry. +description: Integrate Flare into Hardhat and Foundry. keywords: [hardhat, foundry, quickstart, solidity, smart-contract, flare-network] -hide_date: true +sidebar_position: 5 --- import Tabs from "@theme/Tabs"; @@ -217,4 +217,4 @@ Run the deployment script using Foundry: forge script script/Counter.s.sol --broadcast --private-key $PRIVATE_KEY --rpc-url ``` -Replace `` with the RPC endpoint of the network you are deploying to. A list of RPC endpoints for Flare networks can be found in Flare's [Network Configuration](/network#configuration). +Replace `` with the RPC endpoint of the network you are deploying to. A list of RPC endpoints for Flare networks can be found in Flare's [Network Configuration](/network/overview#configuration). diff --git a/docs/support/faqs.mdx b/docs/support/faqs.mdx index 17c3cac8..6727ed89 100644 --- a/docs/support/faqs.mdx +++ b/docs/support/faqs.mdx @@ -35,7 +35,7 @@ You can get: - Testnet CFLR from the [Coston Faucet](https://faucet.flare.network/coston). -To understand the difference between Coston and Coston2, see the [Network Configuration](../network#configuration) page. +To understand the difference between Coston and Coston2, see the [Network Configuration](/network/overview#configuration) page. ### I have a project I would like to build on Flare. Can I get a grant? diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ed41934e..eb440e2f 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -45,24 +45,9 @@ const config: Config = { rehypePlugins: [rehypeKatex], editUrl: "https://github.com/flare-foundation/developer-hub/edit/main", - }, - blog: { - sortPosts: "ascending", - path: "guides", - routeBasePath: "guides", - showReadingTime: true, - feedOptions: { - type: "all", - copyright: `Copyright © Flare Networks ${new Date().getFullYear()}.`, - }, - blogTitle: "Guides", - blogDescription: "All guides for interacting with Flare.", - blogSidebarCount: "ALL", - blogSidebarTitle: "All guides", onInlineTags: "throw", - editUrl: - "https://github.com/flare-foundation/developer-hub/edit/main", }, + blog: false, theme: { customCss: "./src/css/custom.css", }, @@ -104,7 +89,6 @@ const config: Config = { position: "left", label: "Flare ☀️", }, - { to: "/guides", label: "Guides", position: "left" }, // { // href: "https://t.me/FlareNetwork", // className: "header-telegram-link", diff --git a/guides/2024-05-23-flare-dpos-mechanism.mdx b/guides/2024-05-23-flare-dpos-mechanism.mdx deleted file mode 100644 index 73a47351..00000000 --- a/guides/2024-05-23-flare-dpos-mechanism.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -slug: flare-dpos-mechanism -title: Flare's DPoS mechanism -authors: [magurh] -description: Understand how Flare's Delegated Proof-of-Stake mechanism works and how it compares to other consensus mechanisms. -tags: [consensus, proof-of-stake] -keywords: [flare-network, consensus, proof-of-stake, delegated-proof-of-stake] ---- - -Flare leverages a Delegated Proof-of-Stake mechanism (DPoS), representing a substantial advancement in efficiency, security, and scalability over conventional Proof-of-Work (PoW) and Proof-of-Stake (PoS) blockchains. - -{/* truncate */} - -By employing this system, Flare fosters decentralization, enabling any token holder to participate in the block validation process. This inclusive approach ensures that network validators act in the network's best interests, further reinforcing its robustness and integrity. - -## Proof-of-Work - -One of the most widely recognized consensus mechanisms is PoW, initially conceptualized in the 1990s and later popularized by Bitcoin. This mechanism aims to safeguard a decentralized network from Denial of Service (DoS) and spam attacks, commonly known as Sybil attacks, by requiring blockchain miners to solve complex mathematical problems to append new blocks and mint new currency. -One significant advantage of PoW is its open participation model, as opposed to being permissioned, where the selection of the next block creator is unpredictable. However, solving the intricate mathematical puzzle inherent in PoW demands enormous energy resources, leading to substantial electricity consumption. For instance, the entire Bitcoin network is projected to consume an amount of energy exceeding half the total electricity usage of the United Kingdom. - -## The Proof-of-Stake Revolution - -Proof-of-Stake (PoS) employs a more efficient method for block creation, eliminating the energy-intensive mining process of PoW. In PoS, a group of nodes can become network validators by staking a valuable asset, which is at risk of being forfeited if they engage in dishonest behavior. The size of the stake determines the likelihood of a validator being selected to forge the next block. While this may initially appear to favor the wealthy, it represents a superior decentralization model compared to PoW. In PoW, richer nodes can leverage economies of scale, where acquiring more equipment leads to lower costs per unit. Conversely, PoS protocols maintain a consistent cost per output, promoting fairness and sustainability. - -In a decentralized network, multiple validators are tasked with verifying the same block, and upon unanimous agreement on the accuracy of the information, the block is finalized. Flare Network employs the Snowman++ consensus protocol, developed by Avalanche, to facilitate this agreement process. Upon successful validation of a block, all participating validators are rewarded with transaction fees associated with the block. However, in cases where a node attempts to defraud the network—such as proposing multiple blocks when only one is required or sending conflicting attestations—their staked ETH may be subject to partial or complete destruction as a deterrent against dishonest behavior. - -## Delegated PoS - -Despite their efficiency compared to PoW, PoS systems still present certain vulnerabilities, particularly concerning security and decentralization. It's crucial to maintain a substantial stake of tokens staked continuously to prevent the validation of fraudulent transactions. Additionally, the requirement for a minimum stake to participate as network validators in PoS systems adds another layer of complexity to this challenge and can potentially exacerbate centralization concerns. - -Delegated Proof-of-Stake (DPoS) introduces a more democratic approach, allowing any token holder to engage in the validation process. Token holders have the option to delegate their voting power, represented by the tokens they hold, to network validators, thereby augmenting their stake artificially. Through this mechanism, both validators and token holders can earn rewards proportionate to their stake and delegated stake. Furthermore, this rewarding system incentivizes validators to maintain honesty, as they receive a percentage fee set on the rewards of the token holders. - -This mechanism ensures a consistently large amount of tokens are staked, thereby enhancing the network's security. The selection process for validators adds community pressure, compelling validators to operate honestly and effectively. Importantly, token holders face no additional risk when delegating their tokens, as these tokens remain in their custody and can be reclaimed after a specified period. diff --git a/sidebars.ts b/sidebars.ts index a776078a..f9d30360 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -13,11 +13,30 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; const sidebars: SidebarsConfig = { networkSidebar: [ "intro", - "network", { type: "category", - label: "FTSOv2", + label: "Network", collapsed: false, + link: { type: "doc", id: "network/overview" }, + items: [ + "network/getting-started", + { + type: "category", + label: "Network Guides", + collapsed: false, + link: { + slug: "/category/network/guides", + type: "generated-index", + description: "Learn how to start building on Flare.", + }, + items: [{ type: "autogenerated", dirName: "network/guides" }], + }, + ], + }, + { + type: "category", + label: "FTSOv2", + collapsed: true, link: { type: "doc", id: "ftso/overview" }, items: [ "ftso/getting-started", @@ -25,7 +44,7 @@ const sidebars: SidebarsConfig = { { type: "category", label: "FTSOv2 Guides", - collapsed: true, + collapsed: false, link: { slug: "/category/ftso/guides", type: "generated-index", @@ -98,7 +117,7 @@ const sidebars: SidebarsConfig = { { type: "category", label: "FDC Guides", - collapsed: true, + collapsed: false, link: { type: "generated-index", },