Update Run Codex and other refactoring (#14)

This commit is contained in:
Slava 2024-09-27 22:31:39 +03:00 committed by GitHub
parent a92512370d
commit 38d58c1958
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,12 @@
# Quick start
To join the Codex testnet we would need to perform the following steps:
To run Codex through this guide we would need to perform the following steps:
- [Review the disclaimer](/codex/disclaimer)
- [Get Codex binary](#get-codex-binary)
- [Run Codex](#run-codex)
- [Interact with Codex](#interact-with-codex)
### Get Codex binary
## Get Codex binary
For quick start we will use precompiled binaries from [GitHub release page](https://github.com/codex-storage/nim-codex/releases). If you prefer to compile from the sources, please check [Build Codex](/learn/build).
@ -14,7 +14,7 @@
- [Linux/macOS](#linux-macos)
- [Windows](#windows)
#### Linux/macOS
### Linux/macOS
1. Download binary and checksum for your platform/architecture
```shell
@ -80,7 +80,7 @@
codex-${version}-${platform}-${architecture}.tar.gz.sha256
```
#### Windows
### Windows
1. Download binary and checksum for your platform/architecture
::: warning
@ -147,18 +147,60 @@
codex-%version%-%platform%-%architecture%-libs.zip.sha256
```
### Run Codex
## Run Codex
To run your Codex node and join the testnet, follow the steps in the [codex-testnet-starter](https://github.com/codex-storage/codex-testnet-starter/blob/master/SETUP_HOME.md).
We may [run Codex in different modes](/learn/run#run), and for a quick start we will run [Codex node](/learn/run#codex-node), to be able to share files in the network.
If you want to run Codex locally without joining the testnet, consider trying the [two-client-test](https://github.com/codex-storage/nim-codex/blob/master/docs/TwoClientTest.md) or the [marketplace-test](https://github.com/codex-storage/nim-codex/blob/master/docs/Marketplace.md).
1. Run Codex
### Interact with Codex
**Linux/macOS**
```shell
codex \
--data-dir=datadir \
--disc-port=8090 \
--listen-addrs=/ip4/0.0.0.0/tcp/8070 \
--nat=`curl -s https://ip.codex.storage` \
--api-cors-origin="*" \
--bootstrap-node=spr:CiUIAhIhAiJvIcA_ZwPZ9ugVKDbmqwhJZaig5zKyLiuaicRcCGqLEgIDARo8CicAJQgCEiECIm8hwD9nA9n26BUoNuarCEllqKDnMrIuK5qJxFwIaosQ3d6esAYaCwoJBJ_f8zKRAnU6KkYwRAIgM0MvWNJL296kJ9gWvfatfmVvT-A7O2s8Mxp8l9c8EW0CIC-h-H-jBVSgFjg3Eny2u33qF7BDnWFzo7fGfZ7_qc9P
```
When your Codex node is up and running you can interact with it using [Codex API](/developers/api).
**Windows**
```batch
:: Get Public IP
for /f "delims=" %a in ('curl -s https://ip.codex.storage') do @set nat=%a
For a walk-through of the API, consider following the [using-codex](https://github.com/codex-storage/codex-testnet-starter/blob/master/USINGCODEX.md) guide.
:: Run
codex ^
--data-dir=datadir ^
--disc-port=8090 ^
--listen-addrs=/ip4/0.0.0.0/tcp/8070 ^
--nat=%nat% ^
--api-cors-origin="*" ^
--bootstrap-node=spr:CiUIAhIhAiJvIcA_ZwPZ9ugVKDbmqwhJZaig5zKyLiuaicRcCGqLEgIDARo8CicAJQgCEiECIm8hwD9nA9n26BUoNuarCEllqKDnMrIuK5qJxFwIaosQ3d6esAYaCwoJBJ_f8zKRAnU6KkYwRAIgM0MvWNJL296kJ9gWvfatfmVvT-A7O2s8Mxp8l9c8EW0CIC-h-H-jBVSgFjg3Eny2u33qF7BDnWFzo7fGfZ7_qc9P
```
### Stay in touch
::: tip
In the example above we use [Codex Testnet](/networks/testnet#bootstrap-nodes) bootstrap nodes and thus we join Testnet. If you would like to join a different network, please use [appropriate value](/networks/networks).
:::
2. Configure port-forwarding for the TCP/UDP ports on your Internet router
| Protocol | Service | Port |
| -------- | --------- | ------ |
| UDP | Discovery | `8090` |
| TCP | Transport | `8070` |
If you would like to purchase or sell storage, please consider to run [Codex node with marketplace support](/learn/run#codex-node-with-marketplace-support) or [Codex storage node](/learn/run#codex-storage-node).
## Interact with Codex
When your Codex node is up and running you can interact with it using [Codex Marketplace UI](https://marketplace.codex.storage) for files sharing.
Also, you can interact with Codex using [Codex API](/developers/api) and for a walk-through of the API, consider following the [Using Codex](/learn/using) guide.
## Stay in touch
Want to stay up-date, or looking for further assistance? Try our [discord-server](https://discord.gg/codex-storage).
Ready to explore Codex functionality? Please [Join Codex Testnet](/networks/testnet).
If you want to run Codex locally without joining the Testnet, consider trying the [two-client-test](https://github.com/codex-storage/nim-codex/blob/master/docs/TwoClientTest.md) or the [marketplace-test](https://github.com/codex-storage/nim-codex/blob/master/docs/Marketplace.md).