Arnaud 7065718e09
feat(marketplace): indicate that slot is being repaired when trying to download (#1083)
* Indicate that slot is being repaired when trying to download

* Fix tests

* Apply nph

* Calculate the repair collateral when adding the item into the queue

* Add slotCollateral calculation with getRequest cache and remove populationItem function

* Update with pricePerByte

* Simplify StorageAsk parameter

* Minor fixes

* Move cache request to another PR

* Rename SlotQueueItem collateral and required in init

* Use override func to optimise calls when the slot state is known

* Remove unused code

* Cosmetic change

* Use raiseMarketError helper

* Add exceptions to async pragma

* Cosmetic change

* Use raiseMarketError helper

* Let slotCollateral determines the slot sate

* Use configSync to avoid async pragma in onStorageRequested

* Add loadConfig function

* Add CatchableError to async pragma

* Add missing pragma raises errors

* Move loadConfig

* Avoid swallow CancelledError

* Avoid swallowing CancelledError

* Avoid swallowing CancelledError

* Update error messages

* Except MarketError instead of CatchableError

* Fix merge issue

* Log fatal when configuration cannot be loaded

* Propagate MarketError in slotCollateral

* Remove useless configSync

* Use result with explicit error

* Fix syntax

---------

Signed-off-by: Arnaud <arnaud@status.im>
2025-02-27 16:58:23 +00:00
2022-08-23 10:11:21 -06:00
2025-01-21 16:45:33 +01:00
2025-01-21 20:54:46 +00:00
2023-03-08 12:45:55 +01:00
2021-02-02 19:29:52 +01:00
2025-01-21 20:54:46 +00:00
2025-02-11 19:00:05 +00:00
2025-02-18 19:41:54 +00:00
2021-12-20 13:12:18 -06:00
2025-01-10 17:49:20 +01:00
2025-01-21 16:45:33 +01:00
2025-01-21 16:45:33 +01:00
2024-08-13 15:38:17 +00:00
2025-02-24 21:01:23 +00:00
2025-01-21 20:54:46 +00:00

Codex Decentralized Durability Engine

The Codex project aims to create a decentralized durability engine that allows persisting data in p2p networks. In other words, it allows storing files and data with predictable durability guarantees for later retrieval.

WARNING: This project is under active development and is considered pre-alpha.

License: Apache License: MIT Stability: experimental CI Docker Codecov Discord Docker Pulls

Build and Run

For detailed instructions on preparing to build nim-codex see Build Codex.

To build the project, clone it and run:

make update && make

The executable will be placed under the build directory under the project root.

Run the client with:

build/codex

Configuration

It is possible to configure a Codex node in several ways:

  1. CLI options
  2. Environment variables
  3. Configuration file

The order of priority is the same as above: CLI options --> Environment variables --> Configuration file.

Please check documentation for more information.

Guides

To get acquainted with Codex, consider:

API

The client exposes a REST API that can be used to interact with the clients. Overview of the API can be found on api.codex.storage.

Contributing and development

Feel free to dive in, contributions are welcomed! Open an issue or submit PRs.

Linting and formatting

nim-codex uses nph for formatting our code and it is requrired to adhere to its styling. If you are setting up fresh setup, in order to get nph run make build-nph. In order to format files run make nph/<file/folder you want to format>. If you want you can install Git pre-commit hook using make install-nph-commit, which will format modified files prior commiting them. If you are using VSCode and the NimLang extension you can enable "Format On Save" (eq. the nim.formatOnSave property) that will format the files using nph.

Description
Decentralized Storage
Readme
Languages
Nim 98.6%
Makefile 0.8%
Shell 0.5%