Skip to content

Commit

Permalink
Add information how to run Codex storage node
Browse files Browse the repository at this point in the history
  • Loading branch information
veaceslavdoina committed Sep 18, 2024
1 parent 00f047b commit adf438b
Showing 1 changed file with 53 additions and 13 deletions.
66 changes: 53 additions & 13 deletions learn/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ After node is up and running and port-forwarding configurations was done, we sho
> [!CAUTION]
> Please use mentioned key generation service for demo purpose only.

3. Specify marketplace address based on the [network](/networks/networks) you would like to join.
3. Specify bootstrap nodes and marketplace address based on the [network](/networks/networks) you would like to join.

4. Run the node
```shell
Expand All @@ -274,38 +274,78 @@ After node is up and running, you just need to fill-up your ethereum address (`c

#### Codex storage node

To be added :construction:
Codex [storage node](architecture#network-architecture) should be run by storage providers or in case you would like to sell your local storage. For that, we should use configuration for [Codex node with marketplace support](#codex-node-with-marketplace-support) and additionally use `prover` sub-command and required CLI options.

That sub-command will make Codex to listen for a proof request on the blockchain and answer them. To compute an answer for the proof request, Codex will use stored data and circuit files generated by the code in the [codex-storage-proofs-circuits](https://github.com/codex-storage/codex-storage-proofs-circuits) repository.

Every [network](/networks/networks) uses its own generated set of the files which are stored in the [codex-contracts-eth](https://github.com/codex-storage/codex-contracts-eth/tree/master/verifier/networks) repository and also uploaded to the CDN. Hash of the set is also known by the marketplace smart contract.

To download circuit files and make them available to Codex app, we have a stand-alone utility - `cirdl`. It can be compiled from the sources (`make cirdl`) or downloaded from the [GitHub release page](https://github.com/codex-storage/nim-codex/releases) (work in progress - [Rework circuit downloader #882](https://github.com/codex-storage/nim-codex/pull/882)).

You would need to pass a bootstrap nodes, blockchain RPC endpoint and marketplace address based on the [network](/networks/networks) you would like to join.

1. Download circuit files
```shell
# Create circuit files folder
mkdir -p ./datadir/circuit
# Download circuit files
cirdl \
./datadir/circuit \
https://rpc.testnet.codex.storage \
0xB119d28d3A1bFD281b23A0890B4c1B626EE8F6F0
```

2. Start Codex storage node
```shell
codex \
persistence \
prover \
--data-dir=./datadir \
--bootstrap-node=spr:CiUIAhIhAiJvIcA_ZwPZ9ugVKDbmqwhJZaig5zKyLiuaicRcCGqLEgIDARo8CicAJQgCEiECIm8hwD9nA9n26BUoNuarCEllqKDnMrIuK5qJxFwIaosQ3d6esAYaCwoJBJ_f8zKRAnU6KkYwRAIgM0MvWNJL296kJ9gWvfatfmVvT-A7O2s8Mxp8l9c8EW0CIC-h-H-jBVSgFjg3Eny2u33qF7BDnWFzo7fGfZ7_qc9P \
--nat=`curl -s https://ip.codex.storage` \
--disc-port=8090 \
--listen-addrs=/ip4/0.0.0.0/tcp/8070 \
--eth-provider=https://rpc.testnet.codex.storage \
--eth-private-key=eth.key \
--marketplace-address=0xB119d28d3A1bFD281b23A0890B4c1B626EE8F6F0
--circom-r1cs=./datadir/circuits/proof_main.r1cs
--circom-wasm=./datadir/circuits/proof_main.wasm
--circom-zkey=./datadir/circuits/proof_main.zkey
```

After node is up and running, you just need to fill-up your ethereum address (`cat eth.address`) with the tokens and then you should be able to [Create storage availability](https://github.com/codex-storage/codex-testnet-starter/blob/master/USINGCODEX.md#create-storage-availability).

### Run as a daemon in Linux

This functionality is not supported yet :construction:
This functionality is not supported yet :construction:

### Run as a service in Windows

This functionality is not supported yet :construction:
This functionality is not supported yet :construction:

### Using Docker

To be added :construction:
To be added :construction:

### Using Docker Compose

To be added :construction:
To be added :construction:

### Using Ansible

Planning :construction:
Planning :construction:

### On Kubernetes

To be added :construction:
To be added :construction:

Helm chart code is available in [helm-charts](https://github.com/codex-storage/helm-charts) repository, but chart was not published yet.
Helm chart code is available in [helm-charts](https://github.com/codex-storage/helm-charts) repository, but chart was not published yet.


## Known issues

1. Environment variables like `CODEX_BOOTSTRAP_NODE` and `CODEX_LISTEN_ADDRS` does not support multiple values. Please check [[Feature request] Support multiple SPR records via environment variable #525](https://github.com/codex-storage/nim-codex/issues/525), for more information.
2. Sub-commands configuration like `persistence` and `persistence prover` can't be done via environment variables for now.
3. [NAT traversal #753](https://github.com/codex-storage/nim-codex/issues/753) is not implemented yet and we would need to setup port-forwarding for discovery and transport protocols.
4. Please ignore `--eth-account` CLI option - [Drop support for --eth-account #727](https://github.com/codex-storage/nim-codex/issues/727).
1. Environment variables like `CODEX_BOOTSTRAP_NODE` and `CODEX_LISTEN_ADDRS` does not support multiple values. Please check [[Feature request] Support multiple SPR records via environment variable #525](https://github.com/codex-storage/nim-codex/issues/525), for more information.
2. Sub-commands configuration like `persistence` and `persistence prover` can't be done via environment variables for now.
3. [NAT traversal #753](https://github.com/codex-storage/nim-codex/issues/753) is not implemented yet and we would need to setup port-forwarding for discovery and transport protocols.
4. Please ignore `--eth-account` CLI option - [Drop support for --eth-account #727](https://github.com/codex-storage/nim-codex/issues/727).

0 comments on commit adf438b

Please sign in to comment.