Getting Started

Complete Setup

Getting Started with AVS-SDK

Welcome to the Getting Started guide for AVS-SDK! This guide will help you set up the SDK on your machine and provide tips for different installation methods. Whether you're working on Linux, macOS, or Windows, AVS-SDK is easy to install via npm, yarn, pnpm, or bun. Alternatively, you can also clone the AVS-SDK repository directly from GitHub.

Prerequisites

To use AVS-SDK, ensure you have:

  • Node.js (v14.0 or later recommended) installed on your system.

  • Git installed if you’re opting for a clone installation.

To verify if Node.js is installed:

node -v

If Node.js is not installed, download and install it from Node.js official website.

Step 1: Install AVS-SDK

Method 1: Using npm

For most users, installing with npm is straightforward:

npm install avs-sdk

Method 2: Using yarn

If you prefer using yarn:

yarn add avs-sdk

Method 3: Using pnpm

For pnpm users:

pnpm add avs-sdk

Method 4: Using bun

To install with bun, make sure bun is installed and run:

bun add avs-sdk

Method 5: Git Clone

You can also directly clone the AVS-SDK repository from GitHub. This method is useful if you’d like the latest version or if you wish to explore and modify the code.

git clone https://github.com/Programmer-Shivansh/AVS-SDK
cd AVS-SDK
npm install

Step 2: Set Up for Different Operating Systems

Linux Installation Guide

  1. Install Node.js (if not already installed):

    • You can use a package manager like apt or dnf based on your Linux distribution. For example, on Debian/Ubuntu:

      sudo apt update
      sudo apt install nodejs npm
    • Alternatively, install Node.js via Node Version Manager (NVM).

  2. Install AVS-SDK:

    • Use one of the methods described above (e.g., npm install avs-sdk).

  3. Clone Setup:

    • If you prefer cloning from Git, run:

      git clone https://github.com/Programmer-Shivansh/AVS-SDK
      cd AVS-SDK
      npm install

macOS Installation Guide

  1. Install Node.js:

    • The easiest way on macOS is via brew:

      brew install node
  2. Install AVS-SDK:

    • Choose an installation method as shown above (e.g., yarn add avs-sdk).

  3. Clone Setup:

    • If cloning, execute:

      git clone https://github.com/Programmer-Shivansh/AVS-SDK
      cd AVS-SDK
      npm install

Windows Installation Guide

  1. Install Node.js:

    • Download the Windows installer from Node.js website and follow the setup instructions.

  2. Install AVS-SDK:

    • Open a terminal like PowerShell or the Command Prompt and install AVS-SDK (e.g., npm install avs-sdk).

  3. Clone Setup:

    • To clone the SDK from GitHub, open a Git-enabled terminal and run:

      git clone https://github.com/Programmer-Shivansh/AVS-SDK
      cd AVS-SDK
      npm install

Troubleshooting Installation Errors

Here are some common installation issues you might encounter and tips to resolve them:

1. Node Version Errors

If you encounter compatibility issues with the Node version, make sure to use v14.0 or higher. Using NVM (Node Version Manager) can be very helpful to switch Node versions quickly.

2. Permission Errors on Linux/macOS

Sometimes, Linux or macOS may require root privileges to install global packages. If you receive a permission error, try prefixing your command with sudo, like this:

sudo npm install -g avs-sdk

3. npm or yarn Not Found

Ensure that your package manager is installed and available in your system’s PATH. If it’s missing, re-install Node.js, which usually includes npm, or install yarn separately by following instructions on the Yarn website.

4. Installation Failure on Windows

If installation fails, try running your terminal as Administrator. Right-click on your terminal and select “Run as Administrator,” then retry the installation command.

5. Git-Related Issues

If you’re cloning and encounter a “command not found” error for git, install Git from Git's official website and ensure it’s accessible from the terminal.

Verifying Your Installation

After installing, you can confirm the SDK is correctly installed by running:

node -e "require('avs-sdk'); console.log('AVS-SDK is installed successfully!')"

Next Steps

Now that AVS-SDK is installed, you’re ready to explore its core features. In the next sections, we’ll guide you through setting up your first connection with the AVS Node Manager and using essential modules like AVSNode, AVSSmartContract, and more to start building decentralized services effortlessly.

Last updated