2

I do not understand what factors/hardwares are designed for TPS. How can we know the max_transaction_cpu_usage?

Example:
I have a VPS computer with 7 CO
RAM: 1024MB
CPU: 2 Core
Transfer: 2TB
Network: 1000Mbit

How can I know the maximum TPS that I have?

  • Not sure I understand the question. Do you know the difference between POW and DPOS? Are you asking because you want to participate as a block producer? You must have RAM according to the EOS network to participate. Without the minimum amount of RAM you can't be a block producer and the question of your max tps is irrelevant. – Ami Heines Aug 21 '18 at 10:57
  • 1
    To become a block producer, not only RAM, we also need CPU, NET. How we know exactly minimum amount of CPU, NET? And also how we know what minimum hardware require for it? – Quoc Le Aug 22 '18 at 2:46
  • Now it is more clear what you're asking about. I wrote an answer, please check it. You can also edit the question and add the clarifications in your comment to the main question. – Ami Heines Aug 22 '18 at 10:58
1

It depends on the nature of the application actually suppose you have an application to upload a file and read it. Suppose the maximum file size limit you allow in your application is 500 kb then the max_transaction_cpu_usage must be greater than or equal to that limit.

I have this smart contract to upload data

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>

class filestore_contract : public eosio::contract {
  public:
    filestore_contract(account_name self)
      :eosio::contract(self),
      files(_self, _self)
      {}

    // @abi action
    void upload(account_name author, const uint32_t id, const std::string& hash) {
      files.emplace(author, [&](auto& new_file) {
        new_file.id  = id;
        new_file.hash = hash;
      });

      eosio::print("file ", id, " created with ",hash, " Size ",hash.size());
    }

    // @abi action
    void destroy(account_name author, const uint32_t id) {
      auto files_lookup = files.find(id);
      files.erase(files_lookup);

      eosio::print("File #", id, " destroyed");
    }

    // @abi action

  private:
    // @abi table files i64
    struct file {
      uint64_t id;
      std::string hash;


      uint64_t primary_key() const { return id; }
      EOSLIB_SERIALIZE(file, (id)(hash))
    };

    typedef eosio::multi_index<N(files), file> filestore_table;
    filestore_table files;
};

EOSIO_ABI(filestore_contract, (upload)(destroy))

This is my Javascript code

let upload = eos => {
  let str = fs
    .readFileSync(
      "./server/controllers/files/SampleTextFile_500kb.txt",
      (err, res) => {
        if (!err) return res;
      }
    )
    .toString();
  eos.contract("upload").then(contract => {
    contract
      .upload(
        {
          author: "user",
          id: 2324,
          hash: str
        },
        {
          authorization: ["user@active"]
        }
      )
      .then(res => {
        fs.writeFileSync("SampleTextFile_500kb.json", JSON.stringify(res), {
          flag: "w"
        });
      })
      .catch(err => {
        console.log(err);
      });
  });
};

when i tried to upload 500 kb data it was giving me some error because the maximum transaction memory allowed was less then 500 kb so i updated

max_transaction_cpu_usage = 60000

in my config.ini file to solve my error. So it depends on the nature of the transactions you have. Please make sure you keep max_block_cpu_usage > max_transaction_cpu_usage

| improve this answer | |
0

If you want to become a block producer, there is no minimum CPU and NET requirements.

The system works with the 21 top voted block producers. If you are one of the 21 top voted block producers, you will process blocks with the CPU and NET that you have. If you are slow, you will process less than the other block producers and users will not be happy with your performance. They will switch their votes to other block producer candidates which will promise better performing hardware.

This is a race to constantly improve the blockchain for the benefit of all participants.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.