Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/src/jobs/release-audius-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ steps:
- run:
name: Release
command: |
export PROTOCOL_DIR=$PWD
packages/libs/scripts/release.sh << parameters.sdk-release-commit >> << parameters.sdk-release-version >> << parameters.sdk-release-preid >>
2 changes: 0 additions & 2 deletions dev-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ audius-compose connect

Use these CLI tools for Audius dev. Currently there are 3 tools available:

- `audius-cloud`: create a pre-configured GCP VM for dev
- `audius-compose`: start, stop, and manage Audius service containers
- `audius-cmd`: perform user actions, e.g. `create-user`, `upload-track`, `repost-playlist`

View all available commands for any of these tools with `--help`, e.g.

```bash
> audius-cloud --help
> audius-compose --help
> audius-cmd --help
```
Expand Down
172 changes: 0 additions & 172 deletions dev-tools/audius-cloud

This file was deleted.

6 changes: 2 additions & 4 deletions dev-tools/audius-cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
set -e

if [[ "$PROTOCOL_DIR" != "" ]]; then
cd $PROTOCOL_DIR/dev-tools/compose
fi
export COMPOSE_PROJECT_NAME=$(basename $PROTOCOL_DIR)
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/compose # audius-protocol/dev-tools/compose
export COMPOSE_PROJECT_NAME='audius-protocol'

if [[ "$1" == "test" ]]; then
docker compose exec audius-cmd npm test
Expand Down
4 changes: 1 addition & 3 deletions dev-tools/audius-compose
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,21 @@ def generate_env(
@click.group()
@click.option(
"--protocol-dir",
envvar="PROTOCOL_DIR",
type=click.Path(
exists=True, file_okay=False, resolve_path=True, path_type=pathlib.Path
),
)
@click.pass_context
def cli(ctx, protocol_dir):
if protocol_dir is None:
protocol_dir = pathlib.Path.cwd().resolve()
protocol_dir = pathlib.Path(os.path.dirname(os.path.realpath(__file__))).resolve()
while (
protocol_dir.name != ""
and not (protocol_dir / "dev-tools/compose/docker-compose.yml").exists()
):
protocol_dir = protocol_dir.parent
if protocol_dir.name == "":
raise click.ClickException("Unable to find protocol dir")
click.confirm(f'Using protocol dir "{protocol_dir}"', default=True, abort=True)

ctx.obj = protocol_dir

Expand Down
12 changes: 0 additions & 12 deletions dev-tools/setup-dev.sh

This file was deleted.

23 changes: 10 additions & 13 deletions dev-tools/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ debian | ubuntu)

# Increase file watchers
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# add script directories to path, avoiding duplication
grep -q "export PATH=$HOME/.local/bin:" ~/.profile || echo "export PATH=$HOME/.local/bin:\$PATH" >>~/.profile

;;
*)
if ! command -v docker &>/dev/null; then
Expand All @@ -72,22 +76,15 @@ debian | ubuntu)
esac

if [[ "${BASH_SOURCE[0]}" == "" ]]; then
export PROTOCOL_DIR="${PROTOCOL_DIR:-$HOME/audius-protocol}"
git clone https://github.com/AudiusProject/audius-protocol.git "$PROTOCOL_DIR"
protocol_dir="$HOME/audius-protocol"
git clone https://github.com/AudiusProject/audius-protocol.git "$protocol_dir"
else
export PROTOCOL_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
protocol_dir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
fi

python3 -m pip install -r "$PROTOCOL_DIR/dev-tools/requirements.txt"
python3 -m pip install -r "$protocol_dir/dev-tools/requirements.txt"

mkdir -p "$HOME/.local/bin"

ln -sf "$PROTOCOL_DIR/dev-tools/audius-compose" "$HOME/.local/bin/audius-compose"
ln -sf "$PROTOCOL_DIR/dev-tools/audius-cloud" "$HOME/.local/bin/audius-cloud"
ln -sf "$PROTOCOL_DIR/dev-tools/audius-cmd" "$HOME/.local/bin/audius-cmd"

# Add env vars to .profile, avoiding duplication
grep -q PROTOCOL_DIR ~/.profile || echo "export PROTOCOL_DIR=$PROTOCOL_DIR" >>~/.profile
grep -q "export PATH=$HOME/.local/bin:" ~/.profile || echo "export PATH=$HOME/.local/bin:\$PATH" >>~/.profile

[[ "$AUDIUS_DEV" != "false" ]] && . "$PROTOCOL_DIR/dev-tools/setup-dev.sh" || true
ln -sf "$protocol_dir/dev-tools/audius-compose" "$HOME/.local/bin/audius-compose"
ln -sf "$protocol_dir/dev-tools/audius-cmd" "$HOME/.local/bin/audius-cmd"
2 changes: 1 addition & 1 deletion packages/libs/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function cleanup () {

# configuration
STUB=@audius/sdk
cd ${PROTOCOL_DIR}/packages/libs
cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" # audius-protocol/packages/libs

# pull in main
git-reset
Expand Down
4 changes: 2 additions & 2 deletions solana-programs/anchor/audius-data/scripts/build-dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

cd $PROTOCOL_DIR/solana-programs/anchor/audius-data
cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" # audius-protocol/solana-programs/anchor/audius-data
# Replace program ID with solana pubkey generated from anchor build
cur_address=$(grep -Po '(?<=declare_id!\(").*(?=")' programs/audius-data/src/lib.rs)
echo "Building and deploying audius_data program with anchor CLI..."
Expand All @@ -11,4 +11,4 @@ sed -i "s/$cur_address/$AUDIUS_DATA_PROGRAM_ID/g" Anchor.toml
sed -i "s/$cur_address/$AUDIUS_DATA_PROGRAM_ID/g" programs/audius-data/src/lib.rs

anchor build
echo "audius-data program built. Start solana test validator and deploy by running, in separate windows, npm run localnet-up and npm run deploy-dev."
echo "audius-data program built. Start solana test validator and deploy by running, in separate windows, npm run localnet-up and npm run deploy-dev."
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUST_VERSION=1.59.0 # rustc version 1.59.0 (9d1b2106e 2022-02-23)
SOLANA_CLI_VERSION=v1.9.13
ANCHOR_CLI_VERSION=v0.24.1

cd $PROTOCOL_DIR/solana-programs/anchor/audius-data
cd "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" # audius-protocol/solana-programs/anchor/audius-data
echo "Installing dev deps for anchor audius-data development..."
# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Expand Down Expand Up @@ -38,4 +38,4 @@ npm install
# init solana keypair
solana-keygen new --no-bip39-passphrase --force -o "$HOME/.config/solana/id.json"

echo "Installed deps for anchor development."
echo "Installed deps for anchor development."
7 changes: 5 additions & 2 deletions solana-programs/anchor/audius-data/scripts/parse-tx.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail

TX_PARSER_DIR="$PROTOCOL_DIR/packages/discovery-provider/solana-tx-parser"

protocol_dir="$(readlink -f "${BASH_SOURCE[0]}" | sed -nr 's/(.*)\/solana-programs\/anchor.*/\1/p')"
TX_PARSER_DIR="$protocol_dir/packages/discovery-provider/solana-tx-parser"

AUDIUS_DATA_PROGRAM_ID=$(solana-keygen pubkey $PWD/target/deploy/audius_data-keypair.json)

echo "Installing parser deps if needed..."
cd "$TX_PARSER_DIR" && python3.9 -m pip install -r requirements.txt

echo "Running parser with tx hash "$@"... If no tx hash is provided, parser will default to all tx for program ID $AUDIUS_DATA_PROGRAM_ID"
TX_HASH="$@" python3.9 tx_parser.py
TX_HASH="$@" python3.9 tx_parser.py
4 changes: 2 additions & 2 deletions solana-programs/anchor/audius-data/scripts/seed-tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x

# TODO - MOVE OUT OF SHELL SCRIPT ASAP

ANCHOR_PROGRAM_DIR="$PROTOCOL_DIR/solana-programs/anchor/audius-data"
ANCHOR_PROGRAM_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")" # audius-protocol/solana-programs/anchor/audius-data
OWNER_KEYPAIR_PATH="$HOME/.config/solana/id.json"
ADMIN_AUTHORITY_KEYPAIR_PATH="$PWD/adminAuthorityKeypair.json"
ADMIN_ACCOUNT_KEYPAIR_PATH="$PWD/adminAccountKeypair.json"
Expand Down Expand Up @@ -106,4 +106,4 @@ yarn run ts-node cli/main.ts -f deletePlaylist \

echo "Successfully seeded tx:"

solana transaction-history "$AUDIUS_DATA_PROGRAM_ID"
solana transaction-history "$AUDIUS_DATA_PROGRAM_ID"