Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from NebulousLabs/remove-admin-api
Browse files Browse the repository at this point in the history
Remove administrative API
  • Loading branch information
MSevey authored Aug 31, 2020
2 parents 425aeb8 + 83571d5 commit 62bdb59
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 254 deletions.
4 changes: 2 additions & 2 deletions cmd/skynet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ func main() {
rootCmd.AddCommand(versionCmd)

// Add Skynet Commands
rootCmd.AddCommand(skynetBlacklistCmd, skynetConvertCmd, skynetDownloadCmd, skynetLsCmd, skynetPinCmd, skynetSkykeyCmd, skynetUnpinCmd, skynetUploadCmd)
rootCmd.AddCommand(skynetDownloadCmd, skynetSkykeyCmd, skynetUploadCmd)
skynetSkykeyCmd.AddCommand(skynetSkykeyAddCmd, skynetSkykeyCreateCmd, skynetSkykeyGetCmd, skynetSkykeyGetSkykeysCmd)
skynetSkykeyGetCmd.AddCommand(skynetSkykeyGetIDCmd, skynetSkykeyGetNameCmd)

// Add flags.
rootCmd.Flags().BoolVarP(&generateDocs, "generate-docs", "d", false, "Generate the docs for skynet")
rootCmd.Flags().BoolVarP(&generateDocs, "generate-docs", "d", false, "Generate the docs for Skynet")
rootCmd.PersistentFlags().StringVar(&skynetPortal, "portal", "", "Use a Skynet portal other than the default")
rootCmd.PersistentFlags().StringVar(&endpointPath, "endpoint-path", "", "Relative URL path of the endpoint to use")
rootCmd.PersistentFlags().StringVar(&apiKey, "api-key", "", "API password to use for authentication")
Expand Down
95 changes: 0 additions & 95 deletions cmd/skynet/skynetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,6 @@ import (
)

var (
skynetBlacklistCmd = &cobra.Command{
Use: "blacklist [skylink]",
Short: "Needs SDK Implementation",
Long: "Needs SDK Implementation",

/*
Short: "Blacklist a skylink from skynet.",
Long: `Blacklist a skylink from skynet. Use the --remove flag to
remove a skylink from the blacklist.`,
*/
Run: skynetblacklistcmd,
}

skynetConvertCmd = &cobra.Command{
Use: "convert [source siaPath] [destination siaPath]",
Short: "Needs SDK Implementation",
Long: "Needs SDK Implementation",
/*
Short: "Convert a siafile to a skyfile with a skylink.",
Long: `Convert a siafile to a skyfile and then generate its skylink. A new skylink
will be created in the user's skyfile directory. The skyfile and the original
siafile are both necessary to pin the file and keep the skylink active. The
skyfile will consume an additional 40 MiB of storage.`,
*/
Run: wrap(skynetconvertcmd),
}

skynetDownloadCmd = &cobra.Command{
Use: "download [skylink] [destination]",
Short: "Download a skylink from skynet.",
Expand All @@ -45,32 +18,6 @@ fetch a skylink file from a chosen skynet portal.`,
Run: skynetdownloadcmd,
}

skynetLsCmd = &cobra.Command{
Use: "ls",
Short: "Needs SDK Implementation",
Long: "Needs SDK Implementation",
/*
Short: "List all skyfiles that the user has pinned.",
Long: `List all skyfiles that the user has pinned along with the corresponding
skylinks. By default, only files in var/skynet/ will be displayed. The --root
flag can be used to view skyfiles pinned in other folders.`,
*/
Run: skynetlscmd,
}

skynetPinCmd = &cobra.Command{
Use: "pin [skylink] [destination siapath]",
Short: "Needs SDK Implementation",
Long: "Needs SDK Implementation",
/*
Short: "Pin a skylink from skynet by re-uploading it yourself.",
Long: `Pin the file associated with this skylink by re-uploading an exact copy. This
ensures that the file will still be available on skynet as long as you continue
maintaining the file in your renter.`,
*/
Run: wrap(skynetpincmd),
}

skynetSkykeyCmd = &cobra.Command{
Use: "skykey",
Short: "Perform skykey operations.",
Expand Down Expand Up @@ -118,18 +65,6 @@ fetch a skylink file from a chosen skynet portal.`,
Run: wrap(skynetgetskykeyscmd),
}

skynetUnpinCmd = &cobra.Command{
Use: "unpin [siapath]",
Short: "Needs SDK Implementation",
Long: "Needs SDK Implementation",
/*
Short: "Unpin pinned skyfiles or directories.",
Long: `Unpin one or more pinned skyfiles or directories at the given siapaths. The
files and directories will continue to be available on Skynet if other nodes have pinned them.`,
*/
Run: skynetunpincmd,
}

skynetUploadCmd = &cobra.Command{
Use: "upload [source path]",
Short: "Upload a file or a directory to Skynet.",
Expand Down Expand Up @@ -226,18 +161,6 @@ func skynetgetskykeyscmd() {
fmt.Println("Successfully got skykeys! Skykeys:", skykeys)
}

// skynetblacklistcmd handles adding and removing a skylink from the Skynet
// Blacklist
func skynetblacklistcmd(cmd *cobra.Command, args []string) {
fmt.Println("Skynet Blacklist not support in SDK")
}

// skynetconvertcmd will convert an existing siafile to a skyfile and skylink on
// the Sia network.
func skynetconvertcmd(sourceSiaPathStr, destSiaPathStr string) {
fmt.Println("Skynet convert not support in SDK")
}

// skynetdownloadcmd will perform the download of a skylink.
func skynetdownloadcmd(cmd *cobra.Command, args []string) {
if len(args) != 2 {
Expand Down Expand Up @@ -268,24 +191,6 @@ func skynetdownloadcmd(cmd *cobra.Command, args []string) {
fmt.Println("Successfully downloaded skylink!")
}

// skynetlscmd is the handler for the command `siac skynet ls`. Works very
// similarly to 'siac renter ls' but defaults to the SkynetFolder and only
// displays files that are pinning skylinks.
func skynetlscmd(cmd *cobra.Command, args []string) {
fmt.Println("Skynet ls not implemented in SDK")
}

// skynetpincmd will pin the file from this skylink.
func skynetpincmd(sourceSkylink, destSiaPath string) {
fmt.Println("Skynet pin not implemented in SDK")
}

// skynetunpincmd will unpin and delete either a single or multiple files or
// directories from the Renter.
func skynetunpincmd(cmd *cobra.Command, skyPathStrs []string) {
fmt.Println("Skynet pin not implemented in SDK")
}

// skynetuploadcmd will upload a file or directory to Skynet. If --dry-run is
// passed, it will fetch the skylinks without uploading.
func skynetuploadcmd(sourcePath string) {
Expand Down
12 changes: 5 additions & 7 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Perform actions related to Skynet

### Synopsis

skynet 1.1.0

Perform actions related to Skynet, a file sharing and data publication platform
on top of Sia.
built on top of Sia.

```
skynet [flags]
Expand All @@ -24,13 +26,9 @@ skynet [flags]

### SEE ALSO

* [skynet blacklist](skynet_blacklist.md) - Needs SDK Implementation
* [skynet convert](skynet_convert.md) - Needs SDK Implementation
* [skynet download](skynet_download.md) - Download a skylink from skynet.
* [skynet ls](skynet_ls.md) - Needs SDK Implementation
* [skynet pin](skynet_pin.md) - Needs SDK Implementation
* [skynet skykey](skynet_skykey.md) - Perform skykey operations.
* [skynet unpin](skynet_unpin.md) - Needs SDK Implementation
* [skynet upload](skynet_upload.md) - Upload a file or a directory to Skynet.
* [skynet version](skynet_version.md) - Print the version number of 'skynet'.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
12 changes: 5 additions & 7 deletions doc/skynet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Perform actions related to Skynet

### Synopsis

skynet 1.1.0

Perform actions related to Skynet, a file sharing and data publication platform
on top of Sia.
built on top of Sia.

```
skynet [flags]
Expand All @@ -24,13 +26,9 @@ skynet [flags]

### SEE ALSO

* [skynet blacklist](skynet_blacklist.md) - Needs SDK Implementation
* [skynet convert](skynet_convert.md) - Needs SDK Implementation
* [skynet download](skynet_download.md) - Download a skylink from skynet.
* [skynet ls](skynet_ls.md) - Needs SDK Implementation
* [skynet pin](skynet_pin.md) - Needs SDK Implementation
* [skynet skykey](skynet_skykey.md) - Perform skykey operations.
* [skynet unpin](skynet_unpin.md) - Needs SDK Implementation
* [skynet upload](skynet_upload.md) - Upload a file or a directory to Skynet.
* [skynet version](skynet_version.md) - Print the version number of 'skynet'.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
32 changes: 0 additions & 32 deletions doc/skynet_convert.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/skynet_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ skynet download [skylink] [destination] [flags]

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
32 changes: 0 additions & 32 deletions doc/skynet_ls.md

This file was deleted.

32 changes: 0 additions & 32 deletions doc/skynet_pin.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/skynet_skykey.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Perform skykey operations.
* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.
* [skynet skykey list](skynet_skykey_list.md) - Get a list of all skykeys on Skynet.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ skynet skykey add [skykey] [flags]

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ skynet skykey create [skykey name] [flags]

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Perform skykey get operations.
* [skynet skykey get id](skynet_skykey_get_id.md) - Get a skykey given its ID.
* [skynet skykey get name](skynet_skykey_get_name.md) - Get a skykey given its name.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_get_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ skynet skykey get id [skykey id] [flags]

* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_get_name.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ skynet skykey get name [skykey name] [flags]

* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
2 changes: 1 addition & 1 deletion doc/skynet_skykey_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ skynet skykey list [flags]

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
32 changes: 0 additions & 32 deletions doc/skynet_unpin.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/skynet_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ skynet upload [source path] [flags]

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 5-Aug-2020
###### Auto generated by spf13/cobra on 28-Aug-2020
Loading

0 comments on commit 62bdb59

Please sign in to comment.