0Chain
Search…
Storing and Sharing Files with Explorer
Once you have some ZCN tokens in your wallet, you can use explorer to store files through 0Stor 0Chain decentralized storage platform.
1. Navigate to 0Stor in the upper left corner of Explorer dashboard.
2. You will see various sections listed: Allocations, Files Transactions, and Shared.

Allocations

Allocations by default is selected and highlighted in blue. The Allocations section will have various subsections listed (List of Allocations, Create new Allocation, Update Allocation, Lock Read Tokens, Lock Write tokens, Read Pool Info, and Write Pool Info). By default the List of Allocations subsection is selected and highlighted in blue.

List of Allocations

In the List of Allocations section, an allocation (a storage space) by default is created for you on the 0Chain dStorage network.
The allocation was created when you clicked on create wallet and allocation during your initial access to explorer. Every allocation has an allocation id and has a size. The default size here for the storage space specified by the 0Chain is about 2147483648 (2GB). Data shards and parity shards are set to 4 and 2 by default which specify download/upload speeds and availability for the allocation.
Also, the Allocation is selected by default (highlighted in green) for storing files since there is no other allocation listed.

Types of Allocations

Using Explorer you can create multiple storage spaces (allocations) of different types to suit your storage needs. A default allocation created by 0Chain is of 2GB in size but if you want an allocation that is larger and has better availability. You can create that by clicking on the create new allocation (+) button under the Allocations section.
After Clicking on Create new Allocation button it will be highlighted in blue and prompts you to specify a simple or advance allocation.

Creating a Simple Allocation

A simple allocation only requires the size of the storage space that has to be allocated and automatically determines the number of tokens that has to be locked for creating that storage space. For example let's create an allocation of size 4GB.
The Total cost and tokens locked came out to be $ 0.002060 and $ 0.0028170933. By clicking on create new allocation button, the new allocation will be created and you will be redirected to transactions sections where you can see the amount of tokens locked for your customized allocation.
As you can see in the above screenshot, a new allocation with an id is created 2 minutes ago with 0.1 locked tokens and 0.5 locked read tokens*. The tokens are deducted from the wallet and total balance has become 0.4 on the upper right. * Locking of read tokens might not be required depending upon the explorer implementation. Now the allocation can be used to store files and is set as a default allocation. To verify the size of the allocation, click on the allocations button on the right.
Here you can verify the specified size of the allocation and select the allocation to use for storage.

Creating an Advance Allocation

An advance allocation can be created by specifying various other parameters other than size.
  • Preferred Blobbers: These are used by users to store files on their own blobbers (storage providers).
  • Data Shards: Increased Data Sharders provides high download/upload speeds for files. (Default is 4).
  • Parity Shards: Increased parity sharders ensures high availability. (Default is 2).
  • Size: Size of the storage space (Default is 2GB).
  • Write Price: Cost of writing data onto the allocation. A range has to be specified depending upon the size of the allocation and other parameters. (Lower write price means less amount of write pools tokens required for locking).
  • Read Price: Cost of reading data stored on the allocation. A range is specified depending upon the size of the allocation and other parameters. (Lower write price means less amount of write pools tokens required for locking).
  • Challenge Completion Time: Lower challenge completion time results into better SLA. (Default is 3600 sec).
For instance, let's create a 2GB Allocation which has 5 Data Shards for fast downloads and 2500 seconds completion time for better SLA.
As you can see, it requires 0.0015 tokens for creating allocation. Click on create new allocation button to create an advance allocation To verify allocation check your allocation info by navigating to 0Stor in the upper left corner of Explorer dashboard.
Here you can see the specified allocation details during the creation of an advance allocation.

Updating an Allocation

To update the configuration of an allocation using Explorer,
1.Navigate to the 0Stor
2.Click on update allocation.
Here Allocation ID for the allocation whose configuration has to be updated is required. Allocation Variables that can be changed for a particular allocation are:
  • Expiry: Allocation Expiry Time
  • Size: Size of the Allocation.
    An allocation id can be fetched by clicking on list of allocations on the left .Here is a sample screenshot:
3.For example lets update the allocation which has 4294967296(4 GB) of size for smaller size (1GB) and decrease its expiry time to a day. Click on the allocation id which has a size of 4GB that is:
4.You will see the following output .Copy the allocation id specified to the Hash variable.
5. Navigate back to Update Allocation by clicking on 0Stor on the upper left area and paste the allocation id to change expiry date and size for a particular allocation.

Uploading a file

Uploading a file to an allocation using Explorer can be done through Files section under 0Stor.
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted)
3.Click on (+)Upload file button on the right.
4.You will be prompted to specify the file that has to be uploaded,path for uploaded file (if u want to store the file in a particular folder)and allocation id for storing files in a particular storage space.
Note:If you don't specify any file path and allocation id the uploaded file will be stored in the home directory of the dStorage and will use the default allocation selected.
5. For example lets upload a sample nature photo file and store it in the new directory natureon dStorage. You can also upload a file to existing directory by specifying its name.
Note: The maximum file size for the upload should be less than 50 MB. For uploads bigger than 50MB use ZboxCLI.
6.The total cost for uploading will be estimated automatically(in usd) To upload a file click on green upload file button. The status bar for uploading will be shown.
7.Once the file is successfully uploaded it will be listed in the files section with your file path/folder specified. We have stored the image file in nature directory so that is listed.
8. To view the uploaded file click on the forward button(see the below screenshot) and you will be forwarded to the files located in the nature directory.
9.In the directory you will see the uploaded files. We have uploaded a nature image file which is listed. To view the file click on the view button.
10.Your file will be opened and shown on the full screen.

Uploading an Encrypted File

Uploading an Encrypted file to an allocation using Explorer is done through the Files section under 0Stor.
1.Click 0stor on the upper left corner .
2.Select Files(it will become highlighted).
3.Click on the (+) Upload file button on the right.
4.You will be prompted to specify the file that has to be uploaded,path for uploaded file (if u want to store the file in a particular folder), and allocation id for storing files in a particular allocation. In case of encrypted file upload you also check the Upload as Encrypted dialog box to encrypt and upload the file .
Note: If you don't specify any file path and allocation id the uploaded file will be stored in the / directory of the dStorage and will use the default allocation selected.
5.For example lets upload an image file and store it in the new directorynatureon dStorage. We will also check the Upload as Encrypted dialog box to encrypt and upload the file.
6.The total cost for uploading will be estimated automatically(in USD) To upload a file click on the green upload file button. The status bar for uploading will be shown.
Note: The maximum filesize for the upload should be less than 50 MB. For uploads bigger than 50MB use ZboxCLI.
7.Once the file is successfully uploaded it will be listed in the files section with your file path/folder specified. We have stored the image file in nature directory so that is listed.
8. To view the uploaded file click on the forward button(see the below screenshot) and you will be forwarded to the files located in the nature directory.
9.Here you will see a lock icon under the encrypted column for your file which confirms that the file is encrypted. (See the below screenshot)

Downloading a file

For downloading a file on dStorage using Explorer
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted))
3.You will see your uploaded files in the directories on dStorage. To know how to upload a file using Explorer check Uploading a file section.
4.For example the nature directory is listed . To view the contents of the directory click on the forward button((see the below screenshot)
5.In the directory you will see the uploaded files.
6.To download a particular file click on the three dots(...)
7.Choose Download from the menu
8.You will see a progress icon and your file will be downloaded shortly into your local computer.

Moving a file

To move a file in another directory on dStorage using Explorer
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted)
3.You will see your uploaded files in the directories on dStorage. For example, the nature directory is listed. .To view the contents of the directory click on the forward button((see the below screenshot)
5.In the directory you will see the uploaded files.
6.Lets move the nature1.jpg from nature directory to / directory on dStorage.To move a particular file click on the three dots(...)
7.Choose Move from the menu
8.It will ask you to specify the folder/directory name to which file has to be moved. If you are moving a file to the home directory /just leave it blank and click on the green move button.
9.The explorer will take some seconds to move the nature1.jpg ,on successful moving, the file will not be listed in the source directory.
10.To verify whether a file is moved to the / directory click on Home highlighted in blue in the upper left corner.
11.You will see the nature1.jpg listed in the home directory.

Copying a file

To copy a file in another directory on dStorage using Explorer
1.Click 0stor on the upper left corner.
2.Select Files.
3.You will see your uploaded files in the directories on dStorage.For example the nature1.jpg file and a naturefolder is located in the home directory of the dStorage.
4.Let's copy thenature1.jpg file from the /(home) directory to naturedirectory on dStorage. To copy a particular file click on the three dots(...).
6.Choose Copy from the menu.
7.It will ask you to specify the folder/directory name to which file has to be copied If you are copying the file to the home directory just leave it blank. We are copying the file to the nature directory so we will specify nature and click on the green copy button.
8.The explorer will take some seconds to move the nature1.jpg , on successful copying, the file will be copied to the nature directory on dStorage. To verify whether the file is copied to thenaturedirectory click on the forward icon.
9..You will see the nature1.jpeg listed in the nature directory.

Renaming a file

To rename a file on dStorage using Explorer
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted). You will see your uploaded files in the folders on dStorage.For example the nature1.jpg file and a naturefolder is located in the home directory of the dStorage.
3.Let's rename the nature1.jpg file to nature.jpg located in the home directory. To rename a particular file in the directory click on three dots(...)
4.Choose rename from the menu.
5.It will ask to specify the new name for the file. We will rename it to nature and click on the green rename button.
6.The explorer will take some seconds to rename nature1.jpg on successful renaming, you will see renamed nature.jpg file listed in the home directory.

Get File Info

To get information for a particular file on dStorage using explorer
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted)(screenshot explorer 19)You will see your uploaded files in the folders on dStorage. For example the nature.jpg file and a nature folder is located in the home directory of the dStorage.
3.Lets get information fornature.jpgfile located in the home directory. Click on three dots(...)
4.Choose file info from the menu.
5.The explorer will list the transaction id, download cost and the list of multiple blobbers on which file is stored.

Deleting a file

To delete a file on dStorage using Explorer
1.Click 0stor on the upper left corner.
2.Select Files(it will become highlighted)You will see your uploaded files in the folders on dStorage.For example the nature.jpg file and a nature folder is located in the home directory of the dStorage
3.Let's delete the nature.jpg file located in the home directory. Click on three dots(...)
4.Choose delete from the menu.
7.The explorer will ask you to confirm the deletion. Click on the green delete button to delete the file from dStorage.
8.The explorer will take some seconds to delete the file, on successful deletion the nature.jpg the file will not be listed in the home directory.

Private File Sharing

To share a file using Explorer
1.Click 0stor on the upper left corner
2.Select Files(it will become highlighted). You will see your uploaded files in the folders on dStorage.For example the naturefolder is located in the home directory of the dStorage.
3.To view the contents of the folder click on the forward button(see the below screenshot).
5.In the directory you will see two image files.
6.Let's share the encrypted nature1.jpg file located in dStorage.Click on three dots(...)
7.Choose share from the menu.
8.The explorer will ask you to specify the recipient wallet address and public encryption key .To know how to fetch wallet details check get wallet information section.
9.Specify the recipient wallet address and public encryption key and click share, the explorer will generate a link that you can share with the recipient.
10.The recipient can open the link on his local computer and find the file under the shared section of the explorer. The recipient can download or delete the file from a shared directory by clicking on three dots(..)
11.If any other user other than the recipient will try to open the shared file link explorer will deny access to the file and return contact the owner of the file error.