Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gosdk #594

Open
wants to merge 311 commits into
base: staging
Choose a base branch
from
Open
Changes from 24 commits
Commits
Show all changes
311 commits
Select commit Hold shift + click to select a range
f19697f
updated gosdk
dabasov Apr 20, 2024
a9cb1c0
fixed build
dabasov Apr 21, 2024
07d60cb
add docs to transfer allocation ownership command
devyetii Apr 21, 2024
722de2b
Merge remote-tracking branch 'origin/sprint-1.14' into doc/update
Apr 25, 2024
8255a6c
fixed till kill-validator
Apr 25, 2024
b00c645
fix get content type
Hitenjain14 Apr 26, 2024
ed311b0
Merge pull request #613 from 0chain/fix/sync-content
dabasov Apr 26, 2024
255c298
Merge remote-tracking branch 'origin/sprint-1.14' into doc/update
Apr 26, 2024
33de0f7
added more documentations
Apr 26, 2024
c331118
some fixes
devyetii Apr 27, 2024
9b89f55
resolved all the comments
Apr 28, 2024
7f576b3
fixes
Apr 28, 2024
1474130
removed garbage
Apr 28, 2024
8f02916
fixes
Apr 29, 2024
2feeca5
update gosdk
Hitenjain14 Apr 30, 2024
4fc6ef2
Merge pull request #614 from 0chain/feat/gosdk-update
dabasov Apr 30, 2024
b5714a0
fnialize list command
devyetii May 2, 2024
43d212c
Merge branch 'sprint-1.14' into doc/update
devyetii May 2, 2024
6e1445f
Merge pull request #612 from 0chain/doc/update
dabasov May 2, 2024
5ec6811
Update gosdk.yml (#615)
shahnawaz-creator May 5, 2024
dc2fbc7
Merge pull request #616 from 0chain/sprint-1.14
dabasov May 5, 2024
f179af5
updated gosdk
dabasov May 5, 2024
bbab9c8
Adding authorizer in sp-unlock and sp-info
Ash-KODES May 11, 2024
70dcc5a
Bug fix
Ash-KODES May 12, 2024
12540b0
Merge branch 'staging' of https://github.com/0chain/zboxcli into fix/…
Hitenjain14 May 20, 2024
3c6ac4e
update gosdk
Hitenjain14 May 21, 2024
112908c
refactor intro and add config section
devyetii May 22, 2024
97b0f30
Merge pull request #619 from 0chain/doc/hotfix/remove-zus-overview
dabasov May 30, 2024
2c30b39
Merge pull request #617 from 0chain/Feat/AuthorizerStake
dabasov May 30, 2024
72b4851
Merge pull request #618 from 0chain/fix/sync-update
dabasov May 30, 2024
bc9f172
Merge pull request #622 from 0chain/sprint-1.15
dabasov May 30, 2024
902a9d3
updated gosdk
dabasov May 30, 2024
b0fed8e
fix readme
devyetii Jun 3, 2024
2c3b5ef
Merge pull request #623 from 0chain/hotfix/readme
guruhubb Jun 3, 2024
88986f4
add flag for skip check
Hitenjain14 Jun 11, 2024
55da438
fix status check
Hitenjain14 Jun 11, 2024
9736e87
Merge pull request #625 from 0chain/feat/skip-check
dabasov Jun 11, 2024
0b4220f
repair-size command
storybehind Jun 14, 2024
1897610
update gosdk version
storybehind Jun 14, 2024
ac90113
Merge branch 'sprint-1.16' into repair-size
storybehind Jun 14, 2024
da0b3e3
Merge pull request #626 from 0chain/repair-size
dabasov Jun 21, 2024
423e3f6
Merge branch 'staging' into sprint-1.16
dabasov Jun 26, 2024
586c467
updated gosdk
dabasov Jun 26, 2024
0c8e404
updated gosdk
dabasov Jun 26, 2024
d593e1d
Update gosdk
Jayashsatolia403 Jun 27, 2024
64e7f28
Feature: migrate from the usage of Tenderly forks in favour of Tender…
YarikRevich Jul 6, 2024
91722eb
Merge pull request #627 from 0chain/sprint-1.16
dabasov Jul 9, 2024
0921b57
updated gosdk
dabasov Jul 9, 2024
c87e0d6
basic workflow to build and distribute
storybehind Jul 22, 2024
a3bc83a
Merge branch 'sprint-1.17' into packaging
storybehind Jul 22, 2024
cea40db
update docker image
storybehind Jul 22, 2024
e77637a
Merge branch 'packaging' of https://github.com/0chain/zboxcli into pa…
storybehind Jul 22, 2024
5ca81f7
update workflow
storybehind Jul 22, 2024
7ff0b7d
update workflow env
storybehind Jul 24, 2024
ad8baba
update docker buildx setup
storybehind Jul 24, 2024
6e2afbf
update docker buildx setup
storybehind Jul 24, 2024
46bba3d
install scp
storybehind Jul 24, 2024
924e71f
install openssh-client
storybehind Jul 24, 2024
784ca55
setup ssh_key handling
storybehind Jul 24, 2024
661e72e
remove docker setup and upload gpg public key
storybehind Jul 24, 2024
5ae3cb7
use docker buildx
storybehind Jul 24, 2024
daa222c
update docker buildx setup
storybehind Jul 24, 2024
e20e110
update docker buildx setup
storybehind Jul 24, 2024
01a1fa5
install docker latest
storybehind Jul 24, 2024
f200cd2
unset docker host
storybehind Jul 24, 2024
fbce2c5
use containerd driver
storybehind Jul 24, 2024
4ee865e
use ubuntu-latest
storybehind Jul 24, 2024
d63dbfd
fix incorrect usage of ssh-keyscan
storybehind Jul 24, 2024
4d0d473
use self-hosted runner
storybehind Jul 24, 2024
484978d
Enterprise blobber
Jayashsatolia403 Jul 24, 2024
871445e
install script and test
storybehind Jul 25, 2024
0d8af60
fix workflow syntax
storybehind Jul 25, 2024
e74e883
add verbose in scp command
storybehind Jul 25, 2024
15add09
fix scp directory recursive copy
storybehind Jul 25, 2024
bdf1664
update workflow
storybehind Jul 26, 2024
9c84b83
fix copy debian packages
storybehind Jul 26, 2024
bb0a646
fix copy debian packages
storybehind Jul 26, 2024
5556dca
import GPG_PRIVATE_KEY in distribute job
storybehind Jul 26, 2024
01d2804
fix gpg signing issue
storybehind Jul 26, 2024
82788bf
update workflow
storybehind Jul 26, 2024
716c541
update workflow
storybehind Jul 26, 2024
99ee7a8
fix docker tag and run command
storybehind Jul 26, 2024
e80c464
update workflow to load docker image
storybehind Jul 26, 2024
fd061d9
use musl-gcc to compile and link statically
storybehind Jul 26, 2024
c8c2f1b
use static linking
storybehind Jul 26, 2024
6b61ba7
install gcc-11 in deb install script
storybehind Jul 26, 2024
dbf851d
install gcc-11 in user's env
storybehind Jul 27, 2024
547b54a
provide all platforms
storybehind Jul 27, 2024
05e0fcd
remove unsupported platforms
storybehind Jul 27, 2024
a1ffcee
test ubuntu distributions
storybehind Jul 28, 2024
6daf8fe
fix goarch value
storybehind Jul 28, 2024
13d1a3b
setup docker qemu
storybehind Jul 28, 2024
f597f1d
separate build file for arm64
storybehind Jul 28, 2024
955a1db
update workflow
storybehind Jul 28, 2024
2aacd6d
move dockerfile
storybehind Jul 28, 2024
fdd46be
set compiler for arm64 build
storybehind Jul 28, 2024
03b624d
Fix input
Jayashsatolia403 Jul 29, 2024
80140b2
fix dockerfile to target platform
storybehind Jul 29, 2024
125a0e0
update workflow
storybehind Jul 29, 2024
a11c4f3
update golang base image
storybehind Jul 29, 2024
b78237f
fix dockerfile
storybehind Jul 29, 2024
6f14ed5
set gcc-11 as default
storybehind Jul 29, 2024
f53d251
try static linking
storybehind Jul 29, 2024
867687d
refactor
storybehind Jul 29, 2024
bc9ec93
remove sudo in dockerfile
storybehind Jul 29, 2024
2f8d0b8
add debian distro
storybehind Jul 31, 2024
b0f0189
install dependencies in user env
storybehind Jul 31, 2024
ed7ed9c
try gzip compression
storybehind Jul 31, 2024
e9b7466
test windows compilation
storybehind Aug 1, 2024
341aa87
remove setup qemu step on windows-runner
storybehind Aug 1, 2024
a8ae7bd
update release workflow
storybehind Aug 1, 2024
ee62d72
update docker buildx version
storybehind Aug 1, 2024
ba3f065
update release to build on darwin & linux
storybehind Aug 3, 2024
458465b
fix release workflow
storybehind Aug 3, 2024
5d8d5b6
fix release workflow
storybehind Aug 3, 2024
241f2bb
update release workflow
storybehind Aug 3, 2024
cf84966
update release workflow
storybehind Aug 3, 2024
86eae3f
update release workflow
storybehind Aug 3, 2024
f921090
update release workflow
storybehind Aug 3, 2024
55ccd2a
update release workflow
storybehind Aug 3, 2024
06b687f
fix block worker
devyetii Aug 3, 2024
a31a8ac
Merge pull request #634 from 0chain/doc/fix-block-worker-link
dabasov Aug 3, 2024
8db8653
include -lstdc++
storybehind Aug 4, 2024
b615431
install libc++
storybehind Aug 4, 2024
638050e
update release workflow
storybehind Aug 4, 2024
ee02551
update release workflow
storybehind Aug 4, 2024
7110311
update release workflow
storybehind Aug 4, 2024
7091102
update release workflow
storybehind Aug 4, 2024
1562ecc
update release workflow
storybehind Aug 4, 2024
ca5f3ef
update release workflow
storybehind Aug 4, 2024
3ff3f1e
remove darwin job & fix distribute zbox workflow
storybehind Aug 5, 2024
3d45dd3
fix version & remove windows docker build
storybehind Aug 5, 2024
bfe197d
fix update repo commands
storybehind Aug 6, 2024
caca55a
fix update repo commands
storybehind Aug 6, 2024
d3f463d
update config & workflow dispatch
storybehind Aug 6, 2024
1f7d240
create release & upload artifacts
storybehind Aug 6, 2024
de7ffaf
Merge pull request #630 from 0chain/packaging
dabasov Aug 6, 2024
1b21090
initial commit
storybehind Aug 10, 2024
d5db945
fix update aptrepo step
storybehind Aug 10, 2024
89f35ac
Merge branch 'staging' into packaging
dabasov Aug 10, 2024
9d522fa
Merge pull request #635 from 0chain/packaging
dabasov Aug 10, 2024
ba0c69c
Merge branch 'staging' into sprint-1.17
dabasov Aug 10, 2024
aab3abe
updated gosdk
dabasov Aug 10, 2024
fdb4da0
Update gosdk
Jayashsatolia403 Aug 10, 2024
31b4930
Merge branch 'sprint-1.17' into feature/enterprise-blobber
Jayashsatolia403 Aug 10, 2024
33b31c4
Merge pull request #631 from 0chain/feature/enterprise-blobber
Jayashsatolia403 Aug 10, 2024
1f6c92b
Merge branch 'sprint-1.17' into fix-distribute-workflow
storybehind Aug 12, 2024
4408996
Merge pull request #636 from 0chain/fix-distribute-workflow
dabasov Aug 12, 2024
42b1c7c
release and dockerfile
storybehind Aug 17, 2024
4c1c33f
fix upload-asset step
storybehind Aug 17, 2024
0ad9b62
updated gosdk
dabasov Aug 17, 2024
0a71b0d
add config file in zip
storybehind Aug 18, 2024
5c4c4ef
provide default config
storybehind Aug 20, 2024
817b714
fix version str
storybehind Aug 20, 2024
3580449
alternate darwin build
storybehind Aug 23, 2024
7bf630a
fix darwin release workflow
storybehind Aug 23, 2024
97695db
try arm64
storybehind Aug 23, 2024
57dcb12
Fix
Jayashsatolia403 Aug 24, 2024
5916ff8
Repo snapshots
Jayashsatolia403 Aug 24, 2024
68e0de9
fix amd64 build
storybehind Aug 25, 2024
40e7a1d
refactor
storybehind Aug 25, 2024
58ac8fd
provide macosx-version-min
storybehind Aug 25, 2024
1003f0f
Merge branch 'sprint-1.17' into darwin-build
storybehind Aug 25, 2024
905b261
Merge pull request #637 from 0chain/darwin-build
dabasov Aug 25, 2024
c1e9227
initial release workflow for windows
storybehind Aug 30, 2024
7fbdd17
fix release workflow
storybehind Aug 30, 2024
87758d3
remove arm64 build
storybehind Aug 30, 2024
7c4cd0f
fix release workflow
storybehind Aug 30, 2024
a20e577
Merge branch 'sprint-1.17' into fix/refactor-zboxcore
Jayashsatolia403 Aug 31, 2024
f7a10e7
initial distribute workflow through choco
storybehind Sep 1, 2024
0bb45f6
fix distribute workflow
storybehind Sep 1, 2024
b669b27
fix: added wallet information initialization
YarikRevich Sep 1, 2024
d241faa
Merge pull request #641 from 0chain/fix/wallet-info
dabasov Sep 1, 2024
3507632
Merge branch 'staging' into sprint-1.17
dabasov Sep 1, 2024
bdaeee4
Merge pull request #640 from 0chain/sprint-1.17
dabasov Sep 1, 2024
a3417dd
updated gosdk
dabasov Sep 1, 2024
ae8b2f8
updated gosdk
dabasov Sep 1, 2024
0ca5200
fix distribute wokflow
storybehind Sep 2, 2024
de9c435
fix distribute release workflow
storybehind Sep 2, 2024
e7c9e94
fix distribute workflow
storybehind Sep 3, 2024
30fb79e
fix distribute workflow
storybehind Sep 3, 2024
b38ac25
update gosdk v1.17.3
yash10019coder Sep 5, 2024
7dc3982
go mod tidy
Jayashsatolia403 Sep 5, 2024
2672e52
Merge pull request #643 from 0chain/update-gosdk-latest-v1.17.3
Jayashsatolia403 Sep 5, 2024
b33f300
resolve requirements
storybehind Sep 6, 2024
e00e7ab
Fix
Jayashsatolia403 Sep 7, 2024
2139c3a
refactor
storybehind Sep 9, 2024
82bb6a1
Merge branch 'sprint-1.18' into windows-build
storybehind Sep 9, 2024
fb615c9
Update LICENSE
shahnawaz-creator Sep 9, 2024
9d0fc34
Merge branch 'staging' into windows-build
dabasov Sep 10, 2024
86795cf
Merge pull request #639 from 0chain/windows-build
dabasov Sep 10, 2024
70c1baa
Fix
Jayashsatolia403 Sep 11, 2024
dbea278
Merge remote-tracking branch 'origin/sprint-1.18' into fix/refactor-z…
Jayashsatolia403 Sep 11, 2024
dfa88b4
Fix
Jayashsatolia403 Sep 11, 2024
afe72a3
Updated gosdk
Jayashsatolia403 Sep 12, 2024
678be32
Fix
Jayashsatolia403 Sep 13, 2024
8ee4002
Fix
Jayashsatolia403 Sep 13, 2024
f4dd947
added new cmd action to download dir
isandiya Sep 14, 2024
b6e3380
added new cmd action to download dir
isandiya Sep 15, 2024
17e7f61
updated download dir
isandiya Sep 15, 2024
bf7043a
Fix
Jayashsatolia403 Sep 19, 2024
54cd05e
Revert "Fix"
Jayashsatolia403 Sep 19, 2024
8098527
Fix
Jayashsatolia403 Sep 22, 2024
a6db28e
Fix
Jayashsatolia403 Sep 28, 2024
92cb644
Fix gosdk init
Jayashsatolia403 Oct 2, 2024
97eb6c9
Update blobber new fields
Jayashsatolia403 Oct 7, 2024
30debcd
santised
isandiya Oct 9, 2024
f997e82
updated: added storage version and managing tags
Akhilesh53 Oct 10, 2024
cab4264
Merge branch 'feat/storage-v2' into akhilesh/storageV2
Jayashsatolia403 Oct 10, 2024
f02957a
updated: resolved comments
Akhilesh53 Oct 10, 2024
9225ec5
Merge branch 'akhilesh/storageV2' of https://github.com/0chain/zboxcl…
Akhilesh53 Oct 10, 2024
518c673
updated: resolved coments
Akhilesh53 Oct 10, 2024
61d7976
updated: removed duplicated cmds
Akhilesh53 Oct 11, 2024
d90ab6b
updated: type changed for storage version
Akhilesh53 Oct 11, 2024
c0f9c0e
Merge pull request #644 from 0chain/sandigo/downloaddir
dabasov Oct 13, 2024
d7ea62c
Merge branch 'sprint-1.18' into feat/storage-v2
Jayashsatolia403 Oct 13, 2024
ef9dd6a
updated gosdk
dabasov Oct 19, 2024
3003319
updated gosdk
dabasov Oct 19, 2024
0beaba3
Feature multi wallet
Jayashsatolia403 Oct 19, 2024
37bcd0a
Merge pull request #649 from 0chain/feature/multi-wallet
dabasov Oct 22, 2024
745b0f8
Merge branch 'sprint-1.18' into fix/refactor-zboxcore
dabasov Oct 22, 2024
77b0dcf
Merge pull request #638 from 0chain/fix/refactor-zboxcore
dabasov Oct 22, 2024
1f04698
updated gosdk
dabasov Oct 22, 2024
ba69bd7
updated gosdk
dabasov Oct 22, 2024
508438e
session key
Hitenjain14 Oct 30, 2024
a4c3fdd
Merge branch 'sprint-1.18' into feat/storage-v2
Jayashsatolia403 Oct 30, 2024
1cfde7b
Merge branch 'feat/storage-v2' into akhilesh/storageV2
Jayashsatolia403 Oct 30, 2024
6f376ed
Update zbox build
Jayashsatolia403 Oct 30, 2024
a0309f4
Merge branch 'feat/storage-v2' into akhilesh/storageV2
Jayashsatolia403 Oct 30, 2024
cbc1629
Merge pull request #647 from 0chain/akhilesh/storageV2
Jayashsatolia403 Oct 30, 2024
33295fb
Update zbox build
Jayashsatolia403 Oct 30, 2024
8af334d
Merge remote-tracking branch 'origin/feat/storage-v2' into feat/stora…
Jayashsatolia403 Oct 30, 2024
3431398
Fix build
Jayashsatolia403 Oct 30, 2024
4b445c7
Merge pull request #646 from 0chain/feat/storage-v2
Jayashsatolia403 Oct 30, 2024
54dc98e
Update gosdk
Jayashsatolia403 Oct 30, 2024
b6ac1fc
updated gosdk
dabasov Nov 1, 2024
575d8ed
Merge remote-tracking branch 'origin/sprint-1.18' into sprint-1.18
dabasov Nov 1, 2024
f34e79c
Merge branch 'sprint-1.18' of https://github.com/0chain/zboxcli into …
Hitenjain14 Nov 2, 2024
f7b5382
Merge pull request #650 from 0chain/feat/session-key
dabasov Nov 2, 2024
47f9825
Update blobber version reset
Jayashsatolia403 Nov 2, 2024
8a61a54
Added insert killed ID cmd
Jayashsatolia403 Nov 2, 2024
8136b7d
updated gosdk
dabasov Nov 13, 2024
b91e834
Fix storage_version type
Jayashsatolia403 Nov 17, 2024
92ff974
update go version
storybehind Nov 20, 2024
89e7040
fix release yml
storybehind Nov 20, 2024
c647cda
Merge pull request #652 from 0chain/update-go-version
dabasov Nov 20, 2024
b721927
feature: added kms wallet detection
YarikRevich Dec 6, 2024
bf74eef
Merge pull request #654 from 0chain/feature/kms-wallet-setup
Jayashsatolia403 Dec 10, 2024
11c2d11
update gosdk
Hitenjain14 Dec 11, 2024
2ad6a26
Merge branch 'update/gosdk' of https://github.com/0chain/zboxcli into…
Hitenjain14 Dec 11, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build, Distribute and Test zbox
name: Distribute zbox using apt

on:
workflow_dispatch:
175 changes: 175 additions & 0 deletions .github/workflows/distribute-zboxcli-choco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: Distribute zbox using choco

on:
workflow_dispatch:
inputs:
version:
description: 'Version of zbox to release'
required: true
default: '1.0.0'

env:
APP_NAME: zbox
PACKAGE_ID: zbox
APP_VERSION: ${{ github.event.inputs.version }}
GO_VERSION: '1.21'

jobs:
build:
runs-on: windows-latest
env:
SRC_DIR: ${{ github.workspace }}\src
OUTPUT_DIR: ${{ github.workspace }}\output
PACKAGE_DIR: ${{ github.workspace }}\package

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
path: ${{ env.SRC_DIR }}

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install MinGW for CGo
run: |
choco install mingw

- name: Setup
run : |
New-Item -ItemType Directory -Force -Path "${{ env.OUTPUT_DIR }}\amd64"
New-Item -ItemType Directory -Force -Path "${{ env.PACKAGE_DIR }}"
Copy-Item -Force -Path "${{ env.SRC_DIR }}\cmd\config.yaml" -Destination "${{ env.OUTPUT_DIR }}\amd64\"

- name: Build ${{ env.APP_NAME }} for amd64
run: |
Set-Location -Path "${{ env.SRC_DIR }}"
$env:CGO_ENABLED="1"
$env:CC="x86_64-w64-mingw32-gcc"
$env:CXX="x86_64-w64-mingw32-g++"
$env:GOOS="windows"
$env:GOARCH="amd64"
where x86_64-w64-mingw32-gcc
where x86_64-w64-mingw32-g++
go build -x -v -tags bn256 -ldflags "-X main.VersionStr=v${{ env.APP_VERSION }}" -o ${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}.exe .
shell: pwsh

- name: Generate SHA256 Checksum
id: checksum
shell: pwsh
run: |
$checksum = Get-FileHash "${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}.exe" -Algorithm SHA256
Write-Output "::set-output name=checksum::$($checksum.Hash)"

- name: Create VERIFICATION.txt
shell: pwsh
run: |
Set-Location -Path "${{ env.PACKAGE_DIR }}"
$location = Get-Location
Write-Host "Current Directory: $location"
$files = Get-ChildItem "${{ env.PACKAGE_DIR }}"
Write-Host "Files in Directory: $files"

$verificationContent = @"
The binaries in this package were sourced from the official https://github.com/0chain/zboxcli repository.

Verification Steps:
1. The SHA256 checksum of the binary was calculated.
2. Users can verify the binary themselves by running the following command:
`Get-FileHash -Algorithm SHA256 ${{ env.APP_NAME }}.exe`

Expected checksum:
${{ steps.checksum.outputs.checksum }}
"@

$verificationContent | Out-File -FilePath "VERIFICATION.txt" -Encoding utf8
Write-Host "Created VERIFICATION.txt file"
Get-ChildItem "${{ env.PACKAGE_DIR }}"

$fileContent = Get-Content -Path "VERIFICATION.txt"
Write-Host "File Content: $fileContent"

- name: Create Chocolatey Install Script
run: |
Set-Location -Path "${{ env.PACKAGE_DIR }}"
$location = Get-Location
Write-Host "Current Directory: $location"
$files = Get-ChildItem "${{ env.PACKAGE_DIR }}"
Write-Host "Files in Directory: $files"

$content = @'
$installDir = "$(Get-ToolsLocation)\zbox"
$envPath = [System.Environment]::GetEnvironmentVariable('Path', 'Machine')

if ($envPath -notlike "*$installDir*") {
Write-Host "Adding $installDir to PATH"
[System.Environment]::SetEnvironmentVariable('Path', "$envPath;$installDir", 'Machine')
}
'@

$content | Out-File -FilePath "chocolateyInstall.ps1" -Encoding utf8
Write-Host "Created chocolateyInstall.ps1 file"
Get-ChildItem "${{ env.PACKAGE_DIR }}"

$fileContent = Get-Content -Path "chocolateyInstall.ps1"
Write-Host "File Content: $fileContent"

- name: Create .nuspec file
run: |
Set-Location -Path "${{ env.PACKAGE_DIR }}"
$location = Get-Location
Write-Host "Current Directory: $location"
$files = Get-ChildItem "${{ env.PACKAGE_DIR }}"
Write-Host "Files in Directory: $files"
$content = @"
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>${{ env.PACKAGE_ID }}</id>
<version>${{ env.APP_VERSION }}</version>
<authors>Saswata Basu</authors>
<owners>Saswata Basu</owners>
<tags>zbox cloud storage cli windows golang</tags>
<licenseUrl>https://github.com/0chain/zboxcli/blob/staging/LICENSE</licenseUrl>
<projectUrl>https://github.com/0chain/zboxcli</projectUrl>
<packageSourceUrl>https://github.com/0chain/zboxcli</packageSourceUrl>
<releaseNotes>https://github.com/0chain/zboxcli/releases/latest</releaseNotes>
<summary>zbox is a command line interface (CLI) tool to understand the capabilities of Züs dStorage and prototype your app.</summary>
<description>zbox is a command line interface (CLI) tool to understand the capabilities of Züs dStorage and prototype your app.</description>
<title>zbox CLI</title>
</metadata>
<files>
<file src="${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}.exe" target="tools\${{ env.APP_NAME }}.exe" />
<file src="${{ env.SRC_DIR }}\LICENSE" target="tools\LICENSE" />
<file src="${{ env.PACKAGE_DIR }}\VERIFICATION.txt" target="tools\VERIFICATION.txt" />
<file src="${{ env.PACKAGE_DIR }}\chocolateyInstall.ps1" target="tools\chocolateyInstall.ps1" />
</files>
</package>
"@

$content | Out-File -FilePath "zbox.nuspec" -Encoding utf8
Write-Host "Created .nuspec file:"
Get-ChildItem "${{ env.PACKAGE_DIR }}"

$fileContent = Get-Content -Path "zbox.nuspec"
Write-Host "File Content: $fileContent"

- name: Pack Chocolatey Package
run: |
Set-Location -Path "${{ env.PACKAGE_DIR }}"
$location = Get-Location
Write-Host "Current Directory: $location"
$files = Get-ChildItem "${{ env.PACKAGE_DIR }}"
Write-Host "Files in Directory: $files"
choco pack ${{ env.PACKAGE_ID }}.nuspec

- name: Push Chocolatey Package
run: |
Set-Location -Path "${{ env.PACKAGE_DIR }}"
$location = Get-Location
Write-Host "Current Directory: $location"
$files = Get-ChildItem "${{ env.PACKAGE_DIR }}"
Write-Host "Files in Directory: $files"
choco push ${{ env.PACKAGE_ID }}.${{ env.APP_VERSION }}.nupkg --source https://push.chocolatey.org/ -k ${{ secrets.CHOCOLATEY_API_KEY }}
68 changes: 65 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ jobs:
cd ${{ env.OUTPUT_DIR }}
zip -qq -r ${{ env.APP_NAME }}-linux-amd64.zip ${{ env.APP_NAME }} config.yaml

- name: Upload Zip for Darwin/amd64
- name: Upload Zip for linux/amd64
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-linux-amd64
@@ -120,7 +120,7 @@ jobs:
cd ${{ env.OUTPUT_DIR }}
zip -qq -r ${{ env.APP_NAME }}-linux-arm64.zip ${{ env.APP_NAME }} config.yaml

- name: Upload Zip for Darwin/arm64
- name: Upload Zip for linux/arm64
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-linux-arm64
@@ -161,7 +161,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: ${{ env.GO_VERSION }}

- name: Setup
run : |
@@ -221,3 +221,65 @@ jobs:
asset_path: ${{ env.OUTPUT_DIR }}/arm64/${{ env.APP_NAME }}-darwin-arm64.zip
asset_name: ${{ env.APP_NAME }}-darwin-arm64.zip
asset_content_type: application/zip

windows:
runs-on: windows-latest
needs: create_release
env:
SRC_DIR: ${{ github.workspace }}\src
OUTPUT_DIR: ${{ github.workspace }}\output
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: ${{ env.SRC_DIR }}

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install MinGW for CGo
run: |
choco install mingw

- name: Setup
run : |
New-Item -ItemType Directory -Force -Path "${{ env.OUTPUT_DIR }}\amd64"
Copy-Item -Force -Path "${{ env.SRC_DIR }}\cmd\config.yaml" -Destination "${{ env.OUTPUT_DIR }}\amd64\"

- name: Build ${{ env.APP_NAME }} for amd64
run: |
Set-Location -Path "${{ env.SRC_DIR }}"
$env:CGO_ENABLED="1"
$env:CC="x86_64-w64-mingw32-gcc"
$env:CXX="x86_64-w64-mingw32-g++"
$env:GOOS="windows"
$env:GOARCH="amd64"
where x86_64-w64-mingw32-gcc
where x86_64-w64-mingw32-g++
go build -x -v -tags bn256 -ldflags "-X main.VersionStr=v${{ env.VERSION }}" -o ${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}.exe .
shell: pwsh

- name: Create Zip File for windows/amd64
run: |
Set-Location -Path "${{ env.OUTPUT_DIR }}\amd64"
Compress-Archive -Path @("${{ env.APP_NAME }}.exe", "config.yaml") -DestinationPath ${{ env.APP_NAME }}-windows-amd64.zip

- name: Upload Zip for windows/amd64
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-windows-amd64
path: ${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}-windows-amd64.zip

- name: Upload Release Asset for windows/amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.OUTPUT_DIR }}\amd64\${{ env.APP_NAME }}-windows-amd64.zip
asset_name: ${{ env.APP_NAME }}-windows-amd64.zip
asset_content_type: application/zip


41 changes: 24 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
MIT License
Non-compete BSD-3-Clause

Copyright (c) 2019 0Chain
Copyright © 2019 0Chain,LLC.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

4. It is not permitted to provide any offering that competes with the source code and binary form
or any other offering the licensor provides using the source code and binary form.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
65 changes: 65 additions & 0 deletions cmd/downloaddir.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package cmd

import (
"context"
"os"
"sync"

"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/spf13/cobra"
)

// downloadCmd represents download directory command
var downdirCmd = &cobra.Command{
Use: "downloaddir",
Short: "download directory from blobbers",
Long: `download directory from blobbers`,
Args: cobra.MinimumNArgs(0),
Run: func(cmd *cobra.Command, args []string) {
fflags := cmd.Flags() // fflags is a *flag.FlagSet
if !(fflags.Changed("remotepath") || fflags.Changed("authticket")) {
PrintError("Error: remotepath / authticket flag is missing")
os.Exit(1)
}

remotePath := cmd.Flag("remotepath").Value.String()
authTicket := cmd.Flag("authticket").Value.String()
localPath := cmd.Flag("localpath").Value.String()
allocationID := cmd.Flag("allocation").Value.String()

var allocationObj *sdk.Allocation
if !fflags.Changed("allocation") { // check if the flag "path" is set
PrintError("Error: allocation flag is missing") // If not, we'll let the user know
os.Exit(1) // and return
}
allocationObj, err := sdk.GetAllocation(allocationID)
if err != nil {
PrintError("Error fetching the allocation", err)
os.Exit(1)
}
wg := &sync.WaitGroup{}
statusBar := &StatusBar{wg: wg}
wg.Add(1)
errE := allocationObj.DownloadDirectory(context.Background(), remotePath, localPath, authTicket, statusBar)
if errE == nil {
wg.Wait()
} else {
PrintError("Download failed.", errE.Error())
os.Exit(1)
}
if !statusBar.success {
os.Exit(1)
}
},
}

func init() {
rootCmd.AddCommand(downdirCmd)
downdirCmd.PersistentFlags().String("allocation", "", "Allocation ID")
downdirCmd.PersistentFlags().String("remotepath", "", "Remote path of directory to download")
downdirCmd.PersistentFlags().String("localpath", "", "Local path of directory to download")
downdirCmd.PersistentFlags().String("authticket", "", "Auth ticket fot the file to download if you dont own it")
downdirCmd.MarkFlagRequired("allocation")
downdirCmd.MarkFlagRequired("localpath")
downdirCmd.MarkFlagRequired("remotepath")
}
2 changes: 1 addition & 1 deletion cmd/storage.go
Original file line number Diff line number Diff line change
@@ -379,7 +379,7 @@ func init() {

buf := blobberUpdateCmd.Flags()
buf.String("blobber_id", "", "blobber ID, required")
buf.Int64("capacity", 0, "update blobber capacity bid, optional")
buf.Int64("capacity", 0, " update blobber capacity bid, optional")
buf.Float64("read_price", 0.0, "update read_price, optional")
buf.Float64("write_price", 0.0, "update write_price, optional")
buf.Duration("max_offer_duration", 0*time.Second, "update max_offer_duration, optional")
Loading
Loading