Skip to main content

build.sh CLI: advanced usage and recipes


Summary of flags and advanced features

The build.sh CLI supports a number of advanced features to fine tune its behavior and participation in different scenarios.

--skip-credential-update


This flag is used to skip the prompt that asks you whether you want to update the existing env file.

Refer: 2.5 Using the build.sh script to reconfigure the node

--no-collector


This flag is used to skip the collector setup. Usually a build.sh run will setup the local collector by finding a free port, even if there is already a collector running on the same machine.

If you wish to run the snapshotter node by sharing the collector with another node, you can use this flag to skip the collector setup.

info

The environment file generated by build.sh will have the collector port set to 50051 by default, which means that with the no-collector flag, the snapshotter node will now attempt to connect to the collector running on port 50051 without attempting to start a new collector.

danger

This is to be attempted only if you are sure that the collector is already running for the same data market on which you are running the snapshotter node. Else it might submit your snapshots to the wrong sequencer, and your submissions will be rejected.

--data-market-contract-number


This flag corresponds to the data market choice you provide when you first ran the build.sh script.

Refer: 2.1 Setting up the snapshotter node

At the moment of writing this during the mainnet launch, the two data markets supported are

  • 1: Aave V3
  • 2: Uniswap V2 (default participation)

--docker-network-prune


This prunes any old docker networks that are no longer in use by earlier snapshotter lite nodes.

Recipe: Running multiple slot IDs for Uniswap V2 data market with the same local collector


This recipe is courtesy one of our Discord members, @kobra95.

Assuming you have 2 or more slot IDs to run to participate in the Uniswap V2 data market, you can use the --no-collector flag to share the collector with other nodes.

Step 1: Run the first snapshotter node

# go to home directory
cd ~

# clone the snapshotter node repo
git clone https://github.com/PowerLoom/snapshotter-lite-v2.git powerloom-mainnet1

# run new screen session
screen -R powerloom-mainnet1

# go to the repo directory
cd powerloom-mainnet1

# run the build.sh script
./build.sh --data-market-contract-number 2

# confirm everythingis running and detach from screen session with Ctrl+A+D

Step 2: Run the second and subsequent snapshotter nodes

tip
  • Ensure you have detached from the screen session after running each node with Ctrl+A+D.
  • Replace powerloom-mainnet2 with powerloom-mainnet3 and so on for more nodes.
# go to home directory
cd ~

# clone the snapshotter node repo
git clone https://github.com/PowerLoom/snapshotter-lite-v2.git powerloom-mainnet2

# run new screen session
screen -R powerloom-mainnet2

# go to the repo directory
cd powerloom-mainnet2

# run the build.sh script
./build.sh --data-market-contract-number 2 --no-collector

# confirm everythingis running and detach from screen session with Ctrl+A+D