Skip to content

realInt2k/thanksPayContractsDeployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to re-produce the test in the spread-sheet (IMPORTANT)

First, clone the repo

then do this regulary if things go wrong $rootRepo:

  • MAC/Linux: rm -rf transaction_log/*
  • Windows: rm -r -Force transaction_log/*

If you want to keep logs, move them to different directories.

Compile contract:

npx hardhat compile

Start ganache:

npm run start:ganache

^ If error: try deleting $rootRepo/ganacheDB/ directory and run again

-Successful run:

image

Deploy the contracts to ganache, klaytn, Polygon:

  • Ganache: npm run deploy:ganache:testnet
  • Polygon: npm run deploy:polygon:testnet
  • Klaytn: npm run deploy:klaytn:testnet

^ That will deploy both old and new contracts to these 3 networks.

^ It will take a while.

^ If error: Contact Devs to pump more money to these test accounts.

  • Example of successful klaytn deployment:

image

  • It should be the same with Ganache, Polygon!

Now, you should understand the order of the test to read logs:

  • Register 1 partner,
  • Register 1 worker to that partner,
  • Said partner deposits some money,
  • Said Worker get some money from salary

Logs will be named after "nonce", don't need to understand what's nonce, it's basically a number, and you can read say, last 4 largest numbers are the latest test transactions for example.

Get results for old contracts:

Polygon:

  • npm run test:old2:polygon:testnet

Read on the terminal how much time does each transaction take

-Example:

image image

^ The red time (i.e: 13018ms) means 13.018 seconds or 13018 milliseconds.

Then navigate to $rootRepo/transaction_log/old_contract/polygontest/synced/

Then read latest 4 logs

-Example of one log: image

^ Things to read: gasUsed, gasPrice, USD, networkname, function used by the old contract.

Klaytn:

  • Klaytn: npm run test:old2:klaytn:testnet

Read on the terminal how much time does each transaction take

Then navigate to $rootRepo/transaction_log/old_contract/klaytn/synced/

Then read latest 4 logs

  • Example is the same as Polygon

Get results for new contracts:

First you HAVE to send them to ganache (to measure speed)

  • npm run test:new2:ganache:testnet

Read on the terminal how much time each transaction takes

-Example:

image image

  • Read the red time thingy

Then an un-synced transaction logs will be here:

  • $rootRepo/transaction_log/new_contract/polygonTest/unsynced/*
  • $rootRepo/transaction_log/new_contract/klaytn/unsynced/*

But you don't need to read it

Then you run the background Klaytn, Polygon (to measure cost):

  • On one terminal: ts-node $rootRepo/scripts/utils/klaytnScriptUnderground.ts
  • On other terminal: ts-node $rootRepo/scripts/utils/polygonScriptUnderground.ts

example of klaytn background script:

  • image

Then, the synced transaction logs will be here:

  • $rootRepo/transaction_log/new_contract/polygonTest/synced/*
  • $rootRepo/transaction_log/new_contract/klaytn/synced/*

You read them to collect costs.

  • Example:

image

image

  • Well, you know what to look at!

Read background-speed (OPTIONAL)

  • Example for Polygon (klaytn apply same method): npm run test:new2:polygon:testnet

image


for devs (more info behind the scene): https://github.com/realInt2k/thanksPayContractsDeployer/blob/olzhas/devREADME.md

About

Hardhat ganache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •