diff --git a/.github/workflows/gosdk.yml b/.github/workflows/gosdk.yml index cc6710a..d730d51 100644 --- a/.github/workflows/gosdk.yml +++ b/.github/workflows/gosdk.yml @@ -46,7 +46,7 @@ jobs: title: Upgrade 0Chain GoSDK to ${{ github.event.inputs.gosdk }} body: | 0Chain GoSDK `${{ github.event.inputs.gosdk }}` is released. - see full changelog on https://github.com/0chain/gosdk/releases/tag/${{ github.event.inputs.gosdk }} + see full changelog on https://github.com/0chain/gosdk_common/releases/tag/${{ github.event.inputs.gosdk }} draft: false reviewers: guruhubb labels: GoSDK diff --git a/cmd/auth-register.go b/cmd/auth-register.go index 64ae42d..77fbab8 100644 --- a/cmd/auth-register.go +++ b/cmd/auth-register.go @@ -1,12 +1,13 @@ package cmd import ( - "github.com/0chain/gosdk/core/transaction" - "github.com/0chain/gosdk/zcnbridge" - "github.com/0chain/gosdk/zcncore" - "github.com/pkg/errors" "log" "strings" + + "github.com/0chain/gosdk_common/core/transaction" + "github.com/0chain/gosdk_common/zcnbridge" + "github.com/0chain/gosdk_common/zcncore" + "github.com/pkg/errors" ) //goland:noinspection ALL diff --git a/cmd/auth-sc-delete.go b/cmd/auth-sc-delete.go index 771a274..a7d26b2 100644 --- a/cmd/auth-sc-delete.go +++ b/cmd/auth-sc-delete.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" comm "github.com/ethereum/go-ethereum/common" ) diff --git a/cmd/auth-sc-register.go b/cmd/auth-sc-register.go index f3190c8..91f18ca 100644 --- a/cmd/auth-sc-register.go +++ b/cmd/auth-sc-register.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" comm "github.com/ethereum/go-ethereum/common" ) diff --git a/cmd/bridge-auth-config-update.go b/cmd/bridge-auth-config-update.go index 32498c3..b477439 100644 --- a/cmd/bridge-auth-config-update.go +++ b/cmd/bridge-auth-config-update.go @@ -2,11 +2,12 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" "strconv" + + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var updateAuthorizerConfigCmd = &cobra.Command{ diff --git a/cmd/bridge-auth-config.go b/cmd/bridge-auth-config.go index 10c5bb4..39143f8 100644 --- a/cmd/bridge-auth-config.go +++ b/cmd/bridge-auth-config.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" "github.com/0chain/zwalletcli/util" "github.com/spf13/cobra" ) diff --git a/cmd/bridge-auth-delete.go b/cmd/bridge-auth-delete.go index 9de78ba..94b744f 100644 --- a/cmd/bridge-auth-delete.go +++ b/cmd/bridge-auth-delete.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var deleteAuthorizerConfigCmd = &cobra.Command{ diff --git a/cmd/bridge-burn-eth.go b/cmd/bridge-burn-eth.go index b42afb0..3e7a19f 100644 --- a/cmd/bridge-burn-eth.go +++ b/cmd/bridge-burn-eth.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-burn-usdc.go b/cmd/bridge-burn-usdc.go index 4d8aa8d..4e8d118 100644 --- a/cmd/bridge-burn-usdc.go +++ b/cmd/bridge-burn-usdc.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-burn-wzcn.go b/cmd/bridge-burn-wzcn.go index a282515..0024037 100644 --- a/cmd/bridge-burn-wzcn.go +++ b/cmd/bridge-burn-wzcn.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-burn-zcn.go b/cmd/bridge-burn-zcn.go index c2ce47a..08069fa 100644 --- a/cmd/bridge-burn-zcn.go +++ b/cmd/bridge-burn-zcn.go @@ -3,9 +3,9 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-config-update.go b/cmd/bridge-config-update.go index c5aee21..fd4f9f4 100644 --- a/cmd/bridge-config-update.go +++ b/cmd/bridge-config-update.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var updateBridgeGlobalConfigCmd = &cobra.Command{ diff --git a/cmd/bridge-config.go b/cmd/bridge-config.go index 7563cb1..60000a8 100644 --- a/cmd/bridge-config.go +++ b/cmd/bridge-config.go @@ -4,8 +4,8 @@ import ( "encoding/json" "log" - "github.com/0chain/gosdk/zcnbridge" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcnbridge" + "github.com/0chain/gosdk_common/zcncore" "github.com/spf13/cobra" ) diff --git a/cmd/bridge-get-wzcn-burnticket.go b/cmd/bridge-get-wzcn-burnticket.go index 9ffbde7..fd0176b 100644 --- a/cmd/bridge-get-wzcn-burnticket.go +++ b/cmd/bridge-get-wzcn-burnticket.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-get-zcn-burnticket.go b/cmd/bridge-get-zcn-burnticket.go index f40f788..f53dbf7 100644 --- a/cmd/bridge-get-zcn-burnticket.go +++ b/cmd/bridge-get-zcn-burnticket.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge-import-account.go b/cmd/bridge-import-account.go index c2219f6..dec804b 100644 --- a/cmd/bridge-import-account.go +++ b/cmd/bridge-import-account.go @@ -1,7 +1,7 @@ package cmd import ( - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" "github.com/spf13/cobra" ) diff --git a/cmd/bridge-list-accounts.go b/cmd/bridge-list-accounts.go index 6970436..9f5bc4c 100644 --- a/cmd/bridge-list-accounts.go +++ b/cmd/bridge-list-accounts.go @@ -2,7 +2,8 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcnbridge" + + "github.com/0chain/gosdk_common/zcnbridge" "github.com/spf13/cobra" ) diff --git a/cmd/bridge-list-authorizers.go b/cmd/bridge-list-authorizers.go index ef59154..d8f1883 100644 --- a/cmd/bridge-list-authorizers.go +++ b/cmd/bridge-list-authorizers.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" "github.com/0chain/zwalletcli/util" "github.com/spf13/cobra" ) diff --git a/cmd/bridge-mint-wzcn.go b/cmd/bridge-mint-wzcn.go index b2611e3..9985fcc 100644 --- a/cmd/bridge-mint-wzcn.go +++ b/cmd/bridge-mint-wzcn.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/zcnbridge" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcnbridge" + "github.com/0chain/gosdk_common/zcncore" ) func init() { diff --git a/cmd/bridge-mint-zcn.go b/cmd/bridge-mint-zcn.go index 46c7e58..ddcd737 100644 --- a/cmd/bridge-mint-zcn.go +++ b/cmd/bridge-mint-zcn.go @@ -3,9 +3,10 @@ package cmd import ( "encoding/json" "fmt" - "github.com/0chain/gosdk/zcnbridge" - "github.com/0chain/gosdk/zcncore" "strconv" + + "github.com/0chain/gosdk_common/zcnbridge" + "github.com/0chain/gosdk_common/zcncore" ) func init() { diff --git a/cmd/bridge-verify.go b/cmd/bridge-verify.go index d18c234..30430e8 100644 --- a/cmd/bridge-verify.go +++ b/cmd/bridge-verify.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) func init() { diff --git a/cmd/bridge.go b/cmd/bridge.go index 2150d3e..c0891a1 100644 --- a/cmd/bridge.go +++ b/cmd/bridge.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" - "github.com/0chain/gosdk/core/conf" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/core/conf" + "github.com/0chain/gosdk_common/zcnbridge" "github.com/spf13/cobra" ) @@ -274,7 +274,7 @@ func getUint64(args []*Arg, name string) uint64 { } // createCommand Function to initialize bridge commands with DRY principle -func createCommand(use, short, long string, functor Command, hidden bool, opts ...*Option,) *cobra.Command { +func createCommand(use, short, long string, functor Command, hidden bool, opts ...*Option) *cobra.Command { fn := func(parameters ...*Arg) { functor(parameters...) } @@ -332,10 +332,10 @@ func createBridgeComm( hidden bool, ) *cobra.Command { var cobraCommand = &cobra.Command{ - Use: use, - Short: short, - Long: long, - Args: cobra.MinimumNArgs(0), + Use: use, + Short: short, + Long: long, + Args: cobra.MinimumNArgs(0), Hidden: hidden, Run: func(cmd *cobra.Command, args []string) { fflags := cmd.Flags() diff --git a/cmd/callback.go b/cmd/callback.go index 869bf33..6d4d8f2 100644 --- a/cmd/callback.go +++ b/cmd/callback.go @@ -6,7 +6,7 @@ import ( "fmt" "sync" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" ) // diff --git a/cmd/collect_reward.go b/cmd/collect_reward.go index 7c5d232..b20db82 100644 --- a/cmd/collect_reward.go +++ b/cmd/collect_reward.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var minerScPayReward = &cobra.Command{ diff --git a/cmd/create-wallet.go b/cmd/create-wallet.go index f0ab3d2..bf6156f 100644 --- a/cmd/create-wallet.go +++ b/cmd/create-wallet.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" "github.com/spf13/cobra" ) diff --git a/cmd/faucet.go b/cmd/faucet.go index a414ec8..5971761 100644 --- a/cmd/faucet.go +++ b/cmd/faucet.go @@ -2,7 +2,8 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" + + "github.com/0chain/gosdk_common/zcncore" "github.com/spf13/cobra" ) diff --git a/cmd/fc-config.go b/cmd/fc-config.go index c8c453b..397456d 100644 --- a/cmd/fc-config.go +++ b/cmd/fc-config.go @@ -4,7 +4,7 @@ package cmd //import ( // "log" // -// "github.com/0chain/gosdk/zcncore" +// "github.com/0chain/gosdk_common/zcncore" // "github.com/spf13/cobra" //) // diff --git a/cmd/fc-update-config.go b/cmd/fc-update-config.go index f4f98e2..6decf9d 100644 --- a/cmd/fc-update-config.go +++ b/cmd/fc-update-config.go @@ -8,7 +8,7 @@ package cmd // "strings" // "sync" // -// "github.com/0chain/gosdk/zcncore" +// "github.com/0chain/gosdk_common/zcncore" // "github.com/spf13/cobra" //) // diff --git a/cmd/getbalance.go b/cmd/getbalance.go index 9d6042d..57a2cb4 100644 --- a/cmd/getbalance.go +++ b/cmd/getbalance.go @@ -2,8 +2,9 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/zcncore" + + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zcncore" "github.com/0chain/zwalletcli/util" "github.com/spf13/cobra" ) diff --git a/cmd/getnonce.go b/cmd/getnonce.go index 875cc2e..9a12694 100644 --- a/cmd/getnonce.go +++ b/cmd/getnonce.go @@ -2,7 +2,8 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/core/client" + + "github.com/0chain/gosdk_common/core/client" "github.com/spf13/cobra" ) diff --git a/cmd/global-config.go b/cmd/global-config.go index 0f64307..3ac9a43 100644 --- a/cmd/global-config.go +++ b/cmd/global-config.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/0chain/gosdk/core/transaction" "log" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/spf13/cobra" ) diff --git a/cmd/global-update-config.go b/cmd/global-update-config.go index bc54abf..9a9920b 100644 --- a/cmd/global-update-config.go +++ b/cmd/global-update-config.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var updateGlobalConfigCmd = &cobra.Command{ diff --git a/cmd/hardfork.go b/cmd/hardfork.go index 14991b1..d83035a 100644 --- a/cmd/hardfork.go +++ b/cmd/hardfork.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var addHardForkCmd = &cobra.Command{ diff --git a/cmd/minersc.go b/cmd/minersc.go index 1925ee4..1ed88a3 100644 --- a/cmd/minersc.go +++ b/cmd/minersc.go @@ -3,13 +3,14 @@ package cmd import ( "encoding/json" "fmt" - "github.com/0chain/gosdk/core/common" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" - "github.com/0chain/zwalletcli/util" - "github.com/spf13/cobra" "log" "strings" + + "github.com/0chain/gosdk_common/core/common" + "github.com/0chain/gosdk_common/zboxcore/commonsdk" + "github.com/0chain/gosdk_common/zcncore" + "github.com/0chain/zwalletcli/util" + "github.com/spf13/cobra" ) var minerscInfo = &cobra.Command{ @@ -392,7 +393,7 @@ var spLock = &cobra.Command{ var ( flags = cmd.Flags() providerID string - providerType sdk.ProviderType + providerType commonsdk.ProviderType tokens float64 fee float64 err error @@ -402,13 +403,13 @@ var spLock = &cobra.Command{ if providerID, err = flags.GetString("blobber_id"); err != nil { log.Fatalf("invalid 'blobber_id' flag: %v", err) } else { - providerType = sdk.ProviderBlobber + providerType = commonsdk.ProviderBlobber } } else if flags.Changed("validator_id") { if providerID, err = flags.GetString("validator_id"); err != nil { log.Fatalf("invalid 'validator_id' flag: %v", err) } else { - providerType = sdk.ProviderValidator + providerType = commonsdk.ProviderValidator } } @@ -435,7 +436,7 @@ var spLock = &cobra.Command{ } var hash string - hash, _, err = sdk.StakePoolLock(providerType, providerID, + hash, _, err = commonsdk.StakePoolLock(providerType, providerID, zcncore.ConvertToValue(tokens), zcncore.ConvertToValue(fee)) if err != nil { log.Fatalf("Failed to lock tokens in stake pool: %v", err) diff --git a/cmd/misc.go b/cmd/misc.go index 9b185bb..f01bb4a 100644 --- a/cmd/misc.go +++ b/cmd/misc.go @@ -2,12 +2,13 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" - "github.com/0chain/zwalletcli/util" - "github.com/spf13/cobra" "log" "os" + + "github.com/0chain/gosdk_common/zboxcore/commonsdk" + "github.com/0chain/gosdk_common/zcncore" + "github.com/0chain/zwalletcli/util" + "github.com/spf13/cobra" ) var getidcmd = &cobra.Command{ @@ -43,7 +44,7 @@ func byteCountIEC(b int64) string { return fmt.Sprintf("%.1f %ciB", float64(b)/float64(div), "KMGTPE"[exp]) } -func printBlobberList(nodes []*sdk.Blobber) { +func printBlobberList(nodes []*commonsdk.Blobber) { fmt.Println("Blobbers:") header := []string{ "URL", "ID", "CAP", "R / W PRICE", "DEMAND", @@ -74,7 +75,7 @@ var getblobberscmd = &cobra.Command{ if err != nil { log.Fatal(err) } - blobberList, err := sdk.GetBlobbers(!active, false) + blobberList, err := commonsdk.GetBlobbers(!active, false) printBlobberList(blobberList) }, } diff --git a/cmd/mn-config.go b/cmd/mn-config.go index aca3706..ac93b33 100644 --- a/cmd/mn-config.go +++ b/cmd/mn-config.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/0chain/gosdk/core/transaction" "log" + "github.com/0chain/gosdk_common/core/transaction" + "github.com/spf13/cobra" ) diff --git a/cmd/mn-delete.go b/cmd/mn-delete.go index 69dd02b..bc3776d 100644 --- a/cmd/mn-delete.go +++ b/cmd/mn-delete.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var minerDelete = &cobra.Command{ diff --git a/cmd/mn-kill.go b/cmd/mn-kill.go index d2e59df..e3c8115 100644 --- a/cmd/mn-kill.go +++ b/cmd/mn-kill.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var minerKill = &cobra.Command{ diff --git a/cmd/mn-update-config.go b/cmd/mn-update-config.go index 9867f1b..82cb938 100644 --- a/cmd/mn-update-config.go +++ b/cmd/mn-update-config.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var updateMinerScConfigCmd = &cobra.Command{ diff --git a/cmd/recoverwallet.go b/cmd/recoverwallet.go index 0252030..9d9d742 100644 --- a/cmd/recoverwallet.go +++ b/cmd/recoverwallet.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/zcncore" "github.com/spf13/cobra" ) diff --git a/cmd/reset-user-nonce.go b/cmd/reset-user-nonce.go index 67a9b62..b33e007 100644 --- a/cmd/reset-user-nonce.go +++ b/cmd/reset-user-nonce.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/0chain/gosdk/zcnbridge" + "github.com/0chain/gosdk_common/zcnbridge" ) //goland:noinspection ALL diff --git a/cmd/root.go b/cmd/root.go index 1a64a65..78d466c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -9,12 +9,12 @@ import ( "path/filepath" "sync" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/core/conf" + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/core/conf" + "github.com/0chain/gosdk_common/zboxcore/commonsdk" - "github.com/0chain/gosdk/core/zcncrypto" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" + "github.com/0chain/gosdk_common/core/zcncrypto" + "github.com/0chain/gosdk_common/zcncore" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -93,7 +93,7 @@ func initZCNCore() { // set the log file zcncore.SetLogFile("cmdlog.log", !bSilent) //bridge.SetLogFile("bridge.log", !bSilent) - sdk.SetLogFile("cmdlog.log", !bSilent) + commonsdk.SetLogFile("cmdlog.log", !bSilent) blockWorker := cfgConfig.GetString("block_worker") chainID := cfgConfig.GetString("chain_id") diff --git a/cmd/sc-config.go b/cmd/sc-config.go index aa41d0a..14eb557 100644 --- a/cmd/sc-config.go +++ b/cmd/sc-config.go @@ -1,9 +1,10 @@ package cmd import ( - "github.com/0chain/gosdk/core/transaction" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/core/transaction" + "github.com/spf13/cobra" ) // scConfig shows SC configurations diff --git a/cmd/sc-update-config.go b/cmd/sc-update-config.go index d535fa7..8780cfb 100644 --- a/cmd/sc-update-config.go +++ b/cmd/sc-update-config.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var updateStoragScConfigCmd = &cobra.Command{ diff --git a/cmd/send.go b/cmd/send.go index d8e65c2..8dcdd13 100644 --- a/cmd/send.go +++ b/cmd/send.go @@ -2,11 +2,12 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/core/client" - "github.com/0chain/gosdk/zcncore" + "strconv" + + "github.com/0chain/gosdk_common/core/client" + "github.com/0chain/gosdk_common/zcncore" "github.com/0chain/zwalletcli/util" "github.com/spf13/cobra" - "strconv" ) func checkBalanceBeforeSend(tokens, fee uint64) { diff --git a/cmd/sh-delete.go b/cmd/sh-delete.go index eacef92..c9f420a 100644 --- a/cmd/sh-delete.go +++ b/cmd/sh-delete.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var sharderDelete = &cobra.Command{ diff --git a/cmd/sh-kill.go b/cmd/sh-kill.go index 5cd78e3..6364b60 100644 --- a/cmd/sh-kill.go +++ b/cmd/sh-kill.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var sharderKill = &cobra.Command{ diff --git a/cmd/updatenode.go b/cmd/updatenode.go index 055212c..fd55b35 100644 --- a/cmd/updatenode.go +++ b/cmd/updatenode.go @@ -2,9 +2,10 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var minerscUpdateNodeSettings = &cobra.Command{ diff --git a/cmd/vc-add.go b/cmd/vc-add.go index 7ee7f53..9ea484f 100644 --- a/cmd/vc-add.go +++ b/cmd/vc-add.go @@ -2,10 +2,11 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/zboxcore/sdk" - "github.com/0chain/gosdk/zcncore" - "github.com/spf13/cobra" "log" + + "github.com/0chain/gosdk_common/zboxcore/commonsdk" + "github.com/0chain/gosdk_common/zcncore" + "github.com/spf13/cobra" ) var providerRegister = &cobra.Command{ @@ -37,12 +38,12 @@ var providerRegister = &cobra.Command{ log.Fatal(err) } - var pt sdk.ProviderType + var pt commonsdk.ProviderType switch nodeType { case "miner": - pt = sdk.ProviderMiner + pt = commonsdk.ProviderMiner case "sharder": - pt = sdk.ProviderSharder + pt = commonsdk.ProviderSharder default: log.Fatalf("unknown provider type: %v", nodeType) } diff --git a/cmd/verify.go b/cmd/verify.go index 9e048b6..debece8 100644 --- a/cmd/verify.go +++ b/cmd/verify.go @@ -2,7 +2,8 @@ package cmd import ( "fmt" - "github.com/0chain/gosdk/core/transaction" + + "github.com/0chain/gosdk_common/core/transaction" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 48ef9a5..c9ea32f 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/0chain/zwalletcli -go 1.22.0 +go 1.22.5 -toolchain go1.22.5 +toolchain go1.23.1 require ( - github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5 + github.com/0chain/gosdk_common v0.0.0-20250318134004-c9cbffc71102 github.com/ethereum/go-ethereum v1.13.2 github.com/icza/bitio v1.1.0 github.com/olekukonko/tablewriter v0.0.5 @@ -40,7 +40,6 @@ require ( github.com/go-stack/stack v1.8.1 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/h2non/filetype v1.1.4-0.20231228185113-6469358c2bcb // indirect github.com/hack-pad/go-webworkers v0.1.0 // indirect @@ -56,14 +55,12 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.0 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/klauspost/reedsolomon v1.11.8 // indirect github.com/lithammer/shortuuid/v3 v3.0.7 // indirect github.com/machinebox/graphql v0.2.2 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/minio/sha256-simd v1.0.1 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect @@ -71,7 +68,6 @@ require ( github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/common v0.39.0 // indirect github.com/prometheus/procfs v0.11.0 // indirect - github.com/remeh/sizedwaitgroup v1.0.0 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -111,4 +107,5 @@ require ( ) // temporary, for development -//replace github.com/0chain/gosdk => ../gosdk +// replace github.com/0chain/gosdk => ../gosdk +// replace github.com/0chain/gosdk => github.com/0chain/egosdk v1.19.1-0.20250318121802-ba628432aced diff --git a/go.sum b/go.sum index 70c68fb..0ce1045 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v1.18.3 h1:42dYOv2KyMTSanuS67iDtfv+ErbSRqR8NJ3MG72MwaI= github.com/0chain/common v1.18.3/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5 h1:A8Ig1uLfMIaGtP4/m2X7/KZC9+thbsOJNBaMY/ZsycY= -github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5/go.mod h1:8unFy9Dx2YyPKMYPDGR3MFhUEymbAfQcRDm9bobVLGw= +github.com/0chain/gosdk_common v0.0.0-20250318134004-c9cbffc71102 h1:CKVvICaxGCK25rbOFLtjtO9GZKSpsiorXwudlVkH03Y= +github.com/0chain/gosdk_common v0.0.0-20250318134004-c9cbffc71102/go.mod h1:+FBmkG4JocGmD+8gyE4kyst15p+3xm3Nf+nrg4cu5V4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -237,8 +237,6 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/h2non/filetype v1.1.4-0.20231228185113-6469358c2bcb h1:GlQyMv2C48qmfPItvAXFoyN341Swxp9JNVeUZxnmbJw= @@ -298,8 +296,6 @@ github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJw github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/klauspost/reedsolomon v1.11.8 h1:s8RpUW5TK4hjr+djiOpbZJB4ksx+TdYbRH7vHQpwPOY= -github.com/klauspost/reedsolomon v1.11.8/go.mod h1:4bXRN+cVzMdml6ti7qLouuYi32KHJ5MGv0Qd8a47h6A= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -331,8 +327,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= @@ -371,8 +365,6 @@ github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8u github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/remeh/sizedwaitgroup v1.0.0 h1:VNGGFwNo/R5+MJBf6yrsr110p0m4/OX4S3DCy7Kyl5E= -github.com/remeh/sizedwaitgroup v1.0.0/go.mod h1:3j2R4OIe/SeS6YDhICBy22RWjJC5eNCJ1V+9+NVNYlo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=