Skip to content
Closed
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
8 changes: 4 additions & 4 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
)

var addCmd = &cobra.Command{
Use: "add",
Short: "Adds free storage assigner",
Long: "Adds free storage assigner",
Args: cobra.MinimumNArgs(0),
Use: "add",
Short: "Adds free storage assigner",
Long: "Adds free storage assigner",
Args: cobra.MinimumNArgs(0),
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
var err error
Expand Down
2 changes: 1 addition & 1 deletion cmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

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

Expand Down
2 changes: 1 addition & 1 deletion cmd/createdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

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

Expand Down
2 changes: 1 addition & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

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

Expand Down
2 changes: 1 addition & 1 deletion cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"sync"

"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/0chain/zboxcli/util"

"github.com/0chain/gosdk/zboxcore/sdk"
Expand Down
2 changes: 1 addition & 1 deletion cmd/download_m3u8.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync"
"time"

"github.com/0chain/gosdk/zboxcore/logger"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/zboxcore/logger"
)

// M3u8Downloader download files from blobber's dir, and build them into a local m3u8 playlist
Expand Down
10 changes: 5 additions & 5 deletions cmd/fileRefs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strconv"
"time"

"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand All @@ -25,10 +25,10 @@ func checkError(err error) {
}

var fileRefsCmd = &cobra.Command{
Use: "recent-refs",
Short: "get list of recently added refs",
Long: `get list of recently added refs`,
Args: cobra.MinimumNArgs(0),
Use: "recent-refs",
Short: "get list of recently added refs",
Long: `get list of recently added refs`,
Args: cobra.MinimumNArgs(0),
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
page, err := cmd.Flags().GetUint("page")
Expand Down
2 changes: 1 addition & 1 deletion cmd/filemeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"strconv"

"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/get_download_cost.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"log"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/get_upload_cost.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"time"

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

Expand Down
8 changes: 4 additions & 4 deletions cmd/getallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"log"
"os"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/blockchain"
"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/logger"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/zboxcore/blockchain"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/0chain/gosdk_common/zboxcore/logger"
"github.com/0chain/zboxcli/util"

"github.com/spf13/cobra"
Expand Down
8 changes: 4 additions & 4 deletions cmd/getmpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
)

var getMptKeyCommand = &cobra.Command{
Use: "get-mpt",
Short: "Directly view blockchain data",
Long: `Directly view blockchain data from MPT key`,
Args: cobra.MinimumNArgs(0),
Use: "get-mpt",
Short: "Directly view blockchain data",
Long: `Directly view blockchain data from MPT key`,
Args: cobra.MinimumNArgs(0),
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
if cmd.Flags().Changed("key") == false {
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/listallocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"time"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/zboxcli/util"

"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

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

Expand Down
14 changes: 12 additions & 2 deletions cmd/newallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/spf13/pflag"

"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"github.com/0chain/gosdk_common/zcncore"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -245,6 +245,14 @@ var newallocationCmd = &cobra.Command{
}
}

var authRoundExpiry int64
if flags.Changed("auth_round_expiry") {
authRoundExpiry, err = flags.GetInt64("auth_round_expiry")
if err != nil {
log.Fatal("invalid forbid_upload: ", err)
}
}

var allocationID string
if len(owner) == 0 {
options := sdk.CreateAllocationOptions{
Expand All @@ -267,6 +275,7 @@ var newallocationCmd = &cobra.Command{
Force: force,
IsEnterprise: isEnterprise,
StorageVersion: int(storageVersion),
AuthRoundExpiry: authRoundExpiry,
}
allocationID, _, _, err = sdk.CreateAllocationWith(options)
if err != nil {
Expand All @@ -284,7 +293,7 @@ var newallocationCmd = &cobra.Command{
}

allocationID, _, _, err = sdk.CreateAllocationForOwner(owner, ownerPublicKey, *datashards, *parityshards,
*size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams)
*size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams, authRoundExpiry)
if err != nil {
log.Fatal("Error creating allocation: ", err)
}
Expand Down Expand Up @@ -366,6 +375,7 @@ func init() {
newallocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation")

newallocationCmd.Flags().Int64("storage_version", 0, "storaage version of allocation")
newallocationCmd.Flags().Int64("auth_round_expiry", 0, "storaage version of allocation")
}

func storeAllocation(allocationID string) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/0chain/gosdk/constants"
"github.com/0chain/gosdk/core/pathutil"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/constants"
"github.com/0chain/gosdk_common/core/pathutil"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ var repairSize = &cobra.Command{
Long: `gets only size to repair file to blobbers`,
Args: cobra.MinimumNArgs(0),
Run: func(cmd *cobra.Command, args []string) {
fflags := cmd.Flags()
if !fflags.Changed("allocation") {
fflags := cmd.Flags()
if !fflags.Changed("allocation") {
PrintError("Error: allocation flag is missing")
os.Exit(1)
os.Exit(1)
}

repairPath := "/"
Expand Down
8 changes: 4 additions & 4 deletions cmd/rolllback.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
// NOTE: This is for testing purpose only.

var rollbackCmd = &cobra.Command{
Use: "rollback",
Short: "rollback file to previous version",
Long: `rollback file to previous version`,
Args: cobra.MinimumNArgs(0),
Use: "rollback",
Short: "rollback file to previous version",
Long: `rollback file to previous version`,
Args: cobra.MinimumNArgs(0),
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
fflags := cmd.Flags()
Expand Down
10 changes: 5 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import (
"os"
"path/filepath"

"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk/core/logger"
"github.com/0chain/gosdk_common/core/conf"
"github.com/0chain/gosdk_common/core/logger"

"github.com/spf13/cobra"

"github.com/0chain/gosdk/core/client"
"github.com/0chain/gosdk_common/core/client"
"github.com/0chain/zboxcli/util"

"github.com/0chain/gosdk/core/zcncrypto"
"github.com/0chain/gosdk_common/core/zcncrypto"

"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"github.com/0chain/gosdk_common/zcncore"
)

var cfgFile string
Expand Down
6 changes: 3 additions & 3 deletions cmd/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"os"
"time"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/core/pathutil"
"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/core/pathutil"
"github.com/0chain/gosdk_common/zboxcore/fileref"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/stakepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
"github.com/0chain/gosdk_common/zcncore"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"log"
"time"

"github.com/0chain/gosdk/core/transaction"
"github.com/0chain/gosdk_common/core/transaction"

"github.com/0chain/gosdk/zboxcore/blockchain"
"github.com/0chain/gosdk_common/zboxcore/blockchain"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/zboxcli/util"

"github.com/spf13/cobra"
Expand Down
8 changes: 4 additions & 4 deletions cmd/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

// streamCmd represents upload command with --live flag
var streamCmd = &cobra.Command{
Use: "stream",
Short: "capture video and audio streaming form local devices, and upload",
Long: "capture video and audio streaming form local devices, and upload",
Args: cobra.MinimumNArgs(0),
Use: "stream",
Short: "capture video and audio streaming form local devices, and upload",
Long: "capture video and audio streaming form local devices, and upload",
Args: cobra.MinimumNArgs(0),
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {
fflags := cmd.Flags() // fflags is a *flag.FlagSet
Expand Down
6 changes: 3 additions & 3 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"sync"

"github.com/0chain/errors"
"github.com/0chain/gosdk/constants"
"github.com/0chain/gosdk/zboxcore/logger"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zboxcore/zboxutil"
"github.com/0chain/gosdk_common/constants"
"github.com/0chain/gosdk_common/zboxcore/logger"
"github.com/0chain/gosdk_common/zboxcore/zboxutil"
"github.com/0chain/zboxcli/util"
"github.com/spf13/cobra"
)
Expand Down
Loading
Loading