• cryptoginger29

How to setup cardano SMASH?


Setting up the SMASH (Stakepool Metadata Aggregation Server (Host?)) Cardano service was a another step to setting up data architecture to the Cardano network.

The motivation for this was pretty similar to the motivation mentioned in my other blog post ( I'm really interested in how to use the data behind the Cardano network, to provide insight to the masses so that the adaption of the Cardano network, and blockchain technology, will be as positive and well founded as possible.


Creating a database

This is just basic postgreSQL DB setup copied from the official guide, with some specific customization:

cd cardano-db-sync
SMASHPGPASSFILE=config/pgpass ./scripts/ --createdb
SMASHPGPASSFILE=config/pgpass cabal run smash-exe -- run-migrations --mdir ./schema 

Install SMASH

Following the offical guide once again. This also builds on the cabal installation done in the coin cashew guide.

cabal build smash
cabal install smash

Run SMASH along side cardano node

Official command, with the needed customization.

SMASHPGPASSFILE=./config/pgpass cabal run smash-exe \
    --run-app-with-db-sync \
    --config config.yaml \
    --socket-path ${NODE_HOME}/db/socket \
    --schema-dir schema/ \
    --state-dir ledger-state/mainnet

SMASH some metadata

First get the pool hash by using the following cardano-cli command:

cat poolMetaDataHash.txt
> cb738f574938eaa9e960e052f071bfb62e19950e1f3acf920b61fabfade18df9

Get metadata for the midnort stake pool

curl --verbose --header "Content-Type: application/json" --request GET http://localhost:3100/api/v1/metadata/09a0c14484d3f421e813bfd509b102be1d327aa1077aae3076f5efec/cb738f574938eaa9e960e052f071bfb62e19950e1f3acf920b61fabfade18df9

And just like that, you are now ready to SMASH the cardano network!


Official guide:

7 views0 comments

Recent Posts

See All