CRYPTO NEWS

how can do a Load Test for a web3 script?

In my scenario, I use truffle and ganache. I created a simple Contract like this

contract SimpleContract {     string public  name ;     uint counter = 0;      event myEvent(uint id , string name);      function setName(string memory _name) public     {        name = _name ;           counter++;        emit myEvent(counter , _name);     }   }  

Then I made a script called Client.js like this to test the smart contract:

const Web3 = require('web3'); const SimpleContract = require('../build/contracts/SimpleContract.json');   module.exports = async done => {           var myContract;         const web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8545'));      const accounts = await web3.eth.getAccounts();     console.log(accounts[0]);      myContract = new web3.eth.Contract(SimpleContract.abi,  SimpleContract.networks['5777'].address);      const result = await myContract.methods.setName("Alex").send({ from : accounts[0]})     console.log(result);      done();   }  

Now I want to do a load test of the script, But I don’t have any idea.

Please help me to solve it.

Bitcoins being sent to another addres during a transaction

I realized a few days back, that if I send some bitcoins to someone, then it shows in blockchain an extra amount sent to my own wallet. So if I send 0.5 BTC from wallet A to B then blockchain shows A–> B 0.5 A–>A 1 (basically sending it to my wallet as well.) Today::Listen

I realized a few days back, that if I send some bitcoins to someone, then it shows in blockchain an extra amount sent to my own wallet. So if I send 0.5 BTC from wallet A to B then blockchain shows

A--> B 0.5 A-->A  1  (basically sending it to my wallet as well.) 

Today I noticed a different wallet address during a transaction. So it was like

A--> B 0.2 A--> C 0.5 

Checking address C on blockchain, it gets sent back to A in some time. But since this morning, the bitcoins haven’t come back to A. If I open my wallet on multibit, it shows the correct balance. However on blockchain, it’s 0.5 less. The funds from C have not been sent back to A, but it shows on multibit the right balance in A.

Crypto Hats, Crypto Shirts, Crypto Socks, Crypto Clothing

how can do a Load Test for a web3 script?

Shopping cart
There are no products in the cart!
Continue shopping
0