简体   繁体   English

Solana 租金豁免说明

[英]Solana rent exempttion clarification

I want to understand Solana rent and it's relation to the CLI usage.我想了解 Solana 租金以及它与 CLI 使用的关系。 I understand the basics, that you need 2 years worth of rent in order to be rent-exempt but I have several questions in order to reach a better understanding:我了解基本情况,您需要 2 年的租金才能免租金,但为了更好地理解,我有几个问题:

I have wallet keypair keypair.json我有钱包密钥对 keypair.json

I run:我跑:

solana account keypair.json

Balance: 2.95953572 SOL 
Owner: 11111111111111111111111111111111
executable: false
Rent Epoch: 280 

Should I assume that rent is 280 lamports per.我是否应该假设租金是 280 盏灯。 Epoch?时代? Do I need to calculate this based on how many epochs in two year to figure out what sol is required for rent exempt?我是否需要根据两年内的多少个时期来计算这一点,以计算出免租所需的 sol? Isn't there an easier way simply find out rent-exempt requirements if I have the keypair file or even just the public key of an account?如果我有密钥对文件甚至只是帐户的公钥,难道没有更简单的方法可以简单地找出免租要求吗? Usage of "solana rent" command is confusing since I have no idea of the "data length" of my account. “solana rent”命令的使用令人困惑,因为我不知道我帐户的“数据长度”。

When running the following commands in order to create different types of accounts can I always assume that enough Sol is automatically put into the account for it to be rent-exempt?当运行以下命令以创建不同类型的帐户时,我是否可以始终假设有足够的 Sol 自动放入帐户以使其免租?

spl-token create-account
spl-token create-multisig

When creating a nonce account i'm required to specify the amount to put into the nonce account?创建 nonce 帐户时,我需要指定要放入 nonce 帐户的金额吗? If I'm using this nonce account temporarily for a multisig process how much SOL should I put in there?如果我暂时将此 nonce 帐户用于多重签名过程,我应该在其中放入多少 SOL?

solana create-nonce-account nonce-keypair.json 1

If you want to know how rent is calculated you can use the solana rent CLI command.如果您想知道租金是如何计算的,您可以使用solana rent CLI 命令。

For example, any account in the system that is not a data account (ie has no data requirement) will display the rent exempt minimal fee:例如,系统中任何不是data account (即没有数据要求)的账户都会显示租金豁免最低费用:

solana rent 0

Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000002439 SOL
Rent-exempt minimum: 0.00089088 SOL

For program data accounts (ie any account that is created to be owned by a program to read/write state to) will be a higher cost because of the storage needs.对于程序数据帐户(即创建为由程序拥有以读取/写入 state 到的任何帐户)由于存储需求将是更高的成本。 Let's assume your program stores a PublicKey (32 bytes) in an account, then rent for that account is calculated:假设您的程序在一个帐户中存储了一个 PublicKey(32 字节),然后计算该帐户的租金:

solana rent 32

Rent per byte-year: 0.00000348 SOL
Rent per epoch: 0.000003048 SOL
Rent-exempt minimum: 0.0011136 SOL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM