Skip to content

Commit

Permalink
Merge branch 'development' into core-covenants-update-output-type-fie…
Browse files Browse the repository at this point in the history
…ld-selector

* development:
  fix: wrong ban reason (tari-project#4461)
  fix broken critical cucumber test (tari-project#4458)
  chore: remove Defunct L2 code (tari-project#4463)
  fix(ci): binary builds - remove tari_collectibles and lib deps for linux  (tari-project#4454)
  feat(docker) :build tari docker images for launchpad (tari-project#4476)
  fix: fix transaction output hashing (tari-project#4483)
  chore: remove broken tag from working tests (tari-project#4471)
  fix: wallet always scan interactive payments (see tari-project#4452) (tari-project#4464)
  feat: remove total_txs and rename total_weight in mempool (tari-project#4474)
  • Loading branch information
sdbondi committed Aug 16, 2022
2 parents 6d934d2 + 4788789 commit 39f7c9a
Show file tree
Hide file tree
Showing 165 changed files with 4,854 additions and 23,078 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/base_node_binaries.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "linux-x86_64",
"runs-on": "ubuntu-18.04",
"runs-on": "ubuntu-latest",
"rust": "nightly-2022-05-01",
"target": "x86_64-unknown-linux-gnu",
"cross": false,
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/base_node_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ jobs:
libncurses5-dev \
libncursesw5-dev \
zip \
build-essential \
libgtk-3-dev \
libwebkit2gtk-4.0-dev \
libsoup2.4-dev \
curl \
wget \
libappindicator3-dev \
patchelf \
librsvg2-dev \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu
sudo apt-get -y --purge remove \
Expand Down Expand Up @@ -238,6 +229,7 @@ jobs:
"tari_console_wallet"
"tari_miner"
"tari_merge_mining_proxy"
"tari_validator_node"
)
for FILE in "${FILES[@]}"; do
if [ -f "$GITHUB_WORKSPACE/target/${{ matrix.builds.target }}/release/${FILE}${TBN_EXT}" ]; then
Expand Down Expand Up @@ -282,6 +274,7 @@ jobs:
"tari_console_wallet"
"tari_miner"
"tari_merge_mining_proxy"
"tari_validator_node"
)
for FILE in "${FILES[@]}"; do
codesign --options runtime --force --verify --verbose --timestamp --sign "Developer ID Application: $MACOS_APPLICATION_ID" "/tmp/tari_testnet/runtime/$FILE"
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/build_dockers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: Build docker images

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- "build-*"
schedule:
- cron: "05 00 * * *"
workflow_dispatch:
inputs:
# toolchain:
# type: string
# description: 'Rust toolchain'
version:
type: string
description: 'override image tag/version'
tag_alias:
type: string
description: 'image tag alias'
platforms:
default: linux/amd64
description: 'docker platform(s)'
type: choice
options:
- linux/amd64
- linux/arm64
- linux/arm64, linux/amd64
build_items:
default: tari_all
description: 'image(s) to build'
type: choice
options:
- all
- tari_all
- tari_base_node
- tari_wallet
- tari_mm_proxy
- tari_sha3_miner
- 3rdparty_all
- tor
- monerod
- xmrig

env:
toolchain_default: nightly-2022-05-01

jobs:
builds_envs_setup:
runs-on: ubuntu-latest
outputs:
toolchain: ${{ steps.set_toolchain.outputs.toolchain }}

steps:
- name: Set toolchain
id: set_toolchain
run: |
if [ -z "${{ inputs.toolchain }}" ]; then
echo "Using default"
btoolchain=${{ env.toolchain_default }}
else
echo "Using provided input"
btoolchain=${{ inputs.toolchain }}
fi
echo "Rust toolchain - ${btoolchain} ."
echo "toolchain=${btoolchain}" >> $GITHUB_ENV
builds_run:
needs: builds_envs_setup
uses: ./.github/workflows/build_dockers_workflow.yml
secrets: inherit
with:
toolchain: ${{ needs.builds_envs_setup.outputs.toolchain }}
platforms: ${{ inputs.platforms }}
version: ${{ inputs.version }}
tag_alias: ${{ inputs.tag_alias }}
build_items: ${{ inputs.build_items }}
197 changes: 197 additions & 0 deletions .github/workflows/build_dockers_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
name: Build docker images - workflow_call/on-demand

on:
workflow_call:
secrets:
DOCKER_PROVIDER:
required: true
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
inputs:
toolchain:
type: string
description: 'Rust toolchain'
default: nightly-2022-05-01
arch:
type: string
default: x86-64
features:
type: string
default: safe
version:
type: string
description: 'build tag/version'
tag_alias:
type: string
description: 'build tag alias'
build_items:
type: string
default: tari_sha3_miner
description: 'build images'
platforms:
type: string
# linux/arm64, linux/amd64
default: linux/amd64

env:
LAUNCHPAD_REPO: tari-project/tari-launchpad
LAUNCHPAD_BRANCH: main

jobs:
envs_setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set_matrix.outputs.matrix }}

steps:
- name: checkout tari-launchpad
uses: actions/checkout@v3
with:
repository: ${{ env.LAUNCHPAD_REPO }}
ref: ${{ env.LAUNCHPAD_BRANCH }}
path: tari-launchpad

- name: Set Matrix
id: set_matrix
shell: bash
run: |
build_items=${{ inputs.build_items }}
echo "Building with ${build_items}."
if [ -z "${build_items}" ] || [ "${build_items}" = "tari_all" ] ; then
echo "Build all tari images"
matrix_selection=$( jq -s -c '.[]' tari-launchpad/tarisuite.json )
elif [ "${build_items:0:5}" = "tari_" ] ; then
echo "Build only selected tari images - ${build_items}"
matrix_selection=$( jq --arg jsonVar "${build_items}" -r '[. []
| select(."image_name"==$jsonVar)]' tari-launchpad/tarisuite.json )
elif [ "${build_items}" = "all" ] ; then
echo "Build all images"
matrix_selection=$( jq -c '. += input' tari-launchpad/tarisuite.json tari-launchpad/3rdparty.json )
elif [ "${build_items:0:8}" = "3rdparty" ] ; then
echo "Build only 3rdparty images - ${build_items}"
matrix_selection=$( jq -s -c '.[]' tari-launchpad/3rdparty.json )
else
echo "Build only selected 3rdparty images - ${build_items}"
matrix_selection=$( jq --arg jsonVar "${build_items}" -r '[. []
| select(."image_name"==$jsonVar)]' tari-launchpad/3rdparty.json )
# "!! Broken selection? !!"
# exit 1
fi
# ToDo: Add error checking
# Setup the json build matrix
matrix=$(echo ${matrix_selection} | jq -s -c '{"builds": .[]}')
echo $matrix
echo $matrix | jq .
echo "::set-output name=matrix::$matrix"
#echo "matrix=${matrix}" >> $GITHUB_ENV
docker_build:
name: Docker building ${{ matrix.builds.image_name }}
needs: envs_setup
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.envs_setup.outputs.matrix) }}

runs-on: ubuntu-latest

steps:
- name: checkout tari
uses: actions/checkout@v3
with:
path: tari

- name: checkout tari-launchpad
uses: actions/checkout@v3
with:
repository: ${{ env.LAUNCHPAD_REPO }}
ref: ${{ env.LAUNCHPAD_BRANCH }}
path: tari-launchpad

- name: environment setup
shell: bash
run: |
IMAGE_NAME=${{ matrix.builds.image_name }}
if [ -z "${{ inputs.version }}" ]; then
echo "Get tari version"
TARI_SOURCE_ROOT="tari/"
VAPP=$(awk -F ' = ' \
'$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' \
"${TARI_SOURCE_ROOT}/applications/tari_base_node/Cargo.toml")
VBRANCH=$(git --git-dir ${TARI_SOURCE_ROOT}/.git branch --show-current)
VSHA_SHORT=$(git --git-dir ${TARI_SOURCE_ROOT}/.git rev-parse --short HEAD)
VERSION="v${VAPP}_${VBRANCH}_$(date -u '+%Y%m%d')_${VSHA_SHORT}"
else
VERSION=${{ inputs.version }}
fi
echo "Setting ${VERSION} as docker tag"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
if [ ! -z "${{ inputs.tag_alias }}" ]; then
echo "Setup tag_alias"
echo "TAG_ALIAS=${{ secrets.DOCKER_PROVIDER }}/${{ secrets.DOCKER_REPO }}/${{ matrix.builds.image_name }}:${{ inputs.tag_alias }}" >> $GITHUB_ENV
fi
if [ "${IMAGE_NAME:0:5}" = "tari_" ] ; then
echo "Tari builds"
mkdir -p tari/buildtools/docker_rig
cp -v tari-launchpad/docker_rig/start_tari_app.sh tari/buildtools/docker_rig/start_tari_app.sh
echo "DOCKERFILE=tarilabs" >> $GITHUB_ENV
echo "APP_NAME=${{ matrix.builds.app_name }}" >> $GITHUB_ENV
echo "APP_EXEC=${{ matrix.builds.app_exec }}" >> $GITHUB_ENV
else
echo "3rd Party builds - ${IMAGE_NAME}"
if [ -f "./tari-launchpad/docker_rig/${IMAGE_NAME}.Dockerfile" ]; then
echo "DOCKERFILE=${IMAGE_NAME}" >> $GITHUB_ENV
SUBTAG=$(awk -v search="^ARG ${IMAGE_NAME^^}?_VERSION=" -F '=' '$0 ~ search \
{ gsub(/["]/, "", $2); printf("%s",$2) }' \
"./tari-launchpad/docker_rig/${IMAGE_NAME}.Dockerfile")
echo "Docker subtag - ${SUBTAG}"
echo "VERSION=${SUBTAG}_${VERSION}" >> $GITHUB_ENV
echo "DOCKER_SUBTAG=--build-arg ${IMAGE_NAME^^}_VERSION=${SUBTAG}" >> $GITHUB_ENV
else
"!! ${IMAGE_NAME}.Dockerfile file not found !!"
exit 1
fi
fi
- name: Login to Docker Image Provider
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_PROVIDER }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker image build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./tari/
file: ./tari-launchpad/docker_rig/${{ env.DOCKERFILE }}.Dockerfile
platforms: ${{ inputs.platforms }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ env.VERSION }}
ARCH=${{ inputs.arch }}
FEATURES=${{ inputs.features }}
APP_NAME=${{ matrix.builds.app_name }}
APP_EXEC=${{ matrix.builds.app_exec }}
${{ env.DOCKER_SUBTAG }}
tags: |
${{ secrets.DOCKER_PROVIDER }}/${{ secrets.DOCKER_REPO }}/${{ matrix.builds.image_name }}:${{ env.VERSION }}
${{ env.TAG_ALIAS }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
40 changes: 1 addition & 39 deletions applications/tari_app_grpc/proto/base_node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ service BaseNode {
// Get mempool stats
rpc GetMempoolStats(Empty) returns (MempoolStatsResponse);

rpc GetTokens(GetTokensRequest) returns (stream GetTokensResponse);
rpc ListAssetRegistrations(ListAssetRegistrationsRequest) returns (stream ListAssetRegistrationsResponse);
rpc GetAssetMetadata(GetAssetMetadataRequest) returns (GetAssetMetadataResponse);

// Get all constitutions where the public key is in the committee
rpc GetConstitutions(GetConstitutionsRequest) returns (stream GetConstitutionsResponse);
// Get the current contract outputs matching the given contract id and type
rpc GetCurrentContractOutputs(GetCurrentContractOutputsRequest) returns (GetCurrentContractOutputsResponse);
}

message GetAssetMetadataRequest {
Expand Down Expand Up @@ -441,38 +433,8 @@ enum TransactionLocation {
}

message MempoolStatsResponse {
uint64 total_txs = 1;
uint64 unconfirmed_txs = 2;
uint64 reorg_txs = 3;
uint64 total_weight = 4;
}

message GetConstitutionsRequest {
bytes start_block_hash = 1;
bytes dan_node_public_key = 2;
}

message GetConstitutionsResponse {
TransactionOutput output = 1;
uint32 mmr_position = 2;
uint64 mined_height = 3;
bytes header_hash = 4;
uint64 mined_timestamp = 5;
uint64 unconfirmed_weight = 4;
}

message GetCurrentContractOutputsRequest {
bytes contract_id = 1;
uint32 output_type = 2;
}

message GetCurrentContractOutputsResponse {
repeated UtxoMinedInfo outputs = 1;
}

message UtxoMinedInfo {
TransactionOutput output = 1;
uint32 mmr_position = 2;
uint64 mined_height = 3;
bytes header_hash = 4;
uint64 mined_timestamp = 5;
}
Loading

0 comments on commit 39f7c9a

Please sign in to comment.