Skip to content

Commit

Permalink
Yarik/gm world frontend (#372)
Browse files Browse the repository at this point in the history
* Update gm frontend tutorial

* Update gm world tutorial: use bash and which

* Add celestia-da tutorial, network agnostic (#368)

* Add celestia-da tutorial, network agnostic

* Update vitepress config

* Add link to /guides/gas-price

* Update tutorials/celestia-da.md

Co-authored-by: joshcs.eth <[email protected]>

* Update tutorials/celestia-da.md

Co-authored-by: joshcs.eth <[email protected]>

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update tutorials/celestia-da.md

* Update tutorials/celestia-da.md

* Update tutorials/celestia-da.md

* Apply suggestions from code review

* Apply suggestions from code review

* Update tutorials/gm-world.md

Co-authored-by: joshcs.eth <[email protected]>

* Remove sudo, we install gmd, no need to use sudo now

* docs: use 1 line for install instead of 2

---------

Co-authored-by: joshcs.eth <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Node and yarn versions as constants, custom script to install yarn and node

* Add brew bin to $PATH

* Minor updates to jq and go installation scripts

* Update public/install-jq.sh

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Use bash-vue

* Use bash instead of sh, yes, it's opinionated

* Add screenshot with connected wallet

* Uppercase yarn and nodejs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Exit if curl is not installed

* docs: add vA callout back

* fix: image linking, err in runtime

* docs: standard sentence case capitalization

* feat: remove now unused images

* Apply suggestions from code review

* Update tutorials/gm-world-frontend.md

---------

Co-authored-by: joshcs.eth <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Yarik Bratashchuk <[email protected]>
Co-authored-by: jcstein <[email protected]>
  • Loading branch information
5 people authored May 13, 2024
1 parent 8840797 commit 4eb0578
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 301 deletions.
3 changes: 3 additions & 0 deletions .vitepress/constants/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const constants = Object.freeze({
golangVersion: "1.22.2",

nodeVersion: "21.7.2",
yarnVersion: "1.22.19",

rollkitLatestTag: "v0.13.3",
rollkitLatestSha: "45b1573",
rollkitCosmosSDKVersion: "v0.50.6-rollkit-v0.13.3-no-fraud-proofs",
Expand Down
Binary file removed public/gm/cca-2.png
Binary file not shown.
Binary file removed public/gm/cca-3.png
Binary file not shown.
Binary file removed public/gm/cca.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/install-gm-frontend-app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo "Downloading GM Frontend tutorial source code..."
git clone https://github.com/rollkit/gm-frontend.git
cd gm-frontend || { echo "Failed to find the downloaded repository"; exit 1; }
echo "Installing dependencies..."
yarn install
echo "Starting dev server..."
yarn run dev
43 changes: 28 additions & 15 deletions public/install-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
# Multi-platform (Linux and macOS)
# Multi-architecture (amd64, arm64, arm) support

deps=( curl jq )
# if curl is not installed then install it
if ! command -v curl &> /dev/null; then
echo "curl is not installed. Please install curl and try again."
exit 1
fi

for dep in "${deps[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo "$dep is not installed. Downloading and executing the script..."
curl -sSL https://rollkit.dev/install-jq.sh | bash
exit $?
fi
done
# if jq is not installed then install it using the script
if ! command -v jq &> /dev/null; then
echo "jq is not installed. Downloading and executing the script to install jq..."
curl -sSL https://rollkit.dev/install-jq.sh | bash
fi

version="${1:-$(curl -s 'https://go.dev/dl/?mode=json' | jq -r '.[0].version')}"
current="$(/usr/local/go/bin/go version 2>/dev/null | awk '{print $3}')"
Expand All @@ -25,15 +27,26 @@ update_go() {
local arch="$1"
local os="$2"

local go_url="https://golang.org/dl/${version}.${os}-${arch}.tar.gz"
local go_url="https://golang.org/dl/go${version}.${os}-${arch}.tar.gz"

curl -so "/tmp/${version}.${os}-${arch}.tar.gz" -L "$go_url" && \
rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/${version}.${os}-${arch}.tar.gz
echo "Downloading Go from ${go_url}"

tar -C /usr/local -xzf "/tmp/${version}.${os}-${arch}.tar.gz" && \
echo "Go updated to version ${version}"
curl -so "/tmp/go${version}.${os}-${arch}.tar.gz" -L "$go_url"
if [ $? -eq 0 ]; then
tar -C /usr/local -xzf "/tmp/go${version}.${os}-${arch}.tar.gz"
if [ $? -ne 0 ]; then
echo "Failed to extract Go. Possibly corrupted download."
rm "/tmp/go${version}.${os}-${arch}.tar.gz"
exit 1
else
echo "Go updated to version ${version}"
fi
else
echo "Failed to download Go from ${go_url}"
exit 1
fi

rm "/tmp/${version}.${os}-${arch}.tar.gz"
rm "/tmp/go${version}.${os}-${arch}.tar.gz"
}

case "$(uname -s)" in
Expand Down Expand Up @@ -117,4 +130,4 @@ else
echo "$GO_BIN_PATH is already in PATH."
fi

/usr/local/go/bin/go version
$(which go) version
61 changes: 37 additions & 24 deletions public/install-jq.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
#!/bin/bash

if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected macOS. Installing jq..."
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install jq
echo "jq has been installed successfully."

echo "Detected macOS. Installing jq..."
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# adding /opt/homebrew/bin to the $PATH variable based on the shell
if [[ -f "$HOME/.bash_profile" ]]; then
echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.bash_profile"
source "$HOME/.bash_profile"
elif [[ -f "$HOME/.bashrc" ]]; then
echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.bashrc"
source "$HOME/.bashrc"
elif [[ -f "$HOME/.zshrc" ]]; then
echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.zshrc"
source "$HOME/.zshrc"
else
echo "Unsupported shell. Please add /opt/homebrew/bin to your PATH manually."
exit 1
fi
fi # Closing the brew installation check
brew install jq
echo "jq has been installed successfully."
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Detected Linux. Installing jq..."
if command -v apt &> /dev/null; then
sudo apt update
sudo apt install -y jq
elif command -v yum &> /dev/null; then
sudo yum install -y epel-release
sudo yum install -y jq
else
echo "Unsupported package manager. Please install jq manually."
exit 1
fi
echo "jq has been installed successfully."

echo "Detected Linux. Installing jq..."
if command -v apt &> /dev/null; then
sudo apt update
sudo apt install -y jq
elif command -v yum &> /dev/null; then
sudo yum install -y epel-release
sudo yum install -y jq
else
echo "Unsupported package manager. Please install jq manually."
exit 1
fi
echo "jq has been installed successfully."
else
echo "Unsupported operating system."
exit 1
fi
echo "Unsupported operating system."
exit 1
fi # Closing the OS type check

66 changes: 66 additions & 0 deletions public/install-yarn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh

set -e

INSTALL_NODE_VER=21.7.2
INSTALL_NVM_VER=0.39.7
INSTALL_YARN_VER=1.22.19

# You can pass node and yarn versions as arguments to this script
if [ "$1" != '' ]; then
echo "==> Using specified node version - $1"
INSTALL_NODE_VER=$1
fi
if [ "$2" != '' ]; then
echo "==> Using specified yarn version - $2"
INSTALL_YARN_VER=$2
fi

echo "==> Ensuring .bashrc exists and is writable"
touch ~/.bashrc

echo "==> Installing node version manager (NVM). Version $INSTALL_NVM_VER"
# Removed if already installed
rm -rf ~/.nvm
# Unset exported variable
export NVM_DIR=

# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$INSTALL_NVM_VER/install.sh | bash
# Make nvm command available to terminal
source ~/.nvm/nvm.sh

echo "==> Installing node js version $INSTALL_NODE_VER"
nvm install $INSTALL_NODE_VER

echo "==> Make this version system default"
nvm alias default $INSTALL_NODE_VER
nvm use default

echo "==> Installing Yarn package manager"
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $INSTALL_YARN_VER

echo "==> Adding Yarn and Node to environment path"
# Yarn configurations
mv $HOME/.nvm/versions/node/v$INSTALL_NODE_VER/bin/node $HOME/.yarn/bin

export PATH="$HOME/.yarn/bin:$PATH"
yarn config set prefix ~/.yarn -g

echo "==> Checking for versions"
nvm --version
node --version
npm --version
yarn --version

echo "==> Print binary paths"
which npm
which node
which yarn

echo "==> List installed node versions"
nvm ls

nvm cache clear
echo "==> Now you're all setup and ready for development. If changes are yet to take effect, I suggest you restart your computer"
Loading

0 comments on commit 4eb0578

Please sign in to comment.