2025-04-14 16:54:35 +02:00
|
|
|
# Codex Factory
|
2024-08-20 16:10:44 -07:00
|
|
|
|
2025-05-07 16:37:54 +02:00
|
|
|
[](https://oclif.io)
|
2025-05-12 16:44:07 +02:00
|
|
|
[](https://npmjs.org/package/codex-factory)
|
|
|
|
|
[](https://npmjs.org/package/codex-factory)
|
2025-04-14 16:54:35 +02:00
|
|
|
[](https://github.com/codex-storage/codex-factory/actions/workflows/test.yaml)
|
|
|
|
|

|
2025-05-07 16:37:54 +02:00
|
|
|

|
2021-04-23 16:16:35 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
> CLI tool to spin up Docker cluster of Codex nodes for advanced testing and/or development
|
2021-04-23 16:16:35 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## Table of Contents
|
2021-04-29 14:20:43 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
- [Install](#install)
|
|
|
|
|
- [Usage](#usage)
|
|
|
|
|
- [Contribute](#contribute)
|
|
|
|
|
- [License](#license)
|
2021-04-23 16:16:35 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## Install
|
2021-04-23 16:16:35 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
**Requirements:** Docker
|
2021-04-23 16:16:35 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
```shell
|
2025-05-12 16:44:07 +02:00
|
|
|
$ npm install -g codex-factory
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can also use this CLI directly thanks to `npx` without installing it:
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
$ npx codex-factory start 0.2.0
|
2021-04-23 16:16:35 +02:00
|
|
|
```
|
|
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## Usage
|
2022-01-14 09:40:42 +01:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
```shell
|
2025-04-14 16:54:35 +02:00
|
|
|
# This spins up the cluster for specific Codex version and exits
|
|
|
|
|
$ codex-factory start --detach 0.2.0
|
2021-06-03 18:15:11 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
# The spins up the cluster using Codex version configured in external places. See below for options where to place it.
|
|
|
|
|
$ codex-factory start --detach
|
2022-05-05 13:36:55 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
# This attaches to the client container and displays its logs
|
|
|
|
|
$ codex-factory logs client --follow
|
2021-06-03 18:15:11 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
# This stops the cluster and keeping the containers so next time they are spinned up the data are kept
|
|
|
|
|
# but data are not persisted across version's bump!
|
2025-04-14 16:54:35 +02:00
|
|
|
$ codex-factory stop
|
2021-06-03 18:15:11 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
# You can also spin up the cluster without the --detach which then directly
|
2025-04-14 16:54:35 +02:00
|
|
|
# attaches to the client logs and the cluster is terminated upon SIGINT (Ctrl+C)
|
|
|
|
|
$ codex-factory start 0.2.0
|
|
|
|
|
|
|
|
|
|
# You can spin cluster with the last nim-codex's master build - this might not work!
|
|
|
|
|
$ codex-factory start latest
|
|
|
|
|
|
|
|
|
|
# You can spin cluster with the specific Git commit nim-codex's master build - this might not work!
|
|
|
|
|
$ codex-factory start ce2db15
|
2021-06-03 18:15:11 +02:00
|
|
|
```
|
|
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
For more details see the `--help` page of the CLI and its commands.
|
2021-06-03 18:15:11 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
### External Codex version configuration
|
2022-05-05 13:36:55 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
You can omit the Codex version argument when running `codex-factory start` command if you specify it in one of the expected places:
|
2022-05-05 13:36:55 +02:00
|
|
|
|
2025-05-07 16:37:54 +02:00
|
|
|
- `CODEX_FACTORY_VERSION` env. variable
|
|
|
|
|
- `package.json` placed in current working directory (cwd) under the `engines.codex` property.
|
|
|
|
|
- `.codexfactory.json` placed in current working directory (cwd) with property `version`.
|
2022-05-05 13:36:55 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
#### Build versions
|
2022-05-05 11:36:49 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
Docker images are built upon every push to `nim-codex`'s `master` branch, so if you need to test some specific commit
|
|
|
|
|
you can then use its short Git commit hash in order to spin Codex's factory cluster. But be aware that this might not
|
|
|
|
|
work as Codex factory is maintained based on the released versions and hence if there were some changes in configuration
|
|
|
|
|
parameters in the build you want to use, Codex factory might not yet support it.
|
2022-05-05 11:36:49 +02:00
|
|
|
|
2022-06-06 14:10:26 +02:00
|
|
|
#### Latest versions
|
|
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
There is special Codex Factory image tag `latest` that has the latest Codex's master build.
|
2022-06-06 14:10:26 +02:00
|
|
|
It is not recommended using this tag unless you need to test some upcoming feature and know what are you doing.
|
2025-04-14 16:54:35 +02:00
|
|
|
There is high chance that there might be some change in Codex that is not compatible with current Codex Factory and so it might not even work.
|
2022-06-06 14:10:26 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## Contribute
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
There are some ways you can make this module better:
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
- Consult our [open issues](https://github.com/codex-storage/codex-factory/issues) and take on one of them
|
|
|
|
|
- Something not working - create issue!
|
|
|
|
|
- See something to tweak - create PR!
|
|
|
|
|
- Join us in our [Discord chat](https://discord.gg/codex-storage) if you have questions or want to give feedback
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
### Developing
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
You can run the CLI while developing using `npm start -- <command> ...`.
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## Maintainers
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
- [AuHau](https://github.com/auhau)
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2022-04-29 15:51:09 +02:00
|
|
|
## License
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2025-05-07 16:37:54 +02:00
|
|
|
[BSD-3-Clause](LICENSE)
|
2021-05-17 11:03:36 +02:00
|
|
|
|
2025-04-14 16:54:35 +02:00
|
|
|
Originally written for Swarm's Bee client: https://github.com/ethersphere/bee-factory
|