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 .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
COMPOSE_PROJECT_NAME=joystream
PROJECT_NAME=query_node

# We use a single postgres service for both the query node indexer and processor.
# The default `DB_*` environment variables point to query node processor's database.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:

docker run -d --entrypoint tail --name temp-container-joystream-node $IMAGE-amd64 -f /dev/null

RESULT=$(docker exec temp-container-joystream-node b2sum -l 256 runtime.compact.compressed.wasm | awk '{print $1}')
VERSION_AND_COMMIT=$(docker exec temp-container-joystream-node /joystream/node --version | awk '{print $2}' | cut -d- -f -2)
RESULT=`docker exec temp-container-joystream-node b2sum -l 256 runtime.compact.compressed.wasm | awk '{print $1}'`
VERSION_AND_COMMIT=`docker exec temp-container-joystream-node /joystream/node --version | awk '{print $2}' | cut -d- -f -2`
echo "::set-output name=blob_hash::${RESULT}"
echo "::set-output name=version_and_commit::${VERSION_AND_COMMIT}"

Expand All @@ -76,7 +76,7 @@ jobs:

docker rm --force temp-container-joystream-node

docker cp $(docker create --rm $IMAGE-arm64):/joystream/node ./joystream-node
docker cp `docker create --rm $IMAGE-arm64`:/joystream/node ./joystream-node
tar -czvf joystream-node-$VERSION_AND_COMMIT-arm64-linux-gnu.tar.gz joystream-node

- name: Retrieve saved MacOS binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-node-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ jobs:
run: |
VAL1="${{ steps.deploy_stack.outputs.Val1PublicIp }}"
VAL2="${{ steps.deploy_stack.outputs.Val2PublicIp }}"
VAL3="${{ steps.deploy_stack.outputs.Val3PublicIp }}"
BOOT1="${{ steps.deploy_stack.outputs.Val3PublicIp }}"
echo -e "[validators]\n$VAL1\n$VAL2\n\n" >> inventory
echo -e "[boot]\n$VAL3\n\n" >> inventory
echo -e "[boot]\n$BOOT1\n\n" >> inventory
echo -e "[build]\n${{ steps.deploy_stack.outputs.BuildPublicIp }}\n\n" >> inventory
echo -e "[rpc]\n${{ steps.deploy_stack.outputs.RPCPublicIp }}\n" >> inventory
cat inventory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
required: false
default: 'master'
runtimeProfile:
description: 'STAGING | PLAYGROUND | TESTING - leave balnk for production'
description: 'PLAYGROUND | TESTING'
default: 'PLAYGROUND'
required: false
sshPubKey:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/joystream-apps-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
id: extract_versions
shell: bash
run: |
echo "colossus_version=$(cat storage-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
echo "argus_version=$(cat distributor-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
echo "qn_version=$(cat query-node/package.json | jq -r '.version')" >> $GITHUB_OUTPUT
echo "colossus_version=`cat storage-node/package.json | jq -r '.version'`" >> $GITHUB_OUTPUT
echo "argus_version=`cat distributor-node/package.json | jq -r '.version'`" >> $GITHUB_OUTPUT
echo "qn_version=`cat query-node/package.json | jq -r '.version'`" >> $GITHUB_OUTPUT

- name: Make some space
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/joystream-node-docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
runtime_profile: ['STAGING', 'PLAYGROUND', 'TESTING']
runtime_profile: ['FAST-PROD', 'PLAYGROUND', 'TESTING']
include:
- runtime_profile: 'STAGING'
cargo_features: 'staging-runtime'
- runtime_profile: 'FAST-PROD'
cargo_features: 'warp-time'
- runtime_profile: 'PLAYGROUND'
cargo_features: 'playground-runtime'
- runtime_profile: 'TESTING'
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/joystream-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ jobs:
run: |
yarn cargo-checks && yarn cargo-build
if: env.GIT_DIFF
- name: Fast Production Runtime
env:
RUNTIME_PROFILE: "FAST-PROD"
run: |
yarn cargo-checks && yarn cargo-build
if: env.GIT_DIFF

# Test runtime upgrade with "try-runtime" feature
runtime_upgrade:
Expand Down
10 changes: 5 additions & 5 deletions .pipelines/deploy-node-network-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"branchName": {
"description": "Branch to deploy",
"value": "carthage"
"value": "master"
},
"instanceType": {
"description": "AWS EC2 instance type for Validators and Rpc (t2.micro, t2.large, t2.xlarge)",
Expand All @@ -28,15 +28,15 @@
"value": ""
},
"deploymentType": {
"description": "Chain deployment type (live, dev etc.)",
"value": "staging"
"description": "Chain deployment type (testnet, mainnet)",
"value": "testnet"
},
"encryptionKey": {
"description": "Password to encrypt the artifacts",
"value": "staging"
"value": "testnet"
},
"runtimeProfile": {
"description": "STAGING | PLAYGROUND | TESTING - leave empty for production",
"description": "STAGING | PLAYGROUND | TESTING | FAST-PROD (leave empty for production)",
"value": "PLAYGROUND"
},
"endowAccounts": {
Expand Down
9 changes: 4 additions & 5 deletions build-node-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ set -e
# Looks for a cached joystream/node image matching code shasum.
# Search order: local repo then dockerhub. If no cached image is found we build it.

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

source scripts/features.sh

FEATURES=`scripts/features.sh`
CODE_SHASUM=`scripts/runtime-code-shasum.sh`
IMAGE=joystream/node:${CODE_SHASUM}

Expand All @@ -34,8 +33,8 @@ else
# Not guaranteed it has the correct architecture so just log image and local system architecures
fi

IMG_ARCH=$(docker inspect ${IMAGE} --format='{{.Architecture}}')
SYS_ARCH=$(uname -m)
IMG_ARCH=`docker inspect ${IMAGE} --format='{{.Architecture}}'`
SYS_ARCH=`uname -m`
if [ "$IMG_ARCH" != "$SYS_ARCH" ]; then
echo "WARNING: The local image's platform ${IMG_ARCH} does not match the detected host platform ${SYS_ARCH}"
fi
8 changes: 6 additions & 2 deletions docker-compose-no-bind-volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
container_name: joystream-node
volumes:
- chain-data:/data
command: "--dev --alice --validator --pruning=archive --unsafe-ws-external --unsafe-rpc-external
environment:
- CHAIN=${CHAIN}
command: "--chain ${CHAIN:-dev} --alice --validator --pruning=archive --unsafe-ws-external --unsafe-rpc-external
--rpc-methods Safe --rpc-cors=all --log runtime --base-path /data --no-hardware-benchmarks"
ports:
- 9944:9944
Expand Down Expand Up @@ -231,10 +233,11 @@ services:
- .env
environment:
- DB_NAME=${INDEXER_DB_NAME}
- INDEXER_WORKERS=5
- WORKERS_NUMBER=5
- REDIS_URI=redis://redis:6379/0
- WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
- DB_HOST=db
- PGSSLMODE=disable
depends_on:
- db
- redis
Expand All @@ -259,6 +262,7 @@ services:
- WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
- WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
- PORT=${HYDRA_INDEXER_GATEWAY_PORT}
- PGSSLMODE=disable
ports:
- "${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}"
depends_on:
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
container_name: joystream-node
volumes:
- chain-data:/data
command: "--dev --alice --validator --pruning=archive --unsafe-ws-external --unsafe-rpc-external
environment:
- CHAIN=${CHAIN}
command: "--chain ${CHAIN:-dev} --alice --validator --pruning=archive --unsafe-ws-external --unsafe-rpc-external
--rpc-methods Safe --rpc-cors=all --log runtime --base-path /data --no-hardware-benchmarks"
ports:
- 9944:9944
Expand Down Expand Up @@ -242,10 +244,11 @@ services:
- .env
environment:
- DB_NAME=${INDEXER_DB_NAME}
- INDEXER_WORKERS=5
- WORKERS_NUMBER=5
- REDIS_URI=redis://redis:6379/0
- WS_PROVIDER_ENDPOINT_URI=${JOYSTREAM_NODE_WS}
- DB_HOST=db
- PGSSLMODE=disable
depends_on:
- db
- redis
Expand All @@ -270,6 +273,7 @@ services:
- WARTHOG_STARTER_REDIS_URI=redis://redis:6379/0
- WARTHOG_APP_PORT=${HYDRA_INDEXER_GATEWAY_PORT}
- PORT=${HYDRA_INDEXER_GATEWAY_PORT}
- PGSSLMODE=disable
ports:
- "${HYDRA_INDEXER_GATEWAY_PORT}:${HYDRA_INDEXER_GATEWAY_PORT}"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion scripts/cargo-build-with-benchmarking.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15
Expand Down
6 changes: 3 additions & 3 deletions scripts/cargo-build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

source features.sh
FEATURES=`./features.sh`

export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15

cargo +nightly-2022-11-15 build --release --locked --features "${FEATURES}"
cargo +nightly-2022-11-15 build --release --locked --features "${FEATURES}" $*
2 changes: 1 addition & 1 deletion scripts/cargo-checks-with-benchmarking.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

echo 'running rust-fmt'
Expand Down
8 changes: 4 additions & 4 deletions scripts/cargo-checks.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

echo 'running rust-fmt'
cargo fmt --all -- --check

source ./features.sh
FEATURES=`./features.sh`

export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15

Expand All @@ -16,7 +16,7 @@ export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15
# So we skip building the WASM binary by setting BUILD_DUMMY_WASM_BINARY=1
# Aggressive linting
echo 'running cargo clippy'
cargo "+$WASM_BUILD_TOOLCHAIN" clippy --release --all --features "${FEATURES}" -- -D warnings
cargo "+$WASM_BUILD_TOOLCHAIN" clippy --release --all --features "${FEATURES}" $* -- -D warnings

echo 'running cargo unit tests'
cargo "+$WASM_BUILD_TOOLCHAIN" test --release --all --features "${FEATURES}"
cargo "+$WASM_BUILD_TOOLCHAIN" test --release --all --features "${FEATURES}" $*
4 changes: 2 additions & 2 deletions scripts/cargo-test-all.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

echo 'running rust-fmt'
cargo fmt --all -- --check

source ./features.sh
FEATURES=`./features.sh`

export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15

Expand Down
7 changes: 3 additions & 4 deletions scripts/compute-runtime-blob-hash.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#!/usr/bin/env bash
set -e

# The script computes the b2sum of the wasm blob in a pre-built joystream/node image
# Specifically amd64 architecture image, as that is what we use as the "reference" images
# for deterministic builds.
# Assumes b2sum is already instally on the host machine.

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`$(dirname "${BASH_SOURCE[0]}")`
cd $SCRIPT_PATH

source ./features.sh

CODE_SHASUM=`./runtime-code-shasum.sh`
IMAGE=joystream/node:${CODE_SHASUM}

IMG_ARCH=$(docker inspect ${IMAGE} --format='{{.Architecture}}')
IMG_ARCH=`docker inspect ${IMAGE} --format='{{.Architecture}}'`

if [ "$IMG_ARCH" != "amd64" ]; then
echo "You must fetch the amd64 architecture image with following command:"
Expand Down
29 changes: 24 additions & 5 deletions scripts/features.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
FEATURES=
#!/usr/bin/env bash
set -e

if [[ "$RUNTIME_PROFILE" == "TESTING" ]]; then
FEATURES="testing-runtime"
echo "testing-runtime"
exit 0
fi

if [[ "$RUNTIME_PROFILE" == "STAGING" ]]; then
FEATURES="staging-runtime"
echo "staging-runtime"
exit 0
fi

if [[ "$RUNTIME_PROFILE" == "PLAYGROUND" ]]; then
FEATURES="playground-runtime"
fi
echo "playground-runtime"
exit 0
fi

# Production runtime, no extra features needed
if [[ "$RUNTIME_PROFILE" == "" ]]; then
exit 0
fi

# Fast Production runtime
if [[ "$RUNTIME_PROFILE" == "FAST-PROD" ]]; then
echo "warp-time"
exit 0
fi

>&2 echo "Unrecognized RUNTIME_PROFILE ${RUNTIME_PROFILE}"
exit -1
2 changes: 1 addition & 1 deletion scripts/fetch-chain-metadata.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
curl\
curl \
-H "Content-Type: application/json"\
-d '{"id":"1", "jsonrpc":"2.0", "method": "state_getMetadata", "params":[]}'\
http://localhost:9933
6 changes: 2 additions & 4 deletions scripts/fetch-chain-spec-version.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
SPEC_VERSION=$(curl -H "Content-Type: application/json" \
curl -H "Content-Type: application/json" \
-s -d '{"id":"1", "jsonrpc":"2.0", "method": "state_getRuntimeVersion"}' \
http://localhost:9933 | jq -r '.result.specVersion')

echo $SPEC_VERSION
http://localhost:9933 | jq -r '.result.specVersion'
2 changes: 1 addition & 1 deletion scripts/generate-weights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Executes and replaces all benchmarks with the new weights

SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`

STEPS=${1:-50}
REPEAT=${2:-20}
Expand Down
4 changes: 2 additions & 2 deletions scripts/run-dev-chain.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -e

SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
SCRIPT_PATH=`dirname "${BASH_SOURCE[0]}"`
cd $SCRIPT_PATH

source features.sh
FEATURES=`./features.sh`

export WASM_BUILD_TOOLCHAIN=nightly-2022-11-15

Expand Down
6 changes: 5 additions & 1 deletion scripts/runtime-code-shasum.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/env bash
set -e

# Compute a hash over files related to building joystream/node docker image

# Assuming cargo workspace root is same as the git repo root
cd $(git rev-parse --show-toplevel)
cd `git rev-parse --show-toplevel`

# Make sure a recognized RUNTIME_PROFILE is used
_=`./scripts/features.sh`

TAR=tar
SED=sed
Expand Down
Loading