-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README add curl install script (#87)
* Update README * Add install script to repo * Do not segfault when run with no subcommand --------- Co-authored-by: endline <[email protected]>
- Loading branch information
Showing
5 changed files
with
131 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
# Development | ||
|
||
Run Audius nodes and chains in a sandbox on your local machine. | ||
|
||
### Contexts | ||
|
||
Use contexts to experiment with different setups without clobbering changes. | ||
Contexts are modeled after `kubectl`. See: | ||
|
||
```bash | ||
audius-ctl config --help | ||
``` | ||
|
||
Switch contexts | ||
|
||
```bash | ||
audius-ctl config use-context my-existing-context | ||
``` | ||
|
||
Create new contexts | ||
|
||
```bash | ||
audius-ctl config create-context devnet -f ./configs/templates/devnet.yaml | ||
``` | ||
|
||
### Devnet | ||
|
||
Devnet uses a local nginx container on 80/443 to act as a layer 7 load balancer. Hence we need to add the hosts so we may intelligently route on localhost. | ||
``` | ||
sudo sh -c 'echo "127.0.0.1 creator-1.devnet.audius-d discovery-1.devnet.audius-d identity.devnet.audius-d eth-ganache.devnet.audius-d acdc-ganache.devnet.audius-d solana-test-validator.devnet.audius-d" >> /etc/hosts' | ||
``` | ||
|
||
Instruct audius-ctl what services to create and how to configure them. More on this concept below. | ||
``` | ||
audius-ctl config create-context devnet -f configs/templates/devnet.yaml | ||
``` | ||
|
||
Install the devnet certificate to avoid https warnings when connecting to local nodes | ||
``` | ||
# MacOS | ||
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain deployments/tls/devnet-cert.pem | ||
# Ubuntu | ||
sudo cp deployments/tls/devnet-cert.pem /usr/local/share/ca-certificates/devnet.audius-d.crt | ||
sudo update-ca-certificates | ||
``` | ||
|
||
Stand up audius nodes | ||
``` | ||
audius-ctl up | ||
``` | ||
|
||
Test context to verify it is all working. | ||
``` | ||
audius-ctl status | ||
... | ||
https://creator-1.audius-d [ /health_check .data.healthy ] true | ||
https://discovery-1.audius-d [ /health_check .data.discovery_provider_healthy ] true | ||
https://identity.audius-d [ /health_check .healthy ] true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Releases | ||
|
||
1. Commit (and ideally push, review, land) changes | ||
1. Ensure you are authenticated with the github cli (`gh auth status || gh auth login`) | ||
1. Run `make release-audius-ctl` | ||
1. Check the [releases page](https://github.com/AudiusProject/audius-d/releases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
# This script is intended to be invoked via | ||
# curl -sSL https://install.audius.org | sh | ||
|
||
set -e | ||
|
||
# Determine architecture | ||
ARCH=$(uname -m) | ||
BINARY_NAME="audius-ctl-${ARCH}" | ||
BINARY_URL="https://github.com/AudiusProject/audius-d/releases/latest/download/${BINARY_NAME}" | ||
|
||
# Try to determine the target directory | ||
if [ -w /usr/local/bin ]; then | ||
TARGET_DIR="/usr/local/bin" | ||
elif echo "$PATH" | grep -q "$HOME/.local/bin"; then | ||
TARGET_DIR="$HOME/.local/bin" | ||
elif echo "$PATH" | grep -q "$HOME/bin"; then | ||
TARGET_DIR="$HOME/bin" | ||
else | ||
echo 'Insufficient permissions and/or no suitable directory found in $PATH.' | ||
echo 'Please manually add $HOME/.local/bin or $HOME/bin to your $PATH, then rerun this script.' | ||
exit 1 | ||
fi | ||
|
||
# Create target directory if it doesn't exist | ||
if [ ! -d "$TARGET_DIR" ]; then | ||
echo "Creating directory $TARGET_DIR" | ||
mkdir -p "$TARGET_DIR" | ||
fi | ||
|
||
# Download the binary | ||
echo "Downloading ${BINARY_NAME} to ${TARGET_DIR}" | ||
curl -sSL "$BINARY_URL" -o "${TARGET_DIR}/audius-ctl" | ||
chmod +x "${TARGET_DIR}/audius-ctl" | ||
|
||
echo "${BINARY_NAME} has been installed to ${TARGET_DIR}/audius-ctl" | ||
echo "You can run it using: audius-ctl" | ||
|
||
# Inform user about PATH addition if necessary | ||
if ! echo ":$PATH:" | grep -q ":$TARGET_DIR:" ; then | ||
echo "To use audius-ctl from any location, add ${TARGET_DIR} to your PATH." | ||
echo "For bash users, add this line to your ~/.bash_profile or ~/.bashrc:" | ||
echo "export PATH=\"\$PATH:${TARGET_DIR}\"" | ||
echo "For zsh users, add the line to your ~/.zshrc instead." | ||
echo "After adding the line, restart your terminal or run 'source <file>' on the modified file to update your current session." | ||
fi |