Guide to Run LayerEdge Node on Your Windows & MacOs Local Network

Guide to Run LayerEdge Node on Your Windows & MacOs Local Network

LayerEdge Node Tutorial

Guide to Run LayerEdge on WSL (Windows Subsystem for Linux)

This guide walks you through the steps to send a ZK proof to the LayerEdge network on a Bitcoin Testnet using ZeroMQ and Go programming language on WSL (Windows Subsystem for Linux). The process will allow you to send data, like ZK proofs, via ZeroMQ socket and test the proof aggregation layer.

Prerequisites

Before starting, ensure that you have the following installed:

  1. Go Programming Language (version 1.16 or later)

  2. ZeroMQ and CZMQ Libraries on your WSL environment

  3. Git to clone the repository

Step 1: Install WSL on Windows

  1. Open PowerShell as Administrator and run the following command:

     wsl --install
    
  2. Restart your system if prompted.

  3. After installation, you will need to install a Linux distribution (e.g., Ubuntu) from the Microsoft Store. Once installed, you can access WSL by running wsl in the command line.

Step 2: Install Dependencies on WSL

1. Install Go Programming Language

  1. Download the latest Go version from Go's official website.

  2. On WSL (Ubuntu), run the following command to install Go:

     sudo apt update
     sudo apt install golang-go
    

2. Install ZeroMQ and CZMQ Libraries

  1. Install the necessary dependencies using these commands:

     sudo apt-get update
     sudo apt-get install -y libzmq3-dev libczmq-dev pkg-config
    

3. Install Git

  1. Install Git if it's not already installed:

     sudo apt-get install git
    

Step 3: Clone the Repository

Clone the verification-layer-tester repository to your local machine:

git clone https://github.com/layer-edge/verification-layer-tester.git cd verification-layer-tester

Step 4: Install Go Package for ZeroMQ

In the verification-layer-tester directory, install the required Go package:

go get gopkg.in/zeromq/goczmq.v4

Step 5: Build the Program

  1. Use the build.sh script to compile the program:

     ./build.sh
    
  2. This will compile the sample.go file and produce an executable named sample.

Step 6: Run the Program

Now that everything is set up, you can run the program using run.sh.

Using a Proof File

If you have a proof file (e.g., proof.json), you can provide it as an argument :

./run.sh proof.json

Manual Input

Alternatively, you can input the proof data manually by running:

./run.sh

Then, when prompted, paste your proof data (type anything) and press Enter.

Using the Default Proof

If you press Enter without typing anything, the program will use a default proof value from sample.go.

Step 7: Check the Proof Submission

Once the proof is submitted, you can check the status by visiting:

LayerEdge DevNet Explorer

Search for the proof hash to locate the batch, and wait for the Bitcoin Testnet settlement hash to be updated when the next block is mined.

Troubleshooting

Here are common issues and their solutions:

  1. pkg-config not found:

    • Ensure that pkg-config is installed and correctly added to the path:

        sudo apt-get install -y pkg-config
      
  2. Cannot Connect to Endpoint:

    • Make sure the endpoint in sample.go is correct:

      • Replace tcp://34.71.52.251:40000 with a valid endpoint if necessary.
  3. Permission Denied:

    • Ensure that build.sh and run.sh scripts are executable:

        chmod +x build.sh run.sh
      
  4. ZeroMQ Issues:

    • Verify that ZeroMQ and CZMQ are properly installed:

        pkg-config --modversion libzmq
        pkg-config --modversion libczmq
      

Now you've successfully set up and run the LayerEdge proof submission using Go and ZeroMQ on WSL. If you encounter any issues comment them below I try to solve as much as I can and relay the ones I can’t solve to the LayerEdge team.

Your LayerEdge Node is running when you see the following Static text.

Running the sample program...
Enter proof data (or press Enter to use default): "YOUR PROOF"
Proof sent: [proofblock "YOUR PROOF" !!!!!]

Follow Metischarter on Twitter for more Update…

Guide to Run LayerEdge on macOS

This guide will walk you through sending a ZK proof to the LayerEdge network on a Bitcoin Testnet using ZeroMQ and Go programming language on macOS. The process involves sending data, such as ZK proofs, via ZeroMQ socket and testing the proof aggregation layer.

Prerequisites

Before starting, ensure that you have the following installed:

  1. Go Programming Language (version 1.16 or later)

  2. ZeroMQ and CZMQ Libraries

  3. Git to clone the repository

Step 1: Install Homebrew

Homebrew is a package manager for macOS that simplifies the installation of software.

  1. Open Terminal from Applications > Utilities.

  2. Install Homebrew by running the following command:

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

    Follow the on-screen instructions. You may be prompted to enter your password.

  3. Verify Homebrew installation:

     brew --version
    

Step 2: Install Dependencies

1. Install Go Programming Language

  1. Install Go via Homebrew:

     brew install go
    
  2. Check that Go is installed correctly:

     go version
    

2. Install ZeroMQ and CZMQ Libraries

Use Homebrew to install pkg-config, ZeroMQ, and CZMQ:

brew update
brew install pkg-config
brew install zeromq
brew install czmq

3. Install Git

If Git is not already installed, you can install it with Homebrew:

brew install git

Step 3: Clone the Repository

Clone the verification-layer-tester repository to your local machine:

git clone https://github.com/layer-edge/verification-layer-tester.git
cd verification-layer-tester

Step 4: Install Go Package for ZeroMQ

Inside the verification-layer-tester directory, install the required Go package for ZeroMQ:

go get gopkg.in/zeromq/goczmq.v4

Step 5: Build the Program

  1. Build the program by using the provided build.sh script:

     ./build.sh
    
  2. This will compile the sample.go file and generate an executable named sample.

Step 6: Run the Program

Now that everything is set up, you can run the program using the run.sh script.

Using a Proof File

If you have a proof file (e.g., proof.json), you can provide it as an argument:

./run.sh proof.json

Manual Input

Alternatively, you can input the proof data manually by running:

./run.sh

When prompted, paste your proof data and press Enter.

Using the Default Proof

If you press Enter without typing anything, the program will use a default proof value from sample.go.

Step 7: Check the Proof Submission

Once the proof is submitted, you can check the status by visiting:

LayerEdge DevNet Explorer

Search for the proof hash to locate the batch, and wait for the Bitcoin Testnet settlement hash to be updated when the next block is mined.

Troubleshooting

Here are common issues and their solutions:

  1. pkg-config not found:

    • Ensure pkg-config is installed by running:

        brew install pkg-config
      
  2. Cannot Connect to Endpoint:

    • Make sure the endpoint in sample.go is correct:

      • Replace tcp://34.71.52.251:40000 with a valid endpoint if necessary.
  3. Permission Denied:

    • Ensure that build.sh and run.sh scripts are executable:

        chmod +x build.sh run.sh
      
  4. ZeroMQ Issues:

    • Verify that ZeroMQ and CZMQ are properly installed by checking their versions:

        pkg-config --modversion libzmq
        pkg-config --modversion libczmq
      

You have now set up and run the LayerEdge proof submission using Go and ZeroMQ on macOS. If you run into any issues,comment below I will try to solve as much as I can or relay your problem to the team

Your LayerEdge Node is running when you see the following Static text.

Running the sample program...
Enter proof data (or press Enter to use default): "YOUR PROOF"
Proof sent: [proofblock "YOUR PROOF" !!!!!]

Follow Metischarter on Twitter for more Update…

Did you find this article valuable?

Support 0XFARMER by becoming a sponsor. Any amount is appreciated!