CLI wallet operation: publishing content

Content upload

Before content upload begins, the process includes two necessary steps. You can access the following links to learn the operation process directly through the corresponding guidance.

Necessary operating steps:

To upload content, use the submit_content_async method. In the examples provided, we used the following two seeders: 1.2.17 and 1.2.18.

METHODS:
submit_content_async - This function is used to create, upload content packages and submit content in one step.

void submit_content_async (string author,
                           vector<pair<string, uint32_t>> co_authors,
                           string content_dir,
                           string samples_dir,
                           string protocol,
                           vector<regional_price_info> price_amounts,
                           vector<account_id_type> seeders,
                           fc::time_point_sec expiration,
                           string synopsis);

Parameters:

  • author - Content Creator
  • co_authors - The name or ID of the co-author account that matches the base-point-based contribution
  • content_dir - contains the path of all content directories to be packaged
  • amples_dir - The path containing the content sample directory
  • protocol - Upload Content Packet protocol (Star File System)
  • price_amounts - Content value for each region
  • Seeders - a list of seeders who publish content
  • Expiration - expiration of content. Content is allowed to be purchased before expiration
  • synopsis - Detailed description of content

Examples are given to illustrate:

submit_content_async accountname [] "/path/to/file/testfile.txt" "" "ipfs" \
[{"region":"AE","amount":"1","asset_symbol":"DCT"}] ["1.2.17","1.2.18"] \
"2017-11-17T23:59:59" "{\"content_type_id\":\"0\",\"title\":\"greatTestFile\", \
\"description\":\"some description.. \"}"

Where: According to the list, content_type_id is the number that specifies the target network and content type.

  • ContentObject Application Number List
    • 0 - DCore
  • ContentObjectType Number List
    0 - None
    1 - Music
    2 - Films
    3 - Books
    4 - Audio Books
    5 - Software
    6 - Games
    7 - Pictures
    8 - Documentation

For example, "0.5" represents the DCore network and the specified Software type.

Result:

submit_content_async accountname [] "/path/to/file/testfile.txt" "" "ipfs" \
[{"region":"AE","amount":"1","asset_symbol":"DCT"}] ["1.2.18","1.2.17"] \
"2017-11-17T23:59:59" "{\"content_type_id\":\"0\",\"title\":\"greatTestFile\", \
\"description\":\"some description.. \"}"
null

API Developer Documentation for Submitting Asynchronous Content

Look for the seeder

This is one of the necessary steps in the upload process. The content upload process cannot proceed without specifying the seeder who is ready to upload the content. Select your preferred method from the following text to see who can sow( Through price , region , Upload information , Grade ) Please follow the guidelines provided in this document.

Explain
Note that all methods respond to instructions in the same structure. So we'll just give you the response instructions for the first method, list_seeders_by_price (the list of seeders selected by price).

Selection of seeders by price

METHODS:
list_seeders_by_price - Select a list of seeders by price, with the list number from low to high

vector<seeder_object> list_seeders_by_price(uint32_t count);

Parameters:

  • count - Maximum number of returned Seeders

Return value:

  • Screened list of seeders

Examples are given to illustrate:

list_seeders_by_price 5

Respond:

[{
    "id": "2.14.1",
    "seeder": "1.2.16",
    "free_space": 874,
    "price": {
      "amount": 1,
      "asset_id": "1.3.0"
    },
    "expiration": "2017-11-14T12:42:25",
    "pubKey": {
      "s": "108509137992084552766842257584642929445130808368600055288928130756106214148863141200188299504000640159872636359336882924163527129138321742300857400054934."
    },
    "ipfs_ID": "Qma7mvd4A9nDfuEyw65Y5Toik2BZmDcM35xFq1SeuQns7n",
    "stats": "2.16.1",
    "rating": 0,
    "region_code": ""
  },{
    "id": "2.14.2",
    "seeder": "1.2.17",
    "free_space": 854,
    "price": {
      "amount": 1,
      "asset_id": "1.3.0"
    },
    "expiration": "2017-11-14T12:48:15",
    "pubKey": {
      "s": "8490319717792401336022711903211688203776011372958543603431635388400597658916629399144065413122027733188246528373794568719741969521921155180202961044843254."
    },
    "ipfs_ID": "QmUc1fB7vYuZLxUvEJPb6w2z5apKRgmKqWjCm7A8yG9u81",
    "stats": "2.16.2",
    "rating": 22,
    "region_code": ""
  },{
    "id": "2.14.3",
    "seeder": "1.2.18",
    "free_space": 991,
    "price": {
      "amount": 1,
      "asset_id": "1.3.0"
    },
    "expiration": "2017-11-14T12:52:20",
    "pubKey": {
      "s": "2303777410538172886271756794595982408449215299184180786707946414344825115577210309329094182704710373375176575047946743652593825273038473592524248046488588."
    },
    "ipfs_ID": "QmTWG4AtyXxLPtZ6iahoaT8HBA2cDSSeAvkbrzNVT8KS4p",
    "stats": "2.16.3",
    "rating": 594,
    "region_code": "SK"
  }
]

List seeder API developer documentation at price

Selection of seeders by Region

METHODS:

list_seeders_by_region - A list of seeders selected by region. Area codes are declared by international standardization 3166-1 alpha-2.

vector<seeder_object> list_seeders_by_region(string region_code);

Parameters:

  • region_code - Code for the area where the seeder is located

Return value:

  • List of selected Seeders

Examples are given to illustrate:

list_seeders_by_region "SK"

List Sower API Developer Documents in Areas

Selection of seeders by scoring

METHODS:
list_seeders_by_rating - Get a list of seeders by grading, with the list number from high to low

optional<vector<seeder_object>> list_seeders_by_upload(uint32_t count);

Parameters:

  • count - Maximum number of returned Seeders

Return value:

  • Selected Sower List

Examples are given to illustrate:

list_seeders_by_upload 5

List seeder API developer documentation by rating

Keywords: network

Added by adi on Mon, 26 Aug 2019 12:58:09 +0300