[Ganache/ Truffle]revert TX Limit Exceeded -- Reason given: TX Limit Exceeded - blockchain

To test my EVM smart contract on mainnet, I use ganache to fork mainnet and implement the truffle test but failed with error code as the title.
My Environment:
RPC endpoint: https://bsc-dataseed1.defibit.io
Truffle v5.2.6 (core: 5.2.6)
Solidity - 0.8.13 (solc-js)
Node v18.13.0
Web3.js v1.2.9
Ganache CLI v6.12.2 (ganache-core: 2.13.2)
The steps to reproduce:
fork mainnet
ganache-cli --fork https://bsc-dataseed1.defibit.io --unlock "0x14f62daeee9ef67588bc882480b1c7992980fcaa" --unlock "0x6adb5974d4fc421aad4105f09c68f85700f5c36b"
Run truffle test
truffle test --network development
And it shows the error revert TX Limit Exceeded -- Reason given: TX Limit Exceeded.
I think it should not be the issue from my contract code but from the environment. But I am not able to find any reference from google.
It will be very appreciated if anybody can give me a hint.
The full log of error herewith FYI:
Deployer accounts: 0x41BD4fa20FBe952bfe441C3C8996EAB8aC1F2cF2
{ afntyAddr: '0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047' }
Contract: My contract test
✓ Set up all related contract ready (1299ms)
✓ Owner set cutOff (128ms)
{
migratorOwner: '0x41BD4fa20FBe952bfe441C3C8996EAB8aC1F2cF2',
migrator: '0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047'
}
{ contractNewTokenBalance: 500000 }
{ contractNewTokenBalance: 0 }
✓ Owner input and withdraw new token (57068ms)
1) Allow users to migrate
Events emitted during test:
---------------------------
Warning: Could not decode event!
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 16674738392 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 16674738392 (type: uint256)
)
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
to: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
value: 1739430161 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
to: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
value: 1739430161 (type: uint256)
)
Warning: Could not decode event!
Warning: Could not decode event!
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 1739430161 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 1739430161 (type: uint256)
)
Warning: Could not decode event!
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 16633051545 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
value: 16633051545 (type: uint256)
)
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
to: <indexed> 0x0ED943Ce24BaEBf257488771759F9BF482C39706 (type: address),
value: 2125942 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
to: <indexed> 0x0ED943Ce24BaEBf257488771759F9BF482C39706 (type: address),
value: 2125942 (type: uint256)
)
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
to: <indexed> 0xEe3C1B43482bf018ac960EeA8B57d8e576368D57 (type: address),
value: 5301567942 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
to: <indexed> 0xEe3C1B43482bf018ac960EeA8B57d8e576368D57 (type: address),
value: 5301567942 (type: uint256)
)
Warning: Could not decode event!
Warning: Could not decode event!
Warning: Could not decode event!
Ambiguous event, possible interpretations:
* UsingERC20.Transfer(
from: <indexed> 0x14f62dAEEE9ef67588BC882480b1C7992980fCaA (type: address),
to: <indexed> 0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047 (type: address),
value: 500000000000000 (type: uint256)
)
* IERC20.Transfer(
from: <indexed> 0x14f62dAEEE9ef67588BC882480b1C7992980fCaA (type: address),
to: <indexed> 0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047 (type: address),
value: 500000000000000 (type: uint256)
)
---------------------------
3 passing (1m)
1 failing
1) Contract: My contract test
Allow users to migrate:
Error: Returned error: VM Exception while processing transaction: revert TX Limit Exceeded -- Reason given: TX Limit Exceeded.
at Context.<anonymous> (test/testContract.js:58:20)
at processTicksAndRejections (node:internal/process/task_queues:95:5

Related

Calling Move (entry) functions using SUI CLI

I have published a module called certificates at 0x426ff70c987a00b9384b102f10a4f8bb8945141f
\identities>sui client object --id 0x426ff70c987a00b9384b102f10a4f8bb8945141f
----- Move Package (0x426ff70c987a00b9384b102f10a4f8bb8945141f[1]) -----
Owner: Immutable
Version: 1
Storage Rebate: 0
Previous Transaction: K01/b4ZdtujIIAiFODDRATUUMs3mw41OHNoB2kfMghY=
----- Data -----
Modules: ["certificates"]
I am trying to call a function named issue_certificate with the following signature:
public entry fun issue_certificate(_: &CertCreatorCap,
name: vector<u8>,
year: u8,
recipient: address,
ctx: &mut TxContext)
&CertCreatorCap has the following ID: 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
\identities>sui client object --id 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
----- Move Object (0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953[1]) -----
Owner: Account Address ( 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 )
Version: 1
Storage Rebate: 14
Previous Transaction: K01/b4ZdtujIIAiFODDRATUUMs3mw41OHNoB2kfMghY=
----- Data -----
type: 0x426ff70c987a00b9384b102f10a4f8bb8945141f::certificates::CertCreatorCap
id: 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953
The command using Sui Client CLI is: variant -> name = "JIM"
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 "JIM" 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
Could not serialize argument of type U8 at 2 into u8. Got error: out of range integral type conversion attempted
I have tried putting in b"JIM" and <74,105,109>, they give the following errors.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 <74,105,109> 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
The system cannot find the file specified.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 b"JIM" 2022 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
Could not serialize argument of type U8 at 2 into u8. Got error: out of range integral type conversion attempted
I think the fundamental question is how I do pass vector/string arguments via the CLI to call a move function on Sui.
\identities>sui client call --function issue_certificate --module certificates --package 0x426ff70c987a00b9384b102f10a4f8bb8945141f --args 0x8e724e1266e1f4f1a8d6cfa904b2e0749ed41953 "JIM" 22 0xb7a9c2bc3a65ad0b02851e426e6b34dcf069b6c7 --gas-budget 100000
The above command works lol, it's because 2022 is way bigger than u8... What a careless mistake.

How to connect to Amazon managed blockchain network using hyperledger-fabric-nodesdk 2.2

I want to connect to hyperledger fabric blockchain network on Amazon Managed Blockchain using nodejs sdk.
Fabric client is a cloud9 instance, which already setup and successfully connected to peer node using fabric cli inside a docker container.
But when I try to use nodejs sdk to connect to network with this code:
'use strict';
const FabricCAServices = require('fabric-ca-client');
const { Wallets, Gateway, X509Identity, User } = require('fabric-network');
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
const ccpPath = path.resolve(__dirname, 'connection_profile.yaml');
const ccp = yaml.load(fs.readFileSync(ccpPath, 'utf8'));
async function main() {
try {
const walletPath = path.join(process.cwd(), 'wallet');
const wallet = await Wallets.newFileSystemWallet(walletPath);
const gateway = new Gateway();
const gatewayOptions = {identity: 'admin', wallet: wallet, discovery: {enabled: true, asLocalhost: false }}
await gateway.connect(ccp, gatewayOptions);
const network = await gateway.getNetwork('mychannel');
} catch (error) {
console.error(`Some error is occurred: ${error.stack}`);
process.exit(1);
}
}
main();
With content of "connection_profile.yaml" file is:
name: "ABC"
x-type: hlfv1
version: "1.0"
channels:
mychannel:
orderers:
- ABCOrderer
peers:
peer1:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
organizations:
abc:
mspid: m-***
peers:
- peer1
certificateAuthorities:
- abc
orderers:
ABCOrderer:
url: grpcs://orderer.n-***.managedblockchain.ap-northeast-1.amazonaws.com:30001
grpcOptions:
ssl-target-name-override: orderer.n-***.managedblockchain.ap-northeast-1.amazonaws.com
tlsCACerts:
# path: /home/ec2-user/managedblockchain-tls-chain.pem
path: /home/ec2-user/admin-msp/admincerts/cert.pem
peers:
peer1:
url: grpcs://nd-***.managedblockchain.ap-northeast-1.amazonaws.com:30003
eventUrl: grpcs://nd-***.managedblockchain.ap-northeast-1.amazonaws.com:30004
grpcOptions:
ssl-target-name-override: nd-***.managedblockchain.ap-northeast-1.amazonaws.com
tlsCACerts:
# path: /home/ec2-user/managedblockchain-tls-chain.pem
path: /home/ec2-user/admin-msp/admincerts/cert.pem
certificateAuthorities:
abc:
url: https://ca.m-***.managedblockchain.ap-northeast-1.amazonaws.com:30002
httpOptions:
verify: true
tlsCACerts:
# path: /home/ec2-user/managedblockchain-tls-chain.pem
path: /home/ec2-user/admin-msp/admincerts/cert.pem
caName: m-***
"/home/ec2-user/admin-msp/admincerts/cert.pem" is file is created by enroll member admin identity (follow this aws guide: https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/get-started-enroll-admin.html).
Then after 3s the console show this error:
2022-07-05T13:22:52.812Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer1, url:grpcs://nd-***.managedblockchain.ap-northeast-1.amazonaws.com:30003, connected:false, connectAttempted:true
2022-07-05T13:22:52.814Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer1 url:grpcs://nd-***.managedblockchain.ap-northeast-1.amazonaws.com:30003 timeout:3000
2022-07-05T13:22:52.814Z - info: [NetworkConfig]: buildPeer - Unable to connect to the endorser peer1 due to Error: Failed to connect before the deadline on Endorser- name: peer1, url:grpcs://nd-***.managedblockchain.ap-northeast-1.amazonaws.com:30003, connected:false, connectAttempted:true
2022-07-05T13:22:55.817Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Committer- name: ABCOrderer, url:grpcs://orderer.n-***.managedblockchain.ap-northeast-1.amazonaws.com:30001, connected:false, connectAttempted:true
2022-07-05T13:22:55.817Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server ABCOrderer url:grpcs://orderer.n-***.managedblockchain.ap-northeast-1.amazonaws.com:30001 timeout:3000
2022-07-05T13:22:55.818Z - info: [NetworkConfig]: buildOrderer - Unable to connect to the committer ABCOrderer due to Error: Failed to connect before the deadline on Committer- name: ABCOrderer, url:grpcs://orderer.n-***.managedblockchain.ap-northeast-1.amazonaws.com:30001, connected:false, connectAttempted:true
Some error is occurred: TypeError: Cannot read property 'toArray' of null
at EC.sign (/home/ec2-user/src-test/node_modules/elliptic/lib/elliptic/ec/index.js:104:30)
at CryptoSuite_ECDSA_AES.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/impl/CryptoSuite_ECDSA_AES.js:215:25)
at Signer.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/Signer.js:59:28)
at SigningIdentity.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/SigningIdentity.js:71:23)
at IdentityContext.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/IdentityContext.js:91:40)
at DiscoveryService.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/ServiceAction.js:69:40)
at NetworkImpl._initializeInternalChannel (/home/ec2-user/src-test/node_modules/fabric-network/lib/network.js:298:35)
at NetworkImpl._initialize (/home/ec2-user/src-test/node_modules/fabric-network/lib/network.js:250:20)
at Gateway.getNetwork (/home/ec2-user/src-test/node_modules/fabric-network/lib/gateway.js:350:26)
at main (/home/ec2-user/src-test/enrollUser.js:38:35)
So I think the problem probably is my connection_profile setting, which I mimic connection-profile-template.yaml file from aws blockchain samples code (https://github.com/aws-samples/non-profit-blockchain/tree/master/ngo-lambda).
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
name: "ngo"
x-type: "hlfv1"
description: "NGO Network"
version: "1.0"
channels:
mychannel:
orderers:
- orderer.com
peers:
peer1:
endorsingPeer: true
chaincodeQuery: true
ledgerQuery: true
eventSource: true
organizations:
Org1:
mspid: %MEMBERID%
peers:
- peer1
certificateAuthorities:
- ca-org1
orderers:
orderer.com:
url: grpcs://%ORDERINGSERVICEENDPOINT%
grpcOptions:
ssl-target-name-override: %ORDERINGSERVICEENDPOINTNOPORT%
tlsCACerts:
path: %CAFILE%
peers:
peer1:
url: grpcs://%PEERSERVICEENDPOINT%
eventUrl: grpcs://%PEEREVENTENDPOINT%
grpcOptions:
ssl-target-name-override: %PEERSERVICEENDPOINTNOPORT%
tlsCACerts:
path: %CAFILE%
certificateAuthorities:
ca-org1:
url: https://%CASERVICEENDPOINT%
httpOptions:
verify: false
tlsCACerts:
path: %CAFILE%
caName: %MEMBERID%
So, any idea or suggestion on how can I fix it? Any help would be appreciated.
Thank You!
Updated_1:
I try both key file from AWS S3(managedblockchain-tls-chain.pem) and key created by CA for admin. But both do not seem to work. Here is the error when I try with key file from S3:
Some error is occurred: TypeError: Cannot read property 'toArray' of null
at EC.sign (/home/ec2-user/src-test/node_modules/elliptic/lib/elliptic/ec/index.js:104:30)
at CryptoSuite_ECDSA_AES.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/impl/CryptoSuite_ECDSA_AES.js:215:25)
at Signer.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/Signer.js:59:28)
at SigningIdentity.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/SigningIdentity.js:71:23)
at IdentityContext.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/IdentityContext.js:91:40)
at DiscoveryService.sign (/home/ec2-user/src-test/node_modules/fabric-common/lib/ServiceAction.js:69:40)
at NetworkImpl._initializeInternalChannel (/home/ec2-user/src-test/node_modules/fabric-network/lib/network.js:298:35)
at NetworkImpl._initialize (/home/ec2-user/src-test/node_modules/fabric-network/lib/network.js:250:20)
at Gateway.getNetwork (/home/ec2-user/src-test/node_modules/fabric-network/lib/gateway.js:350:26)
at main (/home/ec2-user/src-test/enrollUser.js:38:35)
Updated 2:
Maybe the problem is my admin identity inside wallet, so I update the code to save admin identity to the wallet:
const caURL = ccp.certificateAuthorities['abc'].url;
const ca = new FabricCAServices(caURL);
const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'Adminpassword' });
const X509Identity = {
credentials: {
certificate: enrollment.certificate,
privateKey: enrollment.rootCertificate,
},
mspId: ccp.organizations['abc'].mspid,
type: 'X.509',
};
// Create a new file system based wallet for managing identities.
const walletPath = path.join(process.cwd(), 'wallet');
const wallet = await Wallets.newFileSystemWallet(walletPath);
await wallet.put('admin', X509Identity);
Updated_3:
As #david_k suggests, the problem is my identity inside the wallet is wrong, and as the result, it is denied by the gateway. So the line privateKey in Update_2 needs to be changed from privateKey: enrollment.rootCertificate, to privateKey: enrollment.key.toBytes(),
Thank you very much #david_k!

Encountered an error while attempting to update latest block

I'm new to blockchain and i was just trying to deploy a simple smart contract to ropsten test net. I've used the smart contract code from https://github.com/t4sk/solidity-multi-sig-wallet. Also i'm using the account provided by truffle develop
My truffle-config.js:
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},
mocha: {
timeout: 100000
},
compilers: {
solc: {
version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: false,
runs: 200
},
// evmVersion: "byzantium"
// }
}
},
Im using solidity: 0.5.1
But when i try to deploy it using truffle migrate --network ropsten im getting the following two errors
1.
This version of µWS is not compatible with your Node.js build:
Error: Cannot find module './uws_win32_x64_72.node'
Falling back to a NodeJS implementation; performance may be degraded.
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0x673a9a02662595075c6f3aa4dc904d24203cb8e460a3e20a630869c5155cb78c
> Blocks: 2 Seconds: 53
> contract address: 0xde674E126884c8F7Ddd94B5013065596b81fEd6d
> block number: 12075322
> block timestamp: 1647065140
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.830076836873988898
> gas used: 175087 (0x2abef)
> gas price: 2.500000028 gwei
> value sent: 0 ETH
> total cost: 0.000437717504902436 ETH
Pausing for 2 confirmations...
-------------------------------
C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848
var e = new Error('ETIMEDOUT')
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
at Timeout.<anonymous> (C:\Users\coolg\Desktop\hd_wallet\node_modules\request\request.js:848:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
at PollingBlockTracker._performSync (C:\Users\coolg\Desktop\hd_wallet\node_modules\eth-block-tracker\src\polling.js:51:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Also a transaction for the above smart contract address 0xde674E126884c8F7Ddd94B5013065596b81fEd6d is created on ropsten network.
Edit 1:
I've replaced the provider link with wss://ropsten.infura.io/v3/${infuraKey}` and the 2nd issue gets resolved but now it shows another error
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0xb72aef24e5fc16395f1dc221965c4e2036b4d72babbe829f244f958d302baee5
> Blocks: 7 Seconds: 228
> contract address: 0xb81478b107D5B08B0F9ce8d0E404701a3D2292a0
> block number: 12076445
> block timestamp: 1647090364
> account: 0xC10352218af6Ccbb574Fd0912adcc9Ac59C22950
> balance: 1.828763684345799891
> gas used: 175087 (0x2abef)
> gas price: 2.500000007 gwei
> value sent: 0 ETH
> total cost: 0.000437717501225609 ETH
Pausing for 2 confirmations...
-------------------------------
> confirmation number: 3 (block: 12076452)
⠦ Saving migration to chain.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
It says the transaction might still be mined, so how will i know when my transaction gets mined? Also in the meantime can i call the fuctions/events of my smart contract that is deployed on the ropsten_eth https://ropsten.etherscan.io/address/0xb81478b107d5b08b0f9ce8d0e404701a3d2292a0
The problem here by mistake may be the address you are trying to reach. I searched for what the problem might be and found two threads where people have already described the problem and sort of found a solution. Most likely one of these options should help to solve the problem.
The first solution is here. The idea is to replace https with wss. There should be something like this:
testnet: {
provider: () => new HDWalletProvider(mnemonic, `wss://ropsten.infura.io/v3/${infuraKey}`),
...
}
Then I searched some more and found something like this. The author of the post says that the problem could be due to DNS or slow internet and suggests adding two parameters to the config:
testnet: {
...,
networkCheckTimeout: 10000,
timeoutBlocks: 200
}

Problems about 53 bits deploying contracts with Truffle

I am trying to deploy a Smart Contract with truffle 5.1.19 as follows:
pragma solidity 0.5.16;
contract Simple {
string public message;
function Hello(string memory _initialMessage) public {
message = _initialMessage;
}
function setMessage(string memory _newMessage) public {
message = _newMessage;
}
}
When I run a truffle deploy --network mired I have the next error:
Error: Number can only safely store up to 53 bits
at assert (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/bn.js/lib/bn.js:6:1)
at BN.toNumber (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/bn.js/lib/bn.js:506:1)
at Object.hexToNumber (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-utils/src/utils.js:234:1)
at Method.outputBlockFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/src/formatters.js:236:1)
at Method.web3.eth.getBlock.method.outputFormatter (/usr/local/lib/node_modules/truffle/build/webpack:/packages/interface-adapter/dist/shim/overloads/ethereum.js:37:1)
at Method.formatOutput (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-method/src/index.js:163:1)
at sendTxCallback (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-method/src/index.js:473:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-requestmanager/src/index.js:147:1
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:112:1
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-providers-http/src/index.js:96:1)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:318:1)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:289:47)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Truffle v5.1.19 (core: 5.1.19)
Node v10.19.0
My truffle-config for my network is the next one:
mired: {
host: "10.xxx.xxx.xxx",
port: 8080, // Custom port
network_id: "*", // Custom network
gas: 0, // Gas sent with each transaction (default: ~6700000)
gasPrice: 0x0, // 20 gwei (in wei) (default: 100 gwei)
from: "0x8...............", // Account to send txs from (default: accounts[0])
// websockets: true // Enable EventEmitter interface for web3 (default: false)
},
Doing a downgrade of my truffle to the 4.1.15 version this error dissapears but I don't understand why with an actual version, this error appears. Thanks in advance
If you are working with quorum like it is my case. On truffle-config.js, you have to write type:"quorum" and it solves the problem.

Sending email: Connection reset by peer

Lets say I have a function like below that sends and receives info from a socket flawlessly..
The results are:
Connected to: 65.55.96.11 Port: 25
220 BLU0-SMTP374.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Mon, 31 Dec 2012 19:52:22 -0800
250 BLU0-SMTP374.blu0.hotmail.com Hello [50.100.44.155]
220 2.0.0 SMTP server ready
Exception: Socket Error 10054: Connection reset by peer
Why do I get an exception? It throws the exception when I send the "DATA" string.
How do I login? I cannot seem to find out how anywhere online. I searched it and only see AUTH command but no usage or examples at all.
The code is below:
void SendEmail(std::string Username, std::string Password, std::string IP, std::string Port)
{
Socket = CreateSocket;
ConnectSocket(Socket, IP, Port);
SetTimeout(Socket, 10000);
SocketInfo(Socket, IP, Port);
writeln("Connected to: " + IP + " Port: " + Port);
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "HELO"); //SendSocketEx automatically adds \r\n to the end of a line..
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "STARTTLS");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "MAIL FROM: mehwtfbleh#hotmail.com");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "VRFY mehwtfbleh#hotmail.com");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "RCPT TO: mehwtfbleh#hotmail.com");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "DATA");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "This Is The Body..");
writeln(RecvSocket(Socket));
SendSocketEx(Socket, "QUIT");
writeln(RecvSocket(Socket));
CloseSocket(Socket);
FreeSocket(Socket);
}
int main()
{
SendEmail("", "", "smtp.live.com", "25", "localhost");
}
The problem is that this server requires communication to occur over the TLS protocol. The STARTTLS command tells the server that all further communication will occur over the Secure Sockets Layer (SSL/TLS). Once this connection is established, all further communication between the 2 sides is encrypted.
The easiest way to accomplish that is to use a library that implements SSL/TLS. The most famous library is OpenSSL.
You can perform a quick test using OpenSSL from your terminal/console:
openssl s_client -connect smtp.live.com:25 -starttls smtp -crlf
Then you can send your commands:
EHLO hotmail.com
AUTH LOGIN (this depends on the methods supported by the server)
...
MAIL FROM: <your email>
RCPT TO: <recipient email>
DATA
All your SMTP are belong to us.
.