0g-storage-node/doc/install.md
0g-peterzhb 2e1d076460
@peter/update submodule (#25)
* update modules
2024-03-12 18:49:51 +08:00

1.8 KiB

Install

ZeroGStorage requires Rust 1.71.0 and Go to build.

Install Rust

We recommend installing Rust through rustup.

  • Linux

    Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup install 1.65.0
    

    Other dependencies

    • Ubuntu
      sudo apt-get install clang cmake build-essential
      
  • Mac

    Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup install 1.65.0
    
    brew install llvm cmake
    
  • Windows
    Download and run the rustup installer from this link.
    Install LLVM, pre-built binaries can be downloaded from this link.

Install Go

  • Linux

    # Download the Go installer
    wget https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
    
    # Extract the archive
    sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
    
    # Add /usr/local/go/bin to the PATH environment variable by adding the following line to your ~/.profile.
    export PATH=$PATH:/usr/local/go/bin
    
  • Mac

    Download the Go installer from https://go.dev/dl/go1.19.3.darwin-amd64.pkg.
    Open the package file you downloaded and follow the prompts to install Go.

  • Windows
    Download the Go installer from https://go.dev/dl/go1.19.3.windows-amd64.msi.
    Open the MSI file you downloaded and follow the prompts to install Go.

Build from source

# Download code
$ git clone https://github.com/0glabs/0g-storage-node.git
$ cd 0g-storage-node
$ git submodule update --init

# Build in release mode
$ cargo build --release