L1X Developer SDK
Get Started
Get Started
  • L1X VM SDK
    • L1X Native SDK for L1X VM
      • Set up Environment
        • Pre-Requisites
        • Installation
          • Install Cargo L1X
            • Ubuntu and Windows (WSL)
            • Mac (Intel and Silicon)
          • Install L1X CLI (Beta)
      • Build your First Smart Contract on L1X VM
        • Common Flags and Arguments
    • L1X CLI Methods
  • L1X EVM SDK
    • Pre-Requisites
    • Hardhat Installation & Deploy your First L1X EVM FT Contract
  • L1X Typescript SDK
    • L1X Library
      • L1X Typescript SDK
      • Account Methods
        • How to import wallet using mnemonic?
        • How to import wallet using private key?
      • Core Methods
        • How to get Account State?
        • How to get block information by block number?
        • How to get chain state?
        • How to get events?
        • How to get current nonce?
        • How to get account transactions?
        • How to get the transaction recipt?
        • How to broadcast transactions?
      • L1X VM Methods
        • How to deploy a VM contract?
        • How to initialise a VM contract?
        • How to make VM readonly calls?
        • How to make VM contract state changing calls?
      • L1X EVM Methods
        • How to initialise a smart contract?
        • How to make an EVM contract state changing call?
        • How to make EVM read only calls?
      • Other Methods
        • Native Token Methods
          • How to transfer native token?
          • How to get native token balance?
          • How to get signed payload for transfer?
        • Fungible Token Methods
          • How to create fungible tokens?
          • How to mint fungible token?
          • How to give approval to fungible token?
          • How to get fungible token attributes?
          • How to get a fungible token balance?
          • How to get an allowence of fungible tokens?
          • How to transfer fungible tokens?
          • How to use transfer from of fungible token?
        • Non-fungible Token Methods
          • How to Create a Non-Fungible Token?
          • How to mint a Non-Fungible Token?
          • How to get the balance of a Non-Fungible token?
          • How to get the attribute of a Non-Fungible token?
          • How to approve a spender to manage a specific Non-Fungible token?
          • How to set or revoke approval for a specific operator to manage all tokens of the sender?
          • How to get the owner of a Non-Fungible token by its ID?
          • How to Transfer a Non-Fungible token from one address to another?
          • How to burn an existing Non-Fungible Token?
  • Endpoints
  • Configuring MetaMask with L1X Network
Powered by GitBook
On this page
  • Overview
  • Pre-requisites
  • Create Project from a Template
  • Build Project
  1. L1X VM SDK
  2. L1X Native SDK for L1X VM
  3. Set up Environment
  4. Installation
  5. Install Cargo L1X

Mac (Intel and Silicon)

Overview

This guide outlines the steps to install the L1X Cargo plugin for Mac within the L1X SDK environment. The process includes setting up your environment, installing necessary tools, and configuring Cargo for L1X.

Pre-requisites

Install Homebrew

First, install Homebrew, which is necessary for managing packages on macOS.

/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

Install LLVM 15 (WASM to LLVM-IR Dependency by Inkwell)

LLVM version 15 is required, and it can be installed via Homebrew. Note that this is a keg-only version.

brew install llvm@15

Configure Environment Variables for LLVM 17

Since LLVM 15 is keg-only and not symlinked into /opt/homebrew, you'll need to adjust your environment variables to use LLVM 15 explicitly.

Set PATH for LLVM

This ensures that the system uses LLVM 17's binaries.

echo 'export PATH="/opt/homebrew/opt/llvm@15/bin:$PATH"' >> ~/.zshrc

Configure Compiler and Linker Flags

To use the bundled libc++, set the following LDFLAGS and include directory settings:

export LDFLAGS="-L/opt/homebrew/opt/llvm@15/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@15/lib/c++"
export LDFLAGS="-L/opt/homebrew/opt/llvm@15/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm@15/include"

Install LLVM 17 (To Build Object File)

LLVM version 17 is required, and it can be installed via Homebrew. Note that this is a keg-only version.

brew install llvm@17

Configure Environment Variables for LLVM 17

Since LLVM 17 is keg-only and not symlinked into /opt/homebrew, you'll need to adjust your environment variables to use LLVM 17 explicitly.

Set PATH for LLVM

This ensures that the system uses LLVM 17's binaries.

echo 'export PATH="/opt/homebrew/opt/llvm@17/bin:$PATH"' >> ~/.zshrc

Configure Compiler and Linker Flags

To use the bundled libc++, set the following LDFLAGS and include directory settings:

export LDFLAGS="-L/opt/homebrew/opt/llvm@17/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@17/lib/c++"
export LDFLAGS="-L/opt/homebrew/opt/llvm@17/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm@17/include"

Make LLVM17 as Default

brew link --overwrite llvm@17  # Makes LLVM 17 the default

Install Cargo L1X Plugin

The L1X plugin for Cargo is essential for managing L1X-specific tasks in your Rust projects.

cargo install cargo-l1x --force

Create Project from a Template

Use a template to quickly start a new project with pre-configured settings.

cargo l1x create some_project --template ft

Build Project

Navigate to your project directory and build the project to ensure everything is set up correctly.

cd some_project
cargo l1x build

In case you have any issues with the above pre-requisites, please install the below dependencies.

brew install pkg-config
brew install openssl
brew install zlib

PreviousUbuntu and Windows (WSL)NextInstall L1X CLI (Beta)

Last updated 11 months ago