Configuration

mkdir ~/.sf_sui && mkdir ~/.sf_sui/sui_config && mkdir ~/.sf_sui/bin && mkdir ~/.sf_sui/firehose
curl -L <https://raw.githubusercontent.com/Apocentre/firehose-sui/main/devel/mainnet/config/full_node.yaml> -o ~/.sf_sui/sui_config/full_node.yaml
curl -L <https://github.com/Apocentre/firehose-sui/raw/main/devel/mainnet/config/genesis.blob> -o ~/.sf_sui/sui_config/genesis.blob
curl -L <https://raw.githubusercontent.com/Apocentre/firehose-sui/main/devel/mainnet/indexer.yaml> -o ~/.sf_sui/firehose/indexer.yaml
curl -L <https://raw.githubusercontent.com/Apocentre/firehose-sui/main/devel/mainnet/firehose.yaml> -o ~/.sf_sui/firehose/firehose.yaml

Replace the the path /Users/ppoliani/ with the home directory of your system. It should be /Users/<user> on Mac and /home/<user> on linux where <user> is your system username.

These values are part of the db-path and genesis-file-location fields in the ~/sf_sui/sui_config/full_node.yaml`` and --sui-node-configin~/.sf_sui/firehose/indexer.yaml`.

Binaries

  1. Download the SUI client

    1. Download the latest mainnet version of the sui client from https://github.com/MystenLabs/sui/releases/tag/mainnet-v1.22.0
    2. Extract the zip file and move the sui-node-macos-arm64 (choose the correct version based on the system architecture) to a folder that is within your system PATH.
    mv sui-node-macos-arm64 ~/.sf_sui/bin/sui-node
    
  2. Download SF SUI Extractor

curl -L <https://github.com/Apocentre/sf-sui-extractor/releases/download/v0.1.0/sf-sui-extractor-darwin-arm64> -o ~/.sf_sui/bin/sf-sui-extractor

# Make it executable
chmod +x ~/.sf_sui/bin/sf-sui-extractor
  1. Download Firehose SUI
curl -L <https://github.com/Apocentre/firehose-sui/releases/download/v0.1.0/firesui-darwin-arm64> -o ~/.sf_sui/bin/firesui

<aside> 💡

You should choose the correct binary based on the architecture of your system. In the above example we download the binary built for the Mac silicon architecture.

</aside>

<aside> 💡 You can store binaries in any path you want. In the example above we use .sf_sui/bin/firesui but you should replace that with any destination folder you wish, as long as, it is in the system path.

Add this line to your ~/.bashrc, ~/.profile, or ~/.zshrc file to have it automatically sourced upon login.

export PATH=/Users/ppoliani/.sf_sui/bin:$PATH

Don’t forget to replace /Users/ppoliani/.sf_sui/bin with the path of your choice.

</aside>

Run Firehose

Run the indexer and relayer instances separately.

firesui -c ~/.sf_sui/firehose/indexer.yaml start

and

firesui -c ~/.sf_sui/firehose/firehose.yaml start

Run Sink Example

First install substream as described here

Then run the following commands.

git clone [[email protected]](<mailto:[email protected]>):Apocentre/sf-sui-example.git
cd sf-sui-example
cargo build -p sf-modules --target wasm32-unknown-unknown --release
substreams pack sf-modules/substreams.yaml
mv sf-modules/sf-modules-v0.1.0.spkg coin-sink/
cd coin-sink
ENV=development cargo run