WSL Setup
Windows Subsystem for Linux (WSL) provides a seamless way to run a Linux environment on Windows, enabling developers to work with Flexo SDK efficiently. This guide walks you through setting up WSL, installing dependencies, and running Flexo SDK on your Windows machine.
Prerequisites
Before installing Flexo SDK on WSL, ensure you have:
Windows 10 (version 2004+) or Windows 11
WSL 2 installed and configured
Node.js and npm (or yarn) installed in WSL
Step 1: Install WSL
If you haven’t already set up WSL, install it using the following command in PowerShell (Admin):
wsl --installThis will:
Enable WSL 2
Install Ubuntu (default distribution)
To check the installed version, run:
wsl --list --verboseIf WSL is already installed but not using WSL 2, upgrade it:
wsl --set-version Ubuntu 2Step 2: Set Up Your Development Environment
- Update Ubuntu
Once WSL is installed, open Ubuntu from the Start Menu and update the system:
sudo apt update && sudo apt upgrade -y- Install Node.js and npm
To install Node.js (LTS) and npm, run:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejsVerify installation:
node -v
npm -vAlternatively, you can use nvm (Node Version Manager) for managing multiple Node.js versions:
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18Step 3: Install Flexo SDK
With Node.js and Solana CLI installed, you can now install Flexo SDK:
npm install flexo-sdk
# or
yarn add flexo-sdkStep 4: Run Flexo SDK
Now you can start using Flexo SDK inside WSL.
Example: Token Analysis
import FlexoClient from 'flexo-sdk';
async function analyzeToken(address: string) {
const client = new FlexoClient();
const analysis = await client.getToken(address);
console.log(`Token Score: ${analysis.data.score}`);
}
analyzeToken('your-token-address');Run the script with:
node script.jsLast updated