logos-storage-docs/learn/quick-start.md
Ben Bierens a86912bb74
Quick-start guide (#5)
* Remove unused entries. Links to codex-testnet-starter.

* Add steps to get Codex on Windows

---------

Co-authored-by: Slava <20563034+veaceslavdoina@users.noreply.github.com>
2024-09-16 13:08:10 +03:00

4.8 KiB

Quick start

To join the Codex testnet we would need to perform the following steps:

Get Codex binary

For quick start we will use precompiled binaries from GitHub release page. If you prefer to compile from the sources, please check Build Codex.

  1. Download binary and checksum for your platform/architecture

    Linux/macOS

    version=v0.1.3
    platform=$(echo `uname -s` | awk '{print tolower($0)}')
    architecture=$([[ `uname -m` == 'x86_64' ]] && echo amd64 || echo arm64)
    
    # Binary
    curl -LO https://github.com/codex-storage/nim-codex/releases/download/${version}/codex-${version}-${platform}-${architecture}.tar.gz
    
    # Checksum
    curl -LO https://github.com/codex-storage/nim-codex/releases/download/${version}/codex-${version}-${platform}-${architecture}.tar.gz.sha256
    

    Windows ::: warning For Windows, only amd64 architecture is supported now. :::

    set version=v0.1.3
    set platform=windows
    if %PROCESSOR_ARCHITECTURE%==AMD64 (set architecture=amd64) else (set architecture=arm64)
    
    :: Binary
    curl -LO https://github.com/codex-storage/nim-codex/releases/download/%version%/codex-%version%-%platform%-%architecture%-libs.zip
    
    :: Checksum
    curl -LO https://github.com/codex-storage/nim-codex/releases/download/%version%/codex-%version%-%platform%-%architecture%-libs.zip.sha256
    
  2. Verify checksum

    Linux

    sha256sum -c codex-${version}-${platform}-${architecture}.tar.gz.sha256
    

    macOS

    shasum -a 256 -c codex-${version}-${platform}-${architecture}.tar.gz.sha256
    

    Windows

    for /f "delims=" %a in ('certUtil -hashfile codex-%version%-%platform%-%architecture%-libs.zip SHA256 ^| findstr -vrc:"[^0123-9aAb-Cd-EfF ]"') do @set ACTUAL_HASH=%a
    for /f "tokens=1" %a in (codex-%version%-%platform%-%architecture%-libs.zip.sha256) do set EXPECTED_HASH=%a
    if %ACTUAL_HASH% == %EXPECTED_HASH% (echo. && echo codex-%version%-%platform%-%architecture%-libs.zip: OK) else (echo. && echo codex-%version%-%platform%-%architecture%-libs.zip: FAILED)
    

    Make sure you get OK in the result

    codex-v0.1.3-linux-amd64.tar.gz: OK
    
  3. Extract binary

    Linux/macOS

    tar -zxvf codex-${version}-${platform}-${architecture}.tar.gz
    
  4. Copy binary to the appropriate folder

    Linux/macOS

    sudo install codex-${version}-${platform}-${architecture} /usr/local/bin/codex
    

    Windows

    :: Extract binary and libraries to the appropriate folder
    if not exist %LOCALAPPDATA%\Codex mkdir %LOCALAPPDATA%\Codex
    tar -xvf codex-%version%-%platform%-%architecture%-libs.zip -C %LOCALAPPDATA%\Codex
    
    :: Rename binary
    move /Y %LOCALAPPDATA%\Codex\codex-%version%-%platform%-%architecture%.exe %LOCALAPPDATA%\Codex\codex.exe
    
    :: Add folder to the path permanently
    setx PATH %PATH%%LOCALAPPDATA%\Codex;
    
    :: Add folder to the path for the current session
    PATH %PATH%%LOCALAPPDATA%\Codex;
    
  5. Install dependencies

    # Debian-based Linux
    sudo apt update && sudo apt install libgomp1
    
  6. Check the result

    codex --version
    
    Codex version:  v0.1.3
    Codex revision: 89917d4
    Nim Compiler Version 1.6.14 [Linux: amd64]
    
  7. Cleanup

    Linux/macOS

    rm -f \
      codex-${version}-${platform}-${architecture} \
      codex-${version}-${platform}-${architecture}.tar.gz \
      codex-${version}-${platform}-${architecture}.tar.gz.sha256
    

    Windows

    del codex-%version%-%platform%-%architecture%-libs.zip ^
      codex-%version%-%platform%-%architecture%-libs.zip.sha256
    

Run Codex

To run your Codex node and join the testnet, follow the steps in the codex-testnet-starter.

If you want to run Codex locally without joining the testnet, consider trying the two-client-test or the marketplace-test.

Interact with Codex

When your Codex node is up and running you can interact with it using Codex API.

For a walk-through of the API, consider following the using-codex guide.

Stay in touch

Want to stay up-date, or looking for further assistence? Try our discord-server.