diff --git a/docs/data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx b/docs/data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx index 829e52f17a..694902c407 100644 --- a/docs/data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx +++ b/docs/data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx @@ -6,7 +6,7 @@ order: 120 import { ExampleResponse } from "@site/src/components/ExampleResponse"; import { AttributeTable } from "@site/src/components/AttributeTable"; -Set, modify, or delete a data entry (name/value pair) for an account. +For more information on how to set, modify, or delete a data entry (`name:value` pair) for an account, see the [`manageData` operation](../../../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data). See the [`Manage Data` errors](../../../errors/result-codes/operation-specific/manage-data.mdx). diff --git a/docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx b/docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx index 43bbecf024..43092f08a8 100644 --- a/docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx +++ b/docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx @@ -21,12 +21,12 @@ The `getLedgerEntries` method returns the "values" (or "entries") for a given se The source of truth should always be the XDR defined in the protocol. `LedgerKey`s are a union type defined in [Stellar-ledger-entries.x](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger-entries.x#L600). There are 10 different forms a ledger key can take: -1. **Account:** holistically defines a Stellar account, including its balance, signers, etc. (see [Accounts](../../../../../learn/fundamentals/stellar-data-structures/accounts.mdx)) -2. **Trustline:** defines a balance line to a non-native asset issued on the network (see [`changeTrustOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#change-trust)) -3. **Offer:** defines an offer made on the Stellar DEX (see [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx)) -4. **Account Data:** defines key-value data entries attached to an account (see [`manageDataOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data)) -5. **Claimable Balance:** defines a balance that may or may not actively be claimable (see [Claimable Balances](../../../../../build/guides/transactions/claimable-balances.mdx)) -6. **Liquidity Pool:** defines the configuration of a native constant liquidity pool between two assets (see [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx)) +1. **Account:** holistically defines a Stellar account, including its balance, signers, etc. (_see_ [Accounts](../../../../../learn/fundamentals/stellar-data-structures/accounts.mdx)) +2. **Trustline:** defines a balance line to a non-native asset issued on the network (_see_ [`changeTrustOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#change-trust)) +3. **Offer:** defines an offer made on the Stellar DEX (_see_ [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx)) +4. **Account Data:** defines key-value data entries attached to an account (_see_ [`manageDataOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data)) +5. **Claimable Balance:** defines a balance that may or may not actively be claimable (_see_ [Claimable Balances](../../../../../build/guides/transactions/claimable-balances.mdx)) +6. **Liquidity Pool:** defines the configuration of a native constant liquidity pool between two assets (_see_ [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx)) 7. **Contract Data:** defines a piece of data being stored in a contract under a key 8. **Contract Code:** defines the Wasm bytecode of a contract 9. **Config Setting:** defines the currently active network configuration diff --git a/docs/learn/fundamentals/contract-development/storage/manage-data.mdx b/docs/learn/fundamentals/contract-development/storage/manage-data.mdx new file mode 100644 index 0000000000..079bd62f01 --- /dev/null +++ b/docs/learn/fundamentals/contract-development/storage/manage-data.mdx @@ -0,0 +1,20 @@ +--- +sidebar_position: 10 +title: Native Data +description: Associate information with a classic account. +--- + +You can manage data associated with [accounts](../../stellar-data-structures/accounts.mdx) using the [`ManageData` operation](../../transactions/list-of-operations.mdx#manage-data), no smart contract needed! The data entry uses up one account subentry, increasing base reserves. In exchange for this slight cost, you can retrieve an account with [user-defined](../../../../data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx) key-value pairs. + +Existing community projects use this field for [IPFS direction](https://docs.ipfs.tech/concepts/content-addressing/), verification attestations, and much more. The information shows up towards the end of a Horizon response for a base account URL: + +```curl +"signers": [ + { ... } +], +"data": { + "ipns": "azUxcXppNXVxdTVka2l0MjdnYzc4a2RmcWpneGxxaW9mdnBtOXFiY2NrZGtzbzVodHUxcWVjYnl5azQwY3o=", + "your": "value" +}, +"num_sponsoring": ... +``` diff --git a/docs/learn/fundamentals/contract-development/storage/persisting-data.mdx b/docs/learn/fundamentals/contract-development/storage/persisting-data.mdx index 57534f1682..75316aee9a 100644 --- a/docs/learn/fundamentals/contract-development/storage/persisting-data.mdx +++ b/docs/learn/fundamentals/contract-development/storage/persisting-data.mdx @@ -4,16 +4,6 @@ title: Persisting Data description: Store and access smart contract data. --- - - Store and access smart contract data. - - - - - ## Ledger entries Contracts can access ledger entries of type `CONTRACT_DATA`. Host functions are provided to probe, read, write, and delete `CONTRACT_DATA` ledger entries. diff --git a/docs/learn/fundamentals/contract-development/storage/state-archival.mdx b/docs/learn/fundamentals/contract-development/storage/state-archival.mdx index fe7ee4f681..9bd54edffb 100644 --- a/docs/learn/fundamentals/contract-development/storage/state-archival.mdx +++ b/docs/learn/fundamentals/contract-development/storage/state-archival.mdx @@ -4,16 +4,6 @@ title: State Archival description: Smart contract state archival. --- - - Smart contract state archival. - - - - - Contract data is made up of three different types: `Persistent`, `Temporary`, and `Instance`. In a contract, these are accessed with `env.storage().persistent()`, `env.storage().temporary()`, and `env.storage().instance()` respectively; see the [`storage()` docs](https://docs.rs/soroban-sdk/latest/soroban_sdk/storage/struct.Storage.html). Learn about choosing the right storage for your use case in this [How-To Guide](../../../../build/guides/storage/choosing-the-right-storage.mdx) and other state archival related guides [here](../../../../build/guides/archival). diff --git a/docs/learn/fundamentals/stellar-data-structures/accounts.mdx b/docs/learn/fundamentals/stellar-data-structures/accounts.mdx index 59868bf298..8e483083f9 100644 --- a/docs/learn/fundamentals/stellar-data-structures/accounts.mdx +++ b/docs/learn/fundamentals/stellar-data-structures/accounts.mdx @@ -46,7 +46,7 @@ Account data is stored in subentries, each of which increases an account’s min - Trustlines (includes traditional assets and pool shares) - Offers - Additional signers -- Data entries (includes data made with the `manageData` operation, not smart contract ledger entries) +- Data entries (includes data made with the [`manageData` function](../contract-development/storage/manage-data.mdx), not smart contract ledger entries) ## Trustlines diff --git a/docs/learn/fundamentals/transactions/list-of-operations.mdx b/docs/learn/fundamentals/transactions/list-of-operations.mdx index dec2d89543..1f77c85487 100644 --- a/docs/learn/fundamentals/transactions/list-of-operations.mdx +++ b/docs/learn/fundamentals/transactions/list-of-operations.mdx @@ -370,10 +370,12 @@ Transfers the XLM balance of an account to another account and removes the sourc ## Manage data -Sets, modifies, or deletes a data entry (name/value pair) that is attached to an account +Sets, modifies, or deletes a persistent data entry (`name:value` string pair) that is attached to an account. Learn more about entries and subentries: [Accounts section](../stellar-data-structures/accounts.mdx#subentries) +Learn more about ManageData's functionality: [Storage page](../contract-development/storage/manage-data.mdx) + **SDKs**: [JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.manageData) | [Java](https://github.com/lightsail-network/java-stellar-sdk/blob/master/src/main/java/org/stellar/sdk/operations/ManageDataOperation.java) | [Go](https://godoc.org/github.com/stellar/go-stellar-sdk/txnbuild#ManageData) **Threshold**: Medium **Result**: `ManageDataResult` diff --git a/routes.txt b/routes.txt index cb87aaf1ad..ad61645f49 100644 --- a/routes.txt +++ b/routes.txt @@ -491,6 +491,7 @@ /docs/learn/fundamentals/contract-development/overview /docs/learn/fundamentals/contract-development/rust-dialect /docs/learn/fundamentals/contract-development/storage +/docs/learn/fundamentals/contract-development/storage/manage-data /docs/learn/fundamentals/contract-development/storage/persisting-data /docs/learn/fundamentals/contract-development/storage/state-archival /docs/learn/fundamentals/contract-development/types