Fetching/estimating upload cost #220

Closed
opened 2025-12-28 17:18:47 +00:00 by sami · 4 comments
Owner

Originally created by @Abhimanyu121 on GitHub (Jun 21, 2021).

Is your feature request related to a problem? Please describe.
We are building a tool around Neofs and we want to know the cost of putting files on Neofs for our tool to work in a good way.

Describe the solution you'd like
Neofs cli currently have no way to estimate upload cost and having something like this will solve our problem and it will help others as well. If we can get the cost of uploading after the file is uploaded in the logs, it would be an even more helpful solution for us.

Describe alternatives you've considered
Some API endpoint can also work which will give us the cost of uploading a file to the network right after it is uploaded, although if all the data can come from one tool/point(NeoFs cli) it would be a better solution for us.

Originally created by @Abhimanyu121 on GitHub (Jun 21, 2021). **Is your feature request related to a problem? Please describe.** We are building a tool around Neofs and we want to know the cost of putting files on Neofs for our tool to work in a good way. **Describe the solution you'd like** Neofs cli currently have no way to estimate upload cost and having something like this will solve our problem and it will help others as well. If we can get the cost of uploading after the file is uploaded in the logs, it would be an even more helpful solution for us. **Describe alternatives you've considered** Some API endpoint can also work which will give us the cost of uploading a file to the network right after it is uploaded, although if all the data can come from one tool/point(NeoFs cli) it would be a better solution for us.
sami 2025-12-28 17:18:47 +00:00
Author
Owner

@alexvanin commented on GitHub (Jun 22, 2021):

Cost estimation will be quite useful, indeed. I am not sure if it should be a part of NeoFS CLI or other app \ service, though.

To estimate container cost you need to get container, network map, basic income fee and object size to store. NeoFS CLI only sends request to NeoFS nodes, therefore I see two options.

  1. Control service, accessible from NeoFS CLI, provides RPC to estimate costs.
  2. Other CLI application \ service accesses side chain data directly and does all calculations locally.

Control service is not a part of NeoFS API specification, so some nodes will support it, some not. As for separate app \ service, it can be reused for other financial operations, e.g. it can also provide transfer details of NeoFS balance.

@alexvanin commented on GitHub (Jun 22, 2021): Cost estimation will be quite useful, indeed. I am not sure if it should be a part of NeoFS CLI or other app \ service, though. To estimate container cost you need to get container, network map, basic income fee and object size to store. NeoFS CLI only sends request to NeoFS nodes, therefore I see two options. 1. Control service, accessible from NeoFS CLI, provides RPC to estimate costs. 2. Other CLI application \ service accesses side chain data directly and does all calculations locally. Control service is not a part of NeoFS API specification, so some nodes will support it, some not. As for separate app \ service, it can be reused for other financial operations, e.g. it can also provide transfer details of NeoFS balance.
Author
Owner

@rekpero commented on GitHub (Jun 23, 2021):

Our app needs to generate payment for hosting. As per neo-fs, the payment works in Epoch. So it would be great to have a separate service (SDK or API) that can perform both cost estimation as well as payment trigger whenever a payment is done for hosting files in a container. The payment trigger can be event or webhook-based, where the container id the gas cost required to continue maintaining the files are mentioned. Our service can listen to these events and cut fees from the user using our smart contract.

Also, it would be great to have something like a time attribute that the user can specify. For e.g. if a user wants to upload his files to a container for just a 1 month period or 1 epoch, they can specify it during the upload through the attribute and once the time period completes, the container will self-destruct and the node will drop his file automatically. Not sure if this can be possible 🤔

@rekpero commented on GitHub (Jun 23, 2021): Our app needs to generate payment for hosting. As per neo-fs, the payment works in `Epoch`. So it would be great to have a separate service (SDK or API) that can perform both cost estimation as well as payment trigger whenever a payment is done for hosting files in a container. The payment trigger can be event or webhook-based, where the container id the gas cost required to continue maintaining the files are mentioned. Our service can listen to these events and cut fees from the user using our smart contract. Also, it would be great to have something like a time attribute that the user can specify. For e.g. if a user wants to upload his files to a container for just a 1 month period or 1 epoch, they can specify it during the upload through the attribute and once the time period completes, the container will self-destruct and the node will drop his file automatically. Not sure if this can be possible 🤔
Author
Owner

@alexvanin commented on GitHub (Jun 23, 2021):

if a user wants to upload his files to a container for just a 1 month period or 1 epoch, they can specify it during the upload through the attribute and once the time period completes, the container will self-destruct and the node will drop his file automatically

NeoFS supports expiration epoch attribute in objects. It won't delete the container, but object will be dropped by local garbage collector on storage nodes.

@alexvanin commented on GitHub (Jun 23, 2021): > if a user wants to upload his files to a container for just a 1 month period or 1 epoch, they can specify it during the upload through the attribute and once the time period completes, the container will self-destruct and the node will drop his file automatically NeoFS supports [expiration epoch attribute](https://github.com/nspcc-dev/neofs-api/blob/030c59ccbae04d9717c40e6562f8a6de2f729d4e/object/types.proto#L116) in objects. It won't delete the container, but object will be dropped by local garbage collector on storage nodes.
Author
Owner

@roman-khimov commented on GitHub (May 19, 2025):

https://fs.neo.org/pricing/ should be sufficient for now if we're talking about estimations. Real transfers can then be watched over in FS chain.

@roman-khimov commented on GitHub (May 19, 2025): https://fs.neo.org/pricing/ should be sufficient for now if we're talking about estimations. Real transfers can then be watched over in FS chain.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-node#220
No description provided.