MCPcopy Index your code
hub / github.com/PeggyJV/sommelier

github.com/PeggyJV/sommelier @v9.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v9.4.0 ↗ · + Follow
8,318 symbols 17,006 edges 345 files 1,596 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Sommelier

Sommelier is a platform for running DeFi strategies in special vaults, called Cellars, managed by off-chain computation. It's a blockchain built with the Cosmos SDK, and uses its own fork of the Gravity Bridge to enable cross-chain execution.

For more information you can check out the Sommelier Documentation

codecov Go Report Card license LoC GolangCI

Sommelier

The initial release of the Sommelier blockchain consists of a standard cosmos-sdk chain and Gravity Bridge refactor.

Steward

Steward is a sidecar process that facilitates function calls by Strategists to Cellars. It's also a CLI that subsumes the functionality of gorc, and is used in this document to configure and run the orchestrator.

Join the mainnet!

Running a validator node on the Sommelier mainnet requires three processes:

  1. The validator node
  2. The Gravity Bridge Orchestrator
  3. Steward

The Orchestrator (and Relayer if you are designated to run one) need an RPC endpoint to interact with Ethereum. We recommend using a service such as Alchemy or Infura. Larger validators may opt to use any existing full node they are already running for other purposes. Setup and configuration of an Ethereum node is left as an exercise for the reader.

The Steward CLI now supports all of the same commands as gorc and is the recommended way to configure delegate keys for new validators and to run the Orchestrator. The Steward CLI is used to run both the steward and orchestrator processes. There are post-installation steps for the steward process outlined at the end of the installation steps below. These are required for your Steward to participate in the protocol. For more information on these setup steps for Steward, see Validators Instructions for Setting Up Steward in the Steward repository.

NOTE: The Steward CLI and Steward itself are distinct concepts in this document. The Steward CLI is used to start both the steward and orchestrator processes, while "Steward" refers specifically to the steward process.

Installation

# Create an installation directory
mkdir install && cd install

# Install Steward
wget https://github.com/PeggyJV/steward/releases/latest/download/steward \
    && chmod +x * \
    && sudo mv * /usr/bin

# Install Sommelier
wget https://github.com/PeggyJV/sommelier/releases/download/v3.1.1/sommelier_3.1.1_linux_amd64.tar.gz \
    && tar -xf sommelier_3.1.1_linux_amd64.tar.gz \
    && sudo mv sommelier /usr/bin \
    && rm -rf sommelier_3.1.1_linux_amd64* LICENSE README.md

# Fetch systemd unit file examples
wget \
    https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/sommelier.service \
    https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/orchestrator.service \
    https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/steward.service

# Modify the unit files to fit your environment
nano orchestrator.service
nano steward.service
nano sommelier.service

# And install them to systemd
sudo mv orchestrator.service /etc/systemd/system/ \
    && sudo mv steward.service /etc/systemd/system/ \
    && sudo mv sommelier.service /etc/systemd/system/ \
    && sudo systemctl daemon-reload

# Init steward/orchestrator configuration. Note that the steward and orchestrator processes share
# much of the same configuration fields, so we share the config.toml for convenience.
mkdir -p $HOME/steward && cd $HOME/steward
wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/mainnet/sommelier-3/config.toml

# modify steward/orchestrator config for your environment, in particular your RPC URL and keystore path
nano config.toml

# Initialize the validator files
sommelier init myval --chain-id sommelier-3

At this point you need to create orchestrator keys OR restore them if you already created them. Please follow these instructions to create or restore these keys with the Steward CLI, then return to this doc for steps to add them to your validator.

# restore your validator mnemonic to the sommelier binary
sommelier keys add validator --recover

# OR: create your validator mnemonic to the sommelier binary
sommelier keys add validator

# NOTE: at the end of this process you need to have:
# - a key named "orchestrator" with funds on the cosmos chain in the steward keystore
# - a key named "signer" with funds on connected ETH chain in the steward keystore
# - a key named "validator" with funds on the cosmos chain in the sommelier keystore

# Add the peers from contrib/mainnet/sommelier-3/peers.txt to the ~/.sommelier/config/config.toml file
nano ~/.sommelier/config/config.toml

# pull the genesis file
wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/mainnet/sommelier-3/genesis.json \
    -O $HOME/.sommelier/config/genesis.json

# start your sommelier node - note it may take a minute or two to sync all of the blocks
sudo systemctl start sommelier && sudo journalctl -u sommelier -f

Your node should now be syncing from genesis. You will be required to update the binary as your sync reaches upgrade block heights. The tool cosmovisor is useful for handling this process automatically. Its setup and use is left as an exercise for the reader. The order of binary versions you will need to complete the sync process is shown below.

Height Version
Genesis 3.1.1
3610000 4.0.3
7766725 5.0.0
8704480 6.0.0
# once your node is synced, create your validator
sommelier tx staking create-validator \
  --amount=1000000usomm \
  --pubkey=$(sommelier tendermint show-validator) \
  --moniker="MYMONIKER" \
  --chain-id="sommelier-3" \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --gas 300000 \
  --fees="0usomm" \
  --from=validator

# register delegate keys for eth and orchestrator keys
sommelier tx gravity set-delegate-keys \
    $(sommelier keys show validator --bech val -a) \ # validator address
    $(steward --config $HOME/steward/config.toml keys cosmos show orchestrator) \ # orchestrator address (this must be run manually and address extracted)
    $(steward --config $HOME/steward/config.toml keys eth show signer) \ # eth signer address
    $(steward --config $HOME/steward/config.toml sign-delegate-keys signer $(sommelier keys show validator --bech val -a)) \
    --chain-id sommelier-3 \
    --from validator \
    -y

# start the orchestrator. note that we are not yet starting steward
sudo systemctl start orchestrator && sudo journalctl -u orchestrator -f

At this point, you should have a running validator node and Orchestrator.

Now it's time to complete the setup for Steward. Please follow the detailed guide in Validators Instructions for Setting Up Steward and return here.

At this point you should have a server CA and server certificate for Steward, and your config.toml should be configured with those values. Now we can start the Steward service that we created during the other installation steps.

# start steward
sudo systemctl start steward && sudo journalctl -u steward -f

Once your Steward is running, ensure that its server endpoint is reachable over the internet. Then, if you haven't already, follow the steps outlined in the Steward Registry repository to register your steward instance.

Your installation is complete! If you have any problems, please reach out in the validator lobby channels in Discord or Telegram.

Extension points exported contracts — how you extend this code

PubsubKeeper (Interface)
(no doc) [7 implementers]
x/cork/types/expected_keepers.go
CorkKeeper (Interface)
CorkKeeper defines the minimum interface needed to check registered Cellars [4 implementers]
x/cellarfees/types/expected_keepers.go
ICS4Wrapper (Interface)
(no doc) [6 implementers]
x/axelarcork/types/expected_keepers.go
MintKeeper (Interface)
MintKeeper defines the expected mint keeper methods [4 implementers]
x/incentives/types/expected_keepers.go
AccountKeeper (Interface)
Updates here should also be reflected in the testutil's expected keeper mocks, and can be generated via: mockgen -source [2 …
x/auction/types/expected_keepers.go
StakingKeeper (Interface)
StakingKeeper defines the expected staking keeper methods [1 implementers]
x/pubsub/types/expected_keepers.go
StakingKeeper (Interface)
StakingKeeper defines the expected staking keeper methods [1 implementers]
x/cork/types/expected_keepers.go
MintKeeper (Interface)
MintKeeper defines the expected mint keeper methods [4 implementers]
x/cellarfees/types/expected_keepers.go

Core symbols most depended-on inside this repo

address
called by 139
integration_tests/proposer.go
EXPECT
called by 83
x/cellarfees/testutil/expected_keepers_mocks.go
Len
called by 62
x/cellarfees/migrations/v1/types/cellarfees.go
sendMsgs
called by 55
integration_tests/chain.go
clientContext
called by 46
integration_tests/chain.go
String
called by 41
x/pubsub/types/params.go
GetSubspace
called by 37
app/app.go
EXPECT
called by 34
x/incentives/testutil/expected_keepers_mocks.go

Shape

Method 6,452
Function 1,134
Struct 444
Class 219
Interface 63
TypeAlias 3
Enum 2
FuncType 1

Languages

Go96%
Rust4%

Modules by API surface

x/pubsub/types/query.pb.go635 symbols
x/axelarcork/types/query.pb.go529 symbols
x/auction/types/query.pb.go345 symbols
x/axelarcork/types/proposal.pb.go315 symbols
x/cork/types/v2/query.pb.go302 symbols
x/pubsub/types/tx.pb.go272 symbols
x/cork/types/v1/query.pb.go266 symbols
x/pubsub/types/pubsub.pb.go259 symbols
x/cellarfees/types/v2/query.pb.go227 symbols
x/axelarcork/types/tx.pb.go201 symbols
x/axelarcork/types/axelarcork.pb.go199 symbols
x/cellarfees/types/v1/query.pb.go190 symbols

For agents

$ claude mcp add sommelier \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact