Skip to content

Commit

Permalink
Merge branch 'main' into saihaj/graph-cli-header
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Nov 15, 2023
2 parents 9e0d14a + de8abe0 commit 12d4e4b
Show file tree
Hide file tree
Showing 37 changed files with 569 additions and 535 deletions.
5 changes: 0 additions & 5 deletions .changeset/curvy-rats-hear.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eight-laws-remember.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-fishes-marry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/four-pandas-ring.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/grumpy-carrots-relate.md

This file was deleted.

3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/graphprotocol/graph-tooling/discussions/new?category=ideas
about: Have an idea for a new feature? Please share it with us here.
- name: Have a question?
url: https://discord.gg/vtvv7FP
about:
Expand Down
163 changes: 89 additions & 74 deletions cf-pages/install.sh
Original file line number Diff line number Diff line change
@@ -1,88 +1,103 @@
#!/bin/bash
{
set -e
SUDO=''
if [ "$(id -u)" != "0" ]; then
SUDO='sudo'
echo "This script requires superuser access."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
fi

# run inside sudo
$SUDO bash << SCRIPT
set -e
OS=""
ARCH=""
OS_ARCH=""
echoerr() { echo "\$@" 1>&2; }
unsupported_arch() {
local os=$1
local arch=$2
echoerr "The Graph CLI does not support $os / $arch at this time."
exit 1
}

set_os_arch() {
if [ "\$(uname)" == "Darwin" ]; then
OS=darwin
elif [ "\$(expr substr \$(uname -s) 1 5)" == "Linux" ]; then
OS=linux
else
OS=win32
fi
if [ -n "$1" ]
then
INSTALL_DIR=${1%%/}
BIN_DIR=
else
INSTALL_DIR=/usr/local/lib
BIN_DIR=/usr/local/bin
fi

if [ ! -w "$INSTALL_DIR" ]
then
cat <<EOF
usage: install.sh [DIR]
Install graph-cli to DIR. DIR defaults to /usr/local/lib.
The directory $INSTALL_DIR is not writable by the current user.
Try running this script as root for a system-wide install which will also
put 'graph' into /usr/local/bin or pass an installation directory that is
writable by the current user as DIR
EOF
exit 1
fi

set -e

OS=""
ARCH=""

echoerr() { echo "$@" 1>&2; }

ARCH="\$(uname -m)"
if [ "\$ARCH" == "x86_64" ]; then
ARCH=x64
elif [ "\$ARCH" == "amd64" ]; then
ARCH=x64
elif [ "\$ARCH" == "arm64" ]; then
if [ "\$OS" == "darwin" ]; then
unsupported_arch() {
local os=$1
local arch=$2
echoerr "The Graph CLI does not support $os / $arch at this time."
exit 1
}

set_os_arch() {
if [ "$(uname)" == "Darwin" ]; then
OS=darwin
elif [ "$(uname -s)" == "Linux" ]; then
OS=linux
else
OS=win32
fi

ARCH="$(uname -m)"
if [ "$ARCH" == "x86_64" ]; then
ARCH=x64
elif [ "$ARCH" == "amd64" ]; then
ARCH=x64
elif [ "$ARCH" == "arm64" ]; then
if [ "$OS" == "darwin" ]; then
ARCH=arm64
else
ARCH=arm
fi
elif [[ "\$ARCH" == aarch* ]]; then
ARCH=arm
else
unsupported_arch $OS $ARCH
ARCH=arm
fi
}
elif [[ "$ARCH" == aarch* ]]; then
ARCH=arm
else
unsupported_arch $OS $ARCH
fi
}

download() {
DOWNLOAD_DIR=$(mktemp -d)
download() {
DOWNLOAD_DIR=$(mktemp -d)

TARGET="\$OS-\$ARCH"
URL="https://github.com/graphprotocol/graph-tooling/releases/latest/download/graph-\$TARGET.tar.gz"
echo "Downloading \$URL"
TARGET="$OS-$ARCH"
URL="https://github.com/graphprotocol/graph-tooling/releases/latest/download/graph-$TARGET.tar.gz"
echo "Downloading $URL"

if ! curl --progress-bar --fail -L "\$URL" -o "\$DOWNLOAD_DIR/graph.tar.gz"; then
echo "Download failed."
exit 1
fi
if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/graph.tar.gz"; then
echo "Download failed."
exit 1
fi

echo "Downloaded to \$DOWNLOAD_DIR"
echo "Downloaded to $DOWNLOAD_DIR"

rm -rf "/usr/local/lib/graph"
tar xzf "\$DOWNLOAD_DIR/graph.tar.gz" -C /usr/local/lib
rm -rf "\$DOWNLOAD_DIR"
echo "Unpacked to /usr/local/lib/graph"
rm -rf "${INSTALL_DIR}/graph"
tar xzf "$DOWNLOAD_DIR/graph.tar.gz" -C "$INSTALL_DIR"
rm -rf "$DOWNLOAD_DIR"
echo "Unpacked to $INSTALL_DIR"

echo "Installing to /usr/local/bin/graph"
rm -f /usr/local/bin/graph
ln -s /usr/local/lib/graph/bin/graph /usr/local/bin/graph
}
if [ -n "$BIN_DIR" ]
then
echo "Installing to ${BIN_DIR}/graph"
rm -f "$BIN_DIR/graph"
ln -s "$INSTALL_DIR/graph/bin/graph" "$BIN_DIR/graph"
LOCATION="$BIN_DIR/graph"
else
LOCATION="$INSTALL_DIR/graph/bin/graph"
fi
}

set_os_arch
download
set_os_arch
download

SCRIPT
LOCATION=$(command -v graph)
echo "The Graph CLI installed to $LOCATION"
graph --version
}
echo "The Graph CLI installed to $LOCATION"
$LOCATION --version
2 changes: 1 addition & 1 deletion examples/arweave-blocks-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"remove-local": "graph remove arweave-example --node http://localhost:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0"
}
}
2 changes: 1 addition & 1 deletion examples/cosmos-block-filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos-osmosis-token-swaps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0"
}
}
2 changes: 1 addition & 1 deletion examples/cosmos-validator-delegations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos-validator-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ethereum-basic-event-handlers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"typescript": "^5.0.4"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"apollo-fetch": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/ethereum-gravatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"hardhat": "^2.13.1"
Expand Down
3 changes: 0 additions & 3 deletions examples/example-subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@
},
"devDependencies": {
"@graphprotocol/graph-ts": "0.31.0"
},
"resolutions": {
"assemblyscript": "0.19.10"
}
}
23 changes: 0 additions & 23 deletions examples/matic-lens-protocol-posts-subgraph/CHANGELOG.md

This file was deleted.

7 changes: 4 additions & 3 deletions examples/matic-lens-protocol-posts-subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "lens-protocol-posts-sg",
"name": "example-lens-protocol-posts-sg",
"version": "0.0.1",
"license": "UNLICENSED",
"private": true,
"scripts": {
Expand All @@ -12,10 +13,10 @@
"test": "graph test"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0"
},
"devDependencies": {
"matchstick-as": "0.5.2"
"matchstick-as": "0.6.0"
}
}
2 changes: 1 addition & 1 deletion examples/near-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0"
}
}
2 changes: 1 addition & 1 deletion examples/near-receipts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.58.0",
"@graphprotocol/graph-cli": "0.61.0",
"@graphprotocol/graph-ts": "0.31.0"
}
}
Loading

0 comments on commit 12d4e4b

Please sign in to comment.