Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 0chain/zboxcli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4.4
Choose a base ref
...
head repository: 0chain/zboxcli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: staging
Choose a head ref
Loading
Showing with 3,786 additions and 1,437 deletions.
  1. +16 −0 .github/workflows/automate-add-issue-in-project.yaml
  2. +14 −6 .github/workflows/backup.yml
  3. +76 −101 .github/workflows/build-zbox.yaml
  4. +1 −2 .github/workflows/codeql-analysis.yml
  5. +290 −0 .github/workflows/distribute-zboxcli-apt.yml
  6. +175 −0 .github/workflows/distribute-zboxcli-choco.yml
  7. +6 −6 .github/workflows/gosdk.yml
  8. +65 −30 .github/workflows/{build-zboxcli.yml → release-zboxcli.yml}
  9. +285 −0 .github/workflows/release.yml
  10. +14 −40 .github/workflows/system_tests.yml
  11. +48 −29 .github/workflows/tests.yml
  12. +24 −17 LICENSE
  13. +3 −5 Makefile
  14. +741 −483 README.md
  15. +7 −0 build.log
  16. +1 −0 cmd/add.go
  17. +1 −1 cmd/challengepool.go
  18. +7 −0 cmd/common.go
  19. +1 −1 {network → cmd}/config.yaml
  20. +25 −15 cmd/copy.go
  21. +8 −6 cmd/createdir.go
  22. +14 −5 cmd/delete.go
  23. +87 −13 cmd/download.go
  24. +1 −1 cmd/download_m3u8.go
  25. +65 −0 cmd/downloaddir.go
  26. +1 −1 cmd/feed.go
  27. +2 −1 cmd/fileRefs.go
  28. +1 −1 cmd/filemeta.go
  29. +1 −1 cmd/filestats.go
  30. +1 −1 cmd/finalizeallocation.go
  31. +1 −1 cmd/get_upload_cost.go
  32. +3 −3 cmd/getallocation.go
  33. +1 −0 cmd/getmpt.go
  34. +8 −0 cmd/install.go
  35. +94 −0 cmd/install_windows.go
  36. +38 −0 cmd/kill_blobber.go
  37. +38 −0 cmd/kill_validator.go
  38. +9 −9 cmd/list.go
  39. +1 −1 cmd/listallocations.go
  40. +23 −15 cmd/move.go
  41. +94 −27 cmd/newallocation.go
  42. +0 −157 cmd/readpool.go
  43. +0 −39 cmd/registerwallet.go
  44. +13 −6 cmd/rename.go
  45. +50 −0 cmd/repair.go
  46. +41 −0 cmd/rolllback.go
  47. +36 −55 cmd/root.go
  48. +2 −2 cmd/share.go
  49. +35 −0 cmd/shutdown_blobber.go
  50. +36 −0 cmd/shutdown_validator.go
  51. +54 −20 cmd/stakepool.go
  52. +268 −91 cmd/storage.go
  53. +2 −2 cmd/stream.go
  54. +220 −52 cmd/sync.go
  55. +8 −23 cmd/update.go
  56. +81 −53 cmd/updateallocation.go
  57. +84 −59 cmd/upload.go
  58. +29 −12 cmd/validator.go
  59. +4 −4 cmd/version.go
  60. +6 −6 cmd/walletinfo.go
  61. +31 −10 go.mod
  62. +129 −23 go.sum
  63. +213 −0 internal.md
  64. +17 −0 multi-download.json
  65. +16 −0 multi-upload.json
  66. +8 −0 scripts/debian/Dockerfile.build
  67. +20 −0 scripts/debian/Dockerfile.install_test
  68. +91 −0 scripts/debian/install.sh
  69. +1 −1 util/tablewriter.go
16 changes: 16 additions & 0 deletions .github/workflows/automate-add-issue-in-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add Issue to Backend Issues Project Board

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add Issue to Backend Issues Project Board
runs-on: arc-runner
steps:
- uses: actions/add-to-project@v0.4.0
with:
project-url: https://github.com/orgs/0chain/projects/${{ secrets.PROJECT_NUMBER }}
github-token: ${{ secrets.ACCESS_TOKEN }}
20 changes: 14 additions & 6 deletions .github/workflows/backup.yml
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@ on:

jobs:
s3Backup:
runs-on: docker-builds
runs-on: arc-runner
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Get info
id: get_info
@@ -25,18 +25,26 @@ jobs:
- name: Create backup
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
run: |
github-backup -O 0chain -P -t ${{ secrets.ACCESS_TOKEN }} --output-directory=/github-backup/zboxcli --all -O -R zboxcli
sudo apt update && sudo apt install python3-pip -y
sudo pip3 install github-backup
sudo github-backup -O 0chain -P -t ${{ secrets.ACCESS_TOKEN }} --output-directory=/github-backup/zboxcli --all -O -R zboxcli
- name: Create zip
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
run: zip -r zboxcli.zip /github-backup/zboxcli
run: sudo zip -r zboxcli.zip /github-backup/zboxcli

- name: Install AWS
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Set AWS credentials
if: steps.get_info.outputs.GIT_COMMIT_DATE == steps.get_info.outputs.YESTERDAY_DATE
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2

- name: Backup to s3
177 changes: 76 additions & 101 deletions .github/workflows/build-zbox.yaml
Original file line number Diff line number Diff line change
@@ -3,155 +3,130 @@ on:
push:
branches:
- master
- dev
- sprint*
- staging
tags:
- 'v*.*.*'
pull_request:
workflow_dispatch:

jobs:
build-linux:
name: Build-linux
# runs-on: ubuntu-latest
runs-on: [self-hosted, build]
runs-on: [self-hosted, arc-runner]
steps:

- name: Setup go 1.18
uses: actions/setup-go@v2
with:
go-version: '1.18' # The Go version to download (if necessary) and use.
- name: Install deps
run: |
sudo apt update
sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev containerd docker.io
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4



- name: Set GITHUB_ENV
- name: Setup gopath and gocache
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
fi
echo "GOPATH=$HOME/go" >> $GITHUB_ENV
echo "GOCACHE=$GITHUB_WORKSPACE/.gocache" >> $GITHUB_ENV
- name: Install
run: make install

- name: Zip release
run: tar -czvf zbox-linux.tar.gz ./zbox

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
- name: Setup go 1.21
uses: actions/setup-go@v5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zbox-linux.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true
go-version: '1.21'

- name: Install
run: |
lsb_release -a
make install
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: zbox-linux
path: zbox
retention-days: 5

build-windows:
name: Build-windows
runs-on: windows-latest
runs-on: windows-runner
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
sys: [ MINGW64 ]
steps:
- name: Setup go 1.18
uses: actions/setup-go@v2
- uses: msys2/setup-msys2@v2
with:
go-version: '1.18' # The Go version to download (if necessary) and use.
msystem: ${{matrix.sys}}

- name: Checkout
uses: actions/checkout@v2
- name: Install libraries
run: |
echo 'Y'| pacman -S base-devel git gcc make
- name: Install Clang and Go for MINGW64
run: |
echo 'y'| pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-go zip unzip
- name: Set GITHUB_ENV
- name: Set environment variables
run: |
IF ( "${{github.base_ref}}" -eq "master" -OR "${{github.ref}}" -eq "refs/heads/master" ){
echo "TAG=v0.0.0-master" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ( "${{github.base_ref}}" -eq "dev" -OR "${{github.ref}}" -eq "refs/heads/dev" ){
echo "TAG=v0.0.0-dev" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ElseIf ( "${{github.base_ref}}" -eq "staging" -OR "${{github.ref}}" -eq "refs/heads/staging" ){
echo "TAG=v0.0.0-staging" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
} ELSE {
echo "TAG=${{github.ref}}" | %{$_ -replace('refs/tags/', '')} | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:/usr/bin/7z
# use clang as a default compiler for CGO
go env -w "CC=/mingw64/bin/clang.exe"
- name: Checkout
uses: actions/checkout@v4

- name: Install
run: make install

- name: Zip release
run: |
copy zbox zbox.exe
7z a zbox-windows.zip zbox.exe
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zbox-windows.zip
tag: ${{ env.TAG }}
overwrite: true
file_glob: true
# download dll files
wget https://github.com/0chain/zboxcli/files/11840033/windows.dll.s.zip
unzip -o windows.dll.s.zip
cp zbox zbox.exe
zip zbox-windows.zip zbox.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: zbox-windows
path: zbox
name: zbox-windows.zip
path: zbox-windows.zip
retention-days: 5

- name: cleanup workspace
run: |
rm -Recurse ${{github.workspace}}\*
shell: powershell

build-macos:
name: Build-macos
runs-on: macos-runner-binary
runs-on: macos-latest
steps:

- name: Setup go 1.18
uses: actions/setup-go@v2
- name: Setup go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.18' # The Go version to download (if necessary) and use.
go-version: '1.21'

- name: Checkout
uses: actions/checkout@v2

- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
fi
uses: actions/checkout@v4

- name: Install
run: make install
- name: Zip release
run: tar -czvf zbox-macos.tar.gz ./zbox

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zbox-macos.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true

- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: zbox-macos
path: zbox
retention-days: 5

- name: cleanup workspace
run: |
rm -rf ./*
3 changes: 1 addition & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ on:
jobs:
analyze:
name: Analyze
# runs-on: ubuntu-latest
runs-on: [self-hosted, build]
permissions:
actions: read
@@ -35,7 +34,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Loading