Hi!
I have 2 questions:
-
What is the difference between Storj V3 and Storj RC 1.0 ?
-
I am currently trying to list the Storj RC 1.0 buckets using golang, but I am unable to do so.
My code is:
package main
import (
// "bytes"
"context"
"fmt"
// "io"
// "io/ioutil"
"log"
"storj.io/uplink"
)
const (
myAPIKey = "............."
satellite = "(Some URL)"
myBucket = "....."
myUploadKey = "......."
myData = "one fish two fish red fish blue fish"
myPassphrase = "......."
)
// UploadAndDownloadData uploads the specified data to the specified key in the
// specified bucket, using the specified Satellite, API key, and passphrase.
func UploadAndDownloadData(ctx context.Context,
satelliteAddress, apiKey, passphrase, bucketName, uploadKey string,
dataToUpload []byte) error {
// Request access grant to the satellite with the API key and passphrase.
access, err := uplink.RequestAccessWithPassphrase(ctx, satelliteAddress, apiKey, passphrase)
if err != nil {
return fmt.Errorf("could not request access grant: %v", err)
}
// Open up the Project we will be working with.
project, err := uplink.OpenProject(ctx, access)
if err != nil {
return fmt.Errorf("could not open project: %v", err)
}
defer project.Close()
//////////////////////////////////////////////////////////
list := project.ListBuckets(ctx, nil)
fmt.Println(list.Item())
//////////////////////////////////////////////////////////
return nil
}
func main() {
err := UploadAndDownloadData(context.Background(),
satellite, myAPIKey, myPassphrase, myBucket, myUploadKey, []byte(myData))
if err != nil {
log.Fatalln("error:", err)
}
fmt.Println("success!")
}
I am getting the output:
<nil>
Please help
Thanks