Iagon Trusted Tester Program: Iagon Storage Node 1.0.0 Testing

Iagon Trusted Tester Program: Iagon Storage Node 1.0.0 Testing

Last update - June 22th, 2023

Iagon Team

Disclaimer: Please don’t upload files revealing your personal information.

Swagger documentation: https://gw.v2.iagon.com/api/v2/api-docs/

Desktop Application

  1. Install node for windows, mac and linux
    Download app here - https://drive.google.com/drive/folders/1Ev_ObJAxpoRqEizffznRtOr6qsbwoxFl?usp=sharing
  2. After installing the desktop application, you will be asked to register the node for that device.

3.  Select a port you want the API to run.

4. Select a file path to store the files

5. It will take a few minutes to test if all the upload download files are working in the selected path.

6. You will get the authorization key, copy that authorization key and save it for future use.

7. You will get Node Id in Dashboard. You can use that node id for pinging, testing, uploading and downloading files.

APIs to Interact with nodes


Use this URL : https://gw.v2.iagon.com/api/v2/api-docs/?urls.primaryName=Interact%20with%20nodes

1. Creating a node

Description: This endpoint is used to register a node. The api takes the following request as below, and responds with an node id in the response which will be used for features like ping, test, upload and download files.

Syntax:

curl -X 'POST' \
  'https://da.iagon.com/api/v1/register/node' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "cpu": "i9",
  "read": "500kb",
  "write": "400kb",
  "storage": "ssd",
  "hostname": "127.0.0.1",
  "port": 5001,
  "url": "https://tunnel.iagon.com",
  "city": "kathmandu",
  "country": "Nepal",
  "storage_capacity": 500,
  "storage_path": "c://user/Asus",
  "ram": "i9"
}'

Requests:

CPU: CPU of the node

Read: File read speed per second.

Write: File write speed per second.

Storage: This is the storage type of a node.

Hostname: This is the IP address of the device if it will be hosted on the server like EC2 server.

Port: This is the Port that is used to run the API for uploading and downloading files from the device.

URL: This is the tunneling url to access the API of the node. This is generated programmatically.

City: City location of the Node.

Country: Country location of the Node.

Storage_capacity:  Storage of the device.

Storage_path: File storage path for the uploaded files

RAM: RAM of the node

Response: on success it returns status code of 200 and node information as follow

Body:

{
  "success": true,
  "data": {
    "cpu": "i9",
    "read": "500kb",
    "write": "400kb",
    "url": "http://localhost:5001",
    "hostname": "127.0.0.1",
    "port": 5001,
    "storage": "ssd",
    "ram": "i9",
    "storage_capacity": 500,
    "storage_path": "c://user/Asus",
    "storage_available": 500,
    "is_enabled": false,
    "country": "Nepal",
    "city": "kathmandu",
    "resource_provider_id": null,
    "_id": "648fe8e062afe4247cc48830",
    "created_at": "2023-06-19T05:34:24.680Z",
    "updated_at": "2023-06-19T05:34:24.680Z",
    "__v": 0
  }
}

2. Ping Node

Description: This endpoint is used to ping nodes to verify.

Syntax:

curl -X 'GET' \
'https://da.iagon.com/api/v1/ping?nodeId=648c3de6f8191b0ee459c536' \
  -H 'accept: application/json'

Request:

NodeId: Created Node Id

Response: on success it returns status code of 200 and response as follow

Body:

{
  "message": "node:Ping Successfully"
}

3. Test Node

Description: This endpoint is used to test if upload and download features are working in the node.

Syntax:

curl -X 'GET' \
'https://da.iagon.com/api/v1/test?nodeId=648c3de6f8191b0ee459c536' \
  -H 'accept: application/json'

Request:

NodeId: Created Node Id

Response: on success it returns status code of 200 and response as follow

Body:

{
  "Success": true,
  "message": "Node: Test Successful",
  "authorizationKey": "e69c3a9d-8d3b-4754-adc9-a04bfc8584eb"
}

If the test is being conducted after the first time, the server returns a status code of 200 along with the following response (the authorizationKey is not returned in this case)

{
  "Success": true,
  "message": "Node: Test Successful",
}

4. Upload To Node

Description: This endpoint is used to upload a single file to the node at a time..

Url: /upload

Syntax:

curl --location 'https://da.iagon.com/api/v1/upload' \
--form 'file=@"/Users/mac/Downloads/Sharding.ipynb"' \
--form 'nodeId="648969728067525562184a81"'

Request:

NodeId: Id of the node to which file is to be uploaded to

File: File to be uploaded

Filename: [optional] Optional filename that can be provided for the upload.

Response:

On success, the server returns a status code of 200 and response as follow

Body:

{
  "Success": true,
  "message": "Node: Upload successful",
  "Data": null
}

5. Download File From Node

Description: This endpoint is used to download a single file that has been uploaded by the user to the node.

Url: /download

Syntax:

curl -X 'GET' \ 'https://da.iagon.com/api/v1/download?nodeId=648969728067525562184a81&filename=Sharding.ipynb' \ -H 'accept: application/json'

Request:

NodeId: Id of the node from which file is to be downloaded from.

Filename: Filename of the file that is to be downloaded.

Response:

On success, the server returns with a status code of 200 and the requested file.

6. Delete File From Node

Description: This endpoint is used to delete a single file that has been uploaded by the user to the node.

Url: /delete

Syntax:

curl --location --request DELETE 'https://da.iagon.com/api/v1/delete?filename=test.ipynb&nodeId=648969728067525562184a81'

Request:

NodeId: Id of the node to which file is to be uploaded to.

Filename: Filename of the file that is to be deleted.

Response:

On success, the server returns with a status code of 200, with the following response:

{
    "success": true,
    "message": "Node: File 'test.ipynb' deleted",
    "data": null
}

APIs to Sharding Features

URL: https://gw.v2.iagon.com/api/v2/api-docs/?urls.primaryName=Sharding

1. Encoding

Description: This endpoint is to encode a file and create 6 shards of that file. Download these files to test the decoding process. Currently this process handles files that are less than 40 MB.

Syntax:

curl "https://sharding.iagon.com/encode/" \
-X POST \
-H "Content-Type: multipart/form-data" \
-F file=@"<file>"

Requests:

File: The path to a file to be encoded

Response: On success, the call to this endpoint will return with 200 and the following body:

Body

[
  "https://sharding.iagon.com/download/shard/0",
  "https://sharding.iagon.com/download/shard/1",
  "https://sharding.iagon.com/download/shard/2",
  "https://sharding.iagon.com/download/shard/3",
  "https://sharding.iagon.com/download/shard/4",
  "https://sharding.iagon.com/download/shard/5"
]

2. Decoding

Description: This endpoint is to combine shard files and create a file. Upload the downloaded shard files from the encoding API. Even if the 4 files out of 6 shard files are available it should complete the file. Make sure the files are named shard.0, shard.1, shard.2 and so on.

Syntax:

curl -X 'POST' \
  'https://sharding.iagon.com/decode' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'filename=xyz.txt' \
  -F 'file=@shard.0' \
  -F 'file=@shard.1' \
  -F 'file=@shard.2' \
  -F 'file=@shard.3'


Requests:

Filename: Complete of the encoded file with it’s extension

File: Array of files

Response: On success, the call to this endpoint will return with 200 and the following body:

Body

{
  "decoded": "https://sharding.iagon.com/files/decoded/xyz-decoded.txt"
}

What to test for?

  1. On Desktop Application test if
  2. The app can be installed in mac.
  3. The app can be installed in windows.
  4. The app can be installed in linux.
  5. A node can be registered.
  6. You are able to evaluate your node for storage.
  7. You are able to get system information like storage and read/write.
  8. You are able to generate authorization key
  9. You are able to copy authorization key
  10. You are able to continue to Dashboard.
  11. You are able to see your Node id.
  12. On API test if
  13. You can register a node from API.
  14. You can ping the node using Node id from the desktop application when the desktop application is running.
  15. You can test the node using Node id from the desktop application when the desktop application is running.
  16. You can upload files using Node id in the folder specified when registering the node.
  17. You can download files using Node id in blob format.
  18. You can delete the files from the folder specified using Node id.
  19. You can encode and shard a file upto 40MB and get 6 downloadable links of shard files.
  20. You can decode and get a file by uploading a minimum of 4 shard files you get from encoding API.