/ learn / quick-start.md
quick-start.md
  1  # Quick Start
  2  
  3  To run Codex through this guide we would need to perform the following steps:
  4  - [Review the disclaimer](/codex/disclaimer)
  5  - [Get Codex binary](#get-codex-binary)
  6  - [Run Codex](#run-codex)
  7  - [Interact with Codex](#interact-with-codex)
  8  
  9  ## Get Codex binary
 10  
 11  For quick a 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).
 12  
 13  Please follow the steps for your OS from the list:
 14  - [Linux/macOS](#linux-macos)
 15  - [Windows](#windows)
 16  
 17  ### Linux/macOS
 18  
 19  1. Install latest Codex release
 20     ```shell
 21     curl -s https://get.codex.storage/install.sh | bash
 22     ```
 23  
 24  2. Install dependencies
 25     ```shell
 26     # Debian-based Linux
 27     sudo apt update && sudo apt install libgomp1
 28     ```
 29  
 30  3. Check the result
 31     ```shell
 32     codex --version
 33     ```
 34  
 35  ### Windows
 36  
 37  1. Install latest Codex release
 38     ```batch
 39      curl -sO https://get.codex.storage/install.cmd && install.cmd 
 40     ```
 41  
 42     > [!WARNING]
 43     > Windows antivirus software and built-in firewalls may cause steps to fail. We will cover some possible errors here, but always consider checking your setup if requests fail - in particular, if temporarily disabling your antivirus fixes it, then it is likely to be the culprit.
 44  
 45     If you see an error like:
 46  
 47     ```batch
 48     curl: (35) schannel: next InitializeSecurityContext failed: CRYPT_E_NO_REVOCATION_CHECK (0x80092012) - The revocation function was unable to check revocation for the certificate.
 49     ```
 50  
 51     You may need to add the `--ssl-no-revoke` option to your curl calls, i.e., modify the calls above so they look like this:
 52  
 53     ```batch
 54      curl -LO --ssl-no-revoke https://...
 55      ```
 56  
 57  2. Update path using console output
 58      - Current session only
 59        ```batch
 60        :: Default installation directory
 61        set "PATH=%PATH%%LOCALAPPDATA%\Codex;"
 62        ```
 63  
 64      - Update PATH permanently
 65        - Control Panel --> System --> Advanced System settings --> Environment Variables
 66        - Alternatively, type `environment variables` into the Windows Search box
 67  
 68  3. Check the result
 69     ```shell
 70     codex --version
 71     ```
 72  
 73  ## Run Codex
 74  
 75  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.
 76  
 77  0. Obtain an SPR of the Codex network you want to join.
 78  Go to [networks](/networks/networks) 
 79  
 80  1. Run Codex
 81  
 82     **Linux/macOS**
 83     ```shell
 84     codex \
 85       --data-dir=datadir \
 86       --disc-port=8090 \
 87       --listen-addrs=/ip4/0.0.0.0/tcp/8070 \
 88       --nat=any \
 89       --api-cors-origin="*" \
 90       --bootstrap-node=<SPR HERE>
 91     ```
 92  
 93     **Windows**
 94  
 95     > [!WARNING]
 96     > Windows might at this stage prompt you to grant internet access to Codex. You must allow it for things to work.
 97     > It also might be required to add incoming firewall rules for Codex and we can use `netsh` utility.
 98  
 99     <details>
100     <summary>add firewall rules using netsh</summary>
101  
102     ```batch
103     :: Add rules
104     netsh advfirewall firewall add rule name="Allow Codex (TCP-In)" protocol=TCP dir=in localport=8070 action=allow
105     netsh advfirewall firewall add rule name="Allow Codex (UDP-In)" protocol=UDP dir=in localport=8090 action=allow
106  
107     :: List rules
108     netsh advfirewall firewall show rule name=all | find /I "Codex"
109  
110     :: Delete rules
111     netsh advfirewall firewall delete rule name="Allow Codex (TCP-In)"
112     netsh advfirewall firewall delete rule name="Allow Codex (UDP-In)"
113     ```
114     </details>
115  
116     ```batch
117     :: Run Codex
118     codex ^
119       --data-dir=datadir ^
120       --disc-port=8090 ^
121       --listen-addrs=/ip4/0.0.0.0/tcp/8070 ^
122       --nat=any ^
123       --api-cors-origin="*" ^
124       --bootstrap-node=<SPR HERE>
125     ```
126  
127  2. Configure port-forwarding for the TCP/UDP ports on your Internet router
128     | Protocol | Service   | Port   |
129     | -------- | --------- | ------ |
130     | UDP      | Discovery | `8090` |
131     | TCP      | Transport | `8070` |
132  
133  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).
134  
135  ## Interact with Codex
136  
137  When your Codex node is up and running you can interact with it using [Codex App UI](https://app.codex.storage) for files sharing.
138  
139  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.
140  
141  ## Stay in touch
142  
143  Want to stay up-date, or looking for further assistance? Try our [discord-server](https://discord.gg/codex-storage).