Skip to content

Commit

Permalink
Nialexsan/building on flow improvements (#248)
Browse files Browse the repository at this point in the history
* building on flow improvements

* icons

* fixes

* fix link

* fix link

* fix links
  • Loading branch information
nialexsan authored Sep 8, 2023
1 parent 9e0967f commit f73cb4e
Show file tree
Hide file tree
Showing 105 changed files with 132 additions and 156 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ yarn-error.log*
/docs/unsorted
.idea/

docs/building-on-flow/token-standards/flow-ft/*
!docs/building-on-flow/token-standards/flow-ft/index.md
docs/building-on-flow/token-standards/flow-nft/*
!docs/building-on-flow/token-standards/flow-nft/index.md
docs/building-on-flow/core-contracts/flow-ft/*
!docs/building-on-flow/core-contracts/flow-ft/index.md
docs/building-on-flow/core-contracts/flow-nft/*
!docs/building-on-flow/core-contracts/flow-nft/index.md

docs/.obsidian

Expand Down
3 changes: 0 additions & 3 deletions docs/building-on-flow/app-architecture/_category_.yml

This file was deleted.

4 changes: 3 additions & 1 deletion docs/building-on-flow/app-architecture/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
sidebar_position: 1
sidebar_position: 3
title: App Architecture
description: Describes building self-custody and app custody applications on Flow Blockchain.
sidebar_custom_props:
icon: 🏗️
---

# App Architecture on Flow Blockchain
Expand Down
6 changes: 4 additions & 2 deletions docs/building-on-flow/building-vs-other-chains.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
sidebar_position: 3
title: Differences vs. Other Blockchains
sidebar_custom_props:
icon: ↔️
---

This document summarizes the differences you might encounter between building on Flow vs. other blockchains, especially Ethereum. This will be most useful to developers who are already familiar with building on a blockchain system. Check out [Introduction to Flow](../concepts/start-here.md) for a more beginner-friendly overview of the Flow blockchain.
Expand Down Expand Up @@ -157,13 +159,13 @@ Access Nodes are the node type that are most useful for developers, as they prov
- gRPC
- Mainnet: `access.mainnet.nodes.onflow.org:9000`
- Testnet: `access.devnet.nodes.onflow.org:9000`
- [Specification](./nodes/access-api.mdx)
- [Specification](./run-and-secure/nodes/access-api.mdx)

### Running Your Own Node

If you’re getting started you don’t need to run your own node and you can use the above public nodes. The public access nodes are rate-limited, so as your product matures you might want to run your own node. There are multiple options available:

- Start with a [Light (Observer) Node](./nodes/node-operation/observer-node.mdx).
- Start with a [Light (Observer) Node](./run-and-secure/nodes/node-operation/observer-node.mdx).
- You can also use a third-party provider like [Quicknode](https://www.quicknode.com/docs/flow).

Check out [Running a Node](../guides/runningNode.mdx) for more information.
Expand Down
2 changes: 1 addition & 1 deletion docs/building-on-flow/core-contracts/10-nft-storefront.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The `NFTStorefrontV2` contract doesn’t support selling an NFT for multiple dif

**Example -** Alice wants to sell a kitty and is open to receiving FLOW and USDC

![scenario_1](https://user-images.githubusercontent.com/14581509/190966672-e1793fa3-112c-4273-b2a3-e81b8c94fd70.png)
![scenario_1](./scenario_1.png)

Putting an NFT on sell called listing, seller can create a listing using [sell_item](https://github.com/onflow/nft-storefront/blob/main/transactions/sell_item.cdc) transaction by providing some required details to list an NFT, i.e. Receiving currency type, [Capability](../../cadence/language/capability-based-access-control.md) from where NFT will be deducted etc. If interested look [here](#fun-createListing()) for more details.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Fungible Token (FT) Standard
sidebar_position: 5
sidebar_position: 1
---

This is a description of the Flow standard for fungible token contracts. It is meant to contain the minimum requirements to implement a safe, secure, easy to understand, and easy to use fungible token contract. It also includes an example implementation to show how a concrete smart contract would actually implement the interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
sidebar_position: 1
---
# Flow Non-Fungible Token (NFT) Standard

This standard defines the minimum functionality required to
Expand Down
2 changes: 2 additions & 0 deletions docs/building-on-flow/core-contracts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Flow Core Contracts
description: The smart contracts that power the Flow protocol
sidebar_title: Core Protocol Smart Contracts
sidebar_position: 13
sidebar_custom_props:
icon: 📝
---

Flow relies on a set of core contracts that define key portions of the
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/building-on-flow/flow-networks/accessing-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func main() {

## Account creation

You can follow the [Flow Port account creation steps](../nodes/flow-port/index.md#blocto) to create a new mainnet account.
You can follow the [Flow Port account creation steps](../run-and-secure/nodes/flow-port/index.md#blocto) to create a new mainnet account.

If you prefer watching a video, check out this tutorial:

Expand Down
4 changes: 3 additions & 1 deletion docs/building-on-flow/flow-networks/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Flow Networks
sidebar_position: 10
sidebar_position: 2
sidebar_custom_props:
icon: 🌐
---

# Flow Networks
Expand Down
2 changes: 2 additions & 0 deletions docs/building-on-flow/governance.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: Governance
sidebar_custom_props:
icon: 🏛️
---

## Participation
Expand Down
2 changes: 2 additions & 0 deletions docs/building-on-flow/mobile/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Flow Mobile
sidebar_position: 20
sidebar_custom_props:
icon: 📱
---

Building mobile native applications that interact with the blockchain enables a much richer end user experiences and provides access to OS capabilities. With Flow Mobile, developers can build native applications for iOS and Android leveraging SDKs and mobile wallets.
Expand Down
5 changes: 0 additions & 5 deletions docs/building-on-flow/network-information.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/building-on-flow/run-and-secure/_category_.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
label: Running and Securing Flow
position: 6
customProps:
icon: 🔐
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ message AccountResponse {

`ExecuteScriptAtLatestBlock` executes a read-only Cadence script against the latest sealed execution state.

This method can be used to read execution state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../cadence/json-cadence-spec.md).
This method can be used to read execution state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../../cadence/json-cadence-spec.md).

```proto
rpc ExecuteScriptAtLatestBlock (ExecuteScriptAtLatestBlockRequest) returns (ExecuteScriptResponse)
Expand Down Expand Up @@ -556,7 +556,7 @@ message ExecuteScriptResponse {

`ExecuteScriptAtBlockID` executes a ready-only Cadence script against the execution state at the block with the given ID.

This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../cadence/json-cadence-spec.md).
This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../../cadence/json-cadence-spec.md).

```proto
rpc ExecuteScriptAtBlockID (ExecuteScriptAtBlockIDRequest) returns (ExecuteScriptResponse)
Expand Down Expand Up @@ -589,7 +589,7 @@ message ExecuteScriptResponse {

`ExecuteScriptAtBlockHeight` executes a ready-only Cadence script against the execution state at the given block height.

This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../cadence/json-cadence-spec.md).
This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../../cadence/json-cadence-spec.md).

```proto
rpc ExecuteScriptAtBlockHeight (ExecuteScriptAtBlockHeightRequest) returns (ExecuteScriptResponse)
Expand Down Expand Up @@ -850,7 +850,7 @@ message Block {
| block_seals | List of [block seals](#block-seal) |
| signatures | BLS signatures of consensus nodes |

The detailed semantics of block formation are covered in the [block formation guide](../../concepts/blocks.md).
The detailed semantics of block formation are covered in the [block formation guide](../../../concepts/blocks.md).

## Block Header

Expand Down Expand Up @@ -971,24 +971,24 @@ message TransactionSignature {
| Field | Description |
| ----------------------------- | ---------------------------------------------------------------------------------------------------- |
| script | Raw source code for a Cadence script, encoded as UTF-8 bytes |
| arguments | Arguments passed to the Cadence script, encoded as [JSON-Cadence](../../cadence/json-cadence-spec.md) bytes |
| arguments | Arguments passed to the Cadence script, encoded as [JSON-Cadence](../../../cadence/json-cadence-spec.md) bytes |
| reference_block_id | Block ID used to determine transaction expiry |
| [proposal_key](#proposal-key) | Account key used to propose the transaction |
| payer | Address of the payer account |
| authorizers | Addresses of the transaction authorizers |
| signatures | [Signatures](#transaction-signatures) from all signer accounts |

The detailed semantics of transaction creation, signing and submission are covered in the [transaction submission guide](../../concepts/transactions.md#signing-a-transaction).
The detailed semantics of transaction creation, signing and submission are covered in the [transaction submission guide](../../../concepts/transactions.md#signing-a-transaction).

### Proposal Key

The proposal key is used to specify a sequence number for the transaction. Sequence numbers are covered in more detail [here](../../concepts/transactions.md#sequence-numbers).
The proposal key is used to specify a sequence number for the transaction. Sequence numbers are covered in more detail [here](../../../concepts/transactions.md#sequence-numbers).

| Field | Description |
| --------------- | ------------------------------------------------------------------------------------ |
| address | Address of proposer account |
| key_id | ID of proposal key on the proposal account |
| sequence_number | [Sequence number](../../concepts/transactions.md#sequence-numbers) for the proposal key |
| sequence_number | [Sequence number](../../../concepts/transactions.md#sequence-numbers) for the proposal key |

### Transaction Signature

Expand Down Expand Up @@ -1044,7 +1044,7 @@ message Account {

The `code` and `contracts` fields contain the raw Cadence source code, encoded as UTF-8 bytes.

More information on accounts can be found [here](../../concepts/accounts.md).
More information on accounts can be found [here](../../../concepts/accounts.md).

### Account Key

Expand All @@ -1066,13 +1066,13 @@ message AccountKey {
| --------------- | --------------------------------------------------------------------------------------- |
| id | Index of the key within the account, used as a unique identifier |
| public_key | Public key encoded as bytes |
| sign_algo | [Signature algorithm](../../concepts/accounts.md#signature-and-hash-algorithms) |
| hash_algo | [Hash algorithm](../../concepts/accounts.md#signature-and-hash-algorithms) |
| weight | [Weight assigned to the key](../../concepts/accounts.md#account-keys) |
| sequence_number | [Sequence number for the key](../../concepts/transactions.md#sequence-numbers) |
| sign_algo | [Signature algorithm](../../../concepts/accounts.md#signature-and-hash-algorithms) |
| hash_algo | [Hash algorithm](../../../concepts/accounts.md#signature-and-hash-algorithms) |
| weight | [Weight assigned to the key](../../../concepts/accounts.md#account-keys) |
| sequence_number | [Sequence number for the key](../../../concepts/transactions.md#sequence-numbers) |
| revoked | Flag indicating whether or not the key has been revoked |

More information on account keys, key weights and sequence numbers can be found [here](../../concepts/accounts.md).
More information on account keys, key weights and sequence numbers can be found [here](../../../concepts/accounts.md).

## Event

Expand All @@ -1094,7 +1094,7 @@ message Event {
| transaction_id | ID of the transaction the event was emitted from |
| transaction_index | Zero-based index of the transaction within the block |
| event_index | Zero-based index of the event within the transaction |
| payload | Event fields encoded as [JSON-Cadence values](../../cadence/json-cadence-spec.md) |
| payload | Event fields encoded as [JSON-Cadence values](../../../cadence/json-cadence-spec.md) |

## Execution Result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ message AccountResponse {

`ExecuteScriptAtBlockID` executes a ready-only Cadence script against the execution state at the block with the given ID.

This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../cadence/json-cadence-spec.md).
This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../../cadence/json-cadence-spec.md).

```proto
rpc ExecuteScriptAtBlockID (ExecuteScriptAtBlockIDRequest) returns (ExecuteScriptResponse)
Expand Down Expand Up @@ -104,7 +104,7 @@ message ExecuteScriptResponse {

`ExecuteScriptAtBlockHeight` executes a ready-only Cadence script against the execution state at the given block height.

This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../cadence/json-cadence-spec.md).
This method can be used to read account state from the blockchain. The script is executed on an execution node and the return value is encoded using the [JSON-Cadence data interchange format](../../../cadence/json-cadence-spec.md).

```proto
rpc ExecuteScriptAtBlockHeight (ExecuteScriptAtBlockHeightRequest) returns (ExecuteScriptResponse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Once you complete a successful staking or delegation request, your tokens are se

## Is it possible to add multiple public keys to a given account/address so that it can be controlled by more than one private key?

Yes, accounts support multiple, weighted keys, [here](../../../cadence/language/accounts.mdx)
Yes, accounts support multiple, weighted keys, [here](../../../../cadence/language/accounts.mdx)
using `AuthAccount`’s `fun addPublicKey(_ publicKey: [UInt8])`and <br/>`fun removePublicKey(_ index: Int)` functions.

## How do keys and accounts work on Flow?
Expand All @@ -25,8 +25,8 @@ Accounts are created with associated keys. There can be multiple keys on an acco

FLOW supports a variety of signature schemes for adding keys to an account.

Details: [concepts/accounts-and-keys](../../../concepts/accounts.md)
Details: [concepts/accounts-and-keys](../../../../concepts/accounts.md)

## How do I create a Flow account if I do not have a service account?

Instructions to generate an address are here: [flow-go-sdk/creating-accounts](../../../tools/clients/flow-go-sdk/index.mdx#create-accounts). You don't need a service account.
Instructions to generate an address are here: [flow-go-sdk/creating-accounts](../../../../tools/clients/flow-go-sdk/index.mdx#create-accounts). You don't need a service account.
Loading

1 comment on commit f73cb4e

@vercel
Copy link

@vercel vercel bot commented on f73cb4e Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.