Skip to content

Local Setup

Prabal Banerjee edited this page May 18, 2021 · 1 revision

Setting up Polygon Avail locally

Run the DA chain

  1. Get rust and other dependencies by following the instructions.
  2. Clone the da-poc branch of our forked Substrate repo.
    git clone https://github.com/maticnetwork/substrate.git
    git checkout da-poc
    
  3. Compile the substrate code. (Warning: This might take some time!)
    cd bin/node-template/node
    cargo build --release
    
  4. Run a local dev node with temporary datastore.
    cd ../../..
    ./target/release/node-template --dev --tmp
    
    You should see a chain running with blocks getting generated. If you want to host a private network, please follow the substrate docs.

Run the Light Client (Optional)

  1. Download and install prerequisites like node and npm. (We tested with npm version 7.0.15 and node version 15.4.0)
  2. Fetch the code from the repo
    git clone https://github.com/maticnetwork/da-light-client.git
    
  3. Follow the repo README to setup and run the light client.

Connect the chain and light client to the explorer (Optional)

  1. Visit our explorer (or host you own from this repo)
  2. On the sidebar, input the custom DA node address under Development (default ws://127.0.0.1:9944) and custom light client address (default http://127.0.0.1:7000/v1/json-rpc).

You can now use your local setup through both the explorer or directly. Please refer to this doc for how to use our DA chain.