From 4c11e7ae1d26a0468c4c0eb04b7a28c23e1e294a Mon Sep 17 00:00:00 2001 From: Collin Brittain Date: Fri, 9 Sep 2022 10:31:19 -0500 Subject: [PATCH 1/4] Updates for v4 installation steps --- README.md | 112 ++++++++++-------- contrib/mainnet/sommelier-3/config.toml | 16 ++- .../{gorc.service => orchestrator.service} | 4 +- contrib/systemd/steward.service | 16 +++ 4 files changed, 96 insertions(+), 52 deletions(-) rename contrib/systemd/{gorc.service => orchestrator.service} (54%) create mode 100644 contrib/systemd/steward.service diff --git a/README.md b/README.md index f181da5c..67be9786 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sommelier -Sommelier is a coprocessor blockchain for Ethereum DeFi. +Sommelier is a platform for running DeFi strategies managed by off-chain computation. It's a blockchain built with the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), and uses its own fork of the [Gravity Bridge](https://github.com/peggyjv/gravity-bridge) to enable cross-chain execution. [![codecov](https://codecov.io/gh/peggyjv/sommelier/branch/main/graph/badge.svg)](https://codecov.io/gh/peggyjv/sommelier) [![Go Report Card](https://goreportcard.com/badge/github.com/peggyjv/sommelier)](https://goreportcard.com/report/github.com/peggyjv/sommelier) @@ -25,71 +25,76 @@ The initial release of the Sommelier blockchain will consist of a standard cosmo The Gravity Bridge requires some additional pieces to be deployed to support it: - [ ] [Ethereum Contract](https://github.com/PeggyJV/gravity-bridge/tree/main/solidity) and associated tooling -- [ ] Orchestrator/Relayer binaries built from the `go.mod` commit +- [ ] Orchestrator/Relayer binaries built from the `go.mod` commit +### Steward + +[Steward](https://github.com/peggyjv/steward) a middleware between the Strategy Provider and the protocol that facilitates Cellar function calls. 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](https://github.com/peggyjv/steward) + +We also recommend running a local `geth` process. Though a public Ethereum API service is can work, you may run into request limits because of the frequent requests made by the `orchestrator` process. + +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](https://github.com/PeggyJV/steward/blob/main/docs/02-StewardForValidators.md) 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 -```bash +```bash # Create an installation directory mkdir install && cd install -# Install Orchestrator -wget https://github.com/PeggyJV/gravity-bridge/releases/download/v0.3.9/gorc && chmod +x * && sudo mv * /usr/bin +# Install Steward +wget https://github.com/PeggyJV/steward/releases/download/v2.0.2/steward && chmod +x * && sudo mv * /usr/bin # Install Geth -wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.4-aa637fd3.tar.gz && tar -xvf geth-linux-amd64-1.10.4-aa637fd3.tar.gz && sudo mv geth-linux-amd64-1.10.4-aa637fd3/geth /usr/bin/geth && rm -rf geth-linux-amd64-1.10.4-aa637fd3* +wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.23-d901d853.tar.gz && tar -xvf geth-linux-amd64-1.10.23-d901d853.tar.gz && sudo mv geth-linux-amd64-1.10.23-d901d853/geth /usr/bin/geth && rm -rf geth-linux-amd64-1.10.23-d901d853* # 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 +wget https://github.com/PeggyJV/sommelier/releases/download/v4.0.1/sommelier_4.0.1_linux_amd64.tar.gz && tar -xf sommelier_4.0.1_linux_amd64.tar.gz && sudo mv sommelier /usr/bin && rm -rf sommelier_4.0.1_linux_amd64* LICENSE README.md -# Fetch systemd unit files -wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/geth.service https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/gorc.service https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/sommelier.service +# Fetch systemd unit file examples +wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/geth.service https://raw.githubusercontent.com/PeggyJV/steward/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 geth.service -nano gorc.service +nano orchestrator.service +nano steward.service nano sommelier.service # And install them to systemd -sudo mv geth.service /etc/systemd/system/geth.service && sudo mv gorc.service /etc/systemd/system/ && sudo mv sommelier.service /etc/systemd/system/ && sudo systemctl daemon-reload +sudo mv geth.service /etc/systemd/system/geth.service \ + && 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 # Start geth sudo systemctl start geth && sudo journalctl -u geth -f -# Init gorc configuration -mkdir -p $HOME/gorc && cd $HOME/gorc +# 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 gorc config for your environment +# modify steward/orchestrator config for your environment # You can use alchemy, infura endpoint as RPC and not necessarily need to sync the blockchain eth with geth nano config.toml # Initialize the validator files sommelier init myval --chain-id sommelier-3 +``` -# create/restore 2 cosmos keys and 1 ethereum key -# NOTE: be sure to save the mnemonics and eth private key - -# restore orchestrator key with gorc -gorc --config $HOME/gorc/config.toml keys cosmos recover orchestrator "{menmonic}" - -# OR: create orchestrator key with gorc -gorc --config $HOME/gorc/config.toml keys cosmos add orchestrator - -# restore eth key - -# EITHER: restore eth priv key from metamask with gorc -gorc --config $HOME/gorc/config.toml keys eth import signer "0x0000..." - -# OR: restore eth mnemonic with gorc -gorc --config $HOME/gorc/config.toml keys eth recover signer "{menomonic}" - -# OR: create eth key with gorc -gorc --config $HOME/gorc/config.toml keys eth add signer +At this point you need to create orchestrator keys OR restore them if you already created them. __Please follow [these instructions](https://github.com/PeggyJV/steward/blob/main/docs/03-TheOrchestrator.md#setup) to create or restore these keys with the Steward CLI__, then return to this doc for steps to add them to your validator. +```bash # restore your validator mnemonic to the sommelier binary sommelier keys add validator --recover @@ -97,20 +102,20 @@ sommelier keys add validator --recover 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 gorc keystore -# - a key named "signer" with funds on connected ETH chain in the gorc keystore +# - 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 +# 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 -# once your node is synced, create your validator +# once your node is synced, create your validator sommelier tx staking create-validator \ --amount=1000000usomm \ --pubkey=$(sommelier tendermint show-validator) \ @@ -120,24 +125,37 @@ sommelier tx staking create-validator \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1" \ - --gas 300000 + --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 - $(gorc --config $HOME/gorc/config.toml keys cosmos show orchestrator) \ # orchestrator address (this must be run manually and address extracted) - $(gorc --config $HOME/gorc/config.toml keys eth show signer) \ # eth signer address - $(gorc --config $HOME/gorc/config.toml sign-delegate-keys signer $(sommelier keys show validator --bech val -a)) \ - --chain-id sommelier-3 \ - --from validator \ + $(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 -sudo systemctl start gorc && sudo journalctl -u gorc -f +# 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](https://github.com/PeggyJV/steward/blob/main/docs/02-StewardForValidators.md) 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. + +```bash +# 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, follows the steps outlined in the [Steward Registry repository](https://github.com/PeggyJV/steward-registry) to register your steward instance. + ### Actions Now you can try the bridge!! @@ -161,7 +179,7 @@ gorc eth-to-cosmos \ --erc20-address="0x0000000000000000000000000000000000000000" \ --amount="1.3530000" \ --cosmos-destination="$(sommelier keys show orchestrator -a)" - + ``` ## Notes: @@ -204,5 +222,5 @@ gorc deploy erc20 \ --contract-address="0x8887F26882a3F920e40A91969D1A40D1Ef7efe10" \ --erc20-name=usomm \ --erc20-symbol=usomm \ - --erc20-decimals=6 + --erc20-decimals=6 ``` diff --git a/contrib/mainnet/sommelier-3/config.toml b/contrib/mainnet/sommelier-3/config.toml index e56229ac..d69c23e6 100644 --- a/contrib/mainnet/sommelier-3/config.toml +++ b/contrib/mainnet/sommelier-3/config.toml @@ -1,7 +1,7 @@ -keystore = "/home/ubuntu/gorc/keystore/" #edit this value for what it is your sommelier v2 gorc +keystore = "/home/ubuntu/steward/keystore/" #edit this value for what it is for your sommelier v3 steward or gorc keystore. [gravity] -contract = "0x69592e6f9d21989a043646fE8225da2600e5A0f7" +contract = "0x69592e6f9d21989a043646fE8225da2600e5A0f7" fees_denom = "usomm" [ethereum] @@ -22,4 +22,14 @@ amount = 0.000 denom = "usomm" [metrics] -listen_addr = "127.0.0.1:3000" \ No newline at end of file +listen_addr = "127.0.0.1:3000" + +[keys] +delegate_key = "orchestrator" # Edit if your orchestrator's Cosmos key name is different + +# Please leave the client_ca_cert_path field unset for now +[server] +address = "0.0.0.0" +port = 5734 +server_cert_path = "/server/cert/path" # Edit this value after completing the Steward setup process +server_key_path = "/server/key/path" # Edit this value after completing the Steward setup process diff --git a/contrib/systemd/gorc.service b/contrib/systemd/orchestrator.service similarity index 54% rename from contrib/systemd/gorc.service rename to contrib/systemd/orchestrator.service index 333e99cd..0a363b37 100644 --- a/contrib/systemd/gorc.service +++ b/contrib/systemd/orchestrator.service @@ -7,10 +7,10 @@ Type=simple User=ubuntu Environment="RUST_LOG=INFO" WorkingDirectory=/home/ubuntu -ExecStart=/usr/bin/gorc --config /home/ubuntu/gorc/config.toml orchestrator start --cosmos-key orchestrator --ethereum-key signer +ExecStart=/usr/bin/steward --config /home/ubuntu/steward/config.toml orchestrator start --cosmos-key orchestrator --ethereum-key signer --orchestrator-only Restart=on-failure RestartSec=3 LimitNOFILE=4096 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/contrib/systemd/steward.service b/contrib/systemd/steward.service new file mode 100644 index 00000000..b1627812 --- /dev/null +++ b/contrib/systemd/steward.service @@ -0,0 +1,16 @@ +[Unit] +Description=Sommelier Steward +After=online.target + +[Service] +Type=simple +User=ubuntu +Environment="RUST_LOG=INFO" +WorkingDirectory=/home/ubuntu +ExecStart=/usr/bin/steward --config /home/ubuntu/steward/config.toml start +Restart=on-failure +RestartSec=3 +LimitNOFILE=4096 + +[Install] +WantedBy=multi-user.target From 312d54676b82fc1c36c9aa85c25a0e5d7c218588 Mon Sep 17 00:00:00 2001 From: Collin Brittain Date: Fri, 9 Sep 2022 10:46:38 -0500 Subject: [PATCH 2/4] Fix some typos --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67be9786..d90ec112 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The Gravity Bridge requires some additional pieces to be deployed to support it: ### Steward -[Steward](https://github.com/peggyjv/steward) a middleware between the Strategy Provider and the protocol that facilitates Cellar function calls. It's also a CLI that subsumes the functionality of `gorc`, and is used in this document to configure and run the orchestrator. +[Steward](https://github.com/peggyjv/steward) is a middleware between the Strategy Provider and the protocol that facilitates Cellar function calls. 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! @@ -39,7 +39,7 @@ Running a validator node on the Sommelier mainnet requires three processes: 2. The Gravity Bridge Orchestrator 3. [Steward](https://github.com/peggyjv/steward) -We also recommend running a local `geth` process. Though a public Ethereum API service is can work, you may run into request limits because of the frequent requests made by the `orchestrator` process. +We also recommend running a local `geth` process. Though a public Ethereum API service can work, you may run into request limits because of the frequent requests made by the `orchestrator` process. 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](https://github.com/PeggyJV/steward/blob/main/docs/02-StewardForValidators.md) in the Steward repository. @@ -79,13 +79,14 @@ sudo mv geth.service /etc/systemd/system/geth.service \ # Start geth sudo systemctl start geth && sudo journalctl -u geth -f -# 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. +# 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 -# You can use alchemy, infura endpoint as RPC and not necessarily need to sync the blockchain eth with geth +# You can use alchemy or infura endpoints as your RPC and don't necessarily need to sync the +# blockchain eth with geth nano config.toml # Initialize the validator files @@ -154,7 +155,9 @@ At this point you should have a server CA and server certificate for Steward, an 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, follows the steps outlined in the [Steward Registry repository](https://github.com/PeggyJV/steward-registry) to register your steward instance. +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](https://github.com/PeggyJV/steward-registry) 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. ### Actions From ca94d221a76b394dfeac83dee90a6f78eaef3f8e Mon Sep 17 00:00:00 2001 From: Collin Brittain Date: Fri, 9 Sep 2022 16:21:16 -0500 Subject: [PATCH 3/4] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d90ec112..38e42372 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.23-d90 wget https://github.com/PeggyJV/sommelier/releases/download/v4.0.1/sommelier_4.0.1_linux_amd64.tar.gz && tar -xf sommelier_4.0.1_linux_amd64.tar.gz && sudo mv sommelier /usr/bin && rm -rf sommelier_4.0.1_linux_amd64* LICENSE README.md # Fetch systemd unit file examples -wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/geth.service https://raw.githubusercontent.com/PeggyJV/steward/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 +wget https://raw.githubusercontent.com/PeggyJV/sommelier/main/contrib/systemd/geth.service 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 geth.service From 31de618a8fee77e48f6c9b2875ded62688a6e4c9 Mon Sep 17 00:00:00 2001 From: Collin Brittain Date: Mon, 12 Sep 2022 10:01:05 -0500 Subject: [PATCH 4/4] Add a couple of missing backslashes in multi-line command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 38e42372..542cd164 100644 --- a/README.md +++ b/README.md @@ -126,8 +126,8 @@ sommelier tx staking create-validator \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1" \ - --gas 300000 - --fees="0usomm" + --gas 300000 \ + --fees="0usomm" \ --from=validator # register delegate keys for eth and orchestrator keys