Closed gneowing closed 1 year ago
my exe: PubSub.zip
Please don't post any attachments, especially no executables. You should never be downloading and executing files over the Internet.
SSL DLL is 1.0.2u I did use my API keys from infura and Alchemy. But both no reponse.
You are compiling a 32-bit target, are you not? Are there no errors whatsoever?
Yes,32-bit and no errors.
The compilier output: Checking project dependencies... Building PubSub.dproj (Debug, Win32) brcc32 command line for "PubSub.vrc" c:\delphi10.4update2\bin\cgrc.exe -c65001 PubSub.vrc -foPubSub.res dcc32 command line for "PubSub.dpr" ... [dcc32 Hint] SbpBase16.pas(123): H2443 Inline function 'TUtilities.StringToCharArray' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] SbpBase58.pas(182): H2443 Inline function 'TUtilities.StringToCharArray' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] SbpBase64.pas(230): H2443 Inline function 'TUtilities.StringToCharArray' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpAsn1Objects.pas(4389): H2077 Value assigned to 'TConstructedOctetStream.Read' never used [dcc32 Hint] ClpAsn1Objects.pas(4438): H2077 Value assigned to 'TConstructedOctetStream.ReadByte' never used [dcc32 Hint] ClpAesEngine.pas(520): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(522): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(524): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(526): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(545): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(547): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(549): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(551): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(553): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(555): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(623): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(625): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(627): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(629): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(631): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(633): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(635): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(637): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(758): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(759): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(760): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpAesEngine.pas(761): H2443 Inline function 'TConverters.ReadBytesAsUInt32LE' has not been expanded because unit 'ClpBitConverter' is not specified in USES list [dcc32 Hint] ClpSecureRandom.pas(211): H2077 Value assigned to 'TSecureRandom.Next' never used [dcc32 Hint] ClpSecureRandom.pas(324): H2443 Inline function 'TTimes.NanoTime' has not been expanded because unit 'System.DateUtils' is not specified in USES list [dcc32 Hint] ClpNistNamedCurves.pas(103): H2443 Inline function 'TSecNamedCurves.GetByOid' has not been expanded because unit 'ClpIX9ECParametersHolder' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(90): H2443 Inline function 'TSecNamedCurves.GetByName' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(94): H2443 Inline function 'TNistNamedCurves.GetByName' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(99): H2443 Inline function 'TTeleTrusTNamedCurves.GetByName' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(110): H2443 Inline function 'TSecNamedCurves.GetByOid' has not been expanded because unit 'ClpIX9ECParametersHolder' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(115): H2443 Inline function 'TTeleTrusTNamedCurves.GetByOid' has not been expanded because unit 'ClpIX9ECParametersHolder' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(127): H2443 Inline function 'TSecNamedCurves.GetOid' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(131): H2443 Inline function 'TNistNamedCurves.GetOid' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECNamedCurveTable.pas(136): H2443 Inline function 'TTeleTrusTNamedCurves.GetOid' has not been expanded because unit 'System.SysUtils' is not specified in USES list [dcc32 Hint] ClpECKeyPairGenerator.pas(121): H2443 Inline function 'TCustomNamedCurves.GetByOid' has not been expanded because unit 'ClpIX9ECParametersHolder' is not specified in USES list [dcc32 Warning] web3.rlp.pas(290): W1022 Comparison always evaluates to True [dcc32 Warning] web3.eth.types.pas(350): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [dcc32 Warning] web3.eth.types.pas(359): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString' [dcc32 Hint] common.pas(47): H2443 Inline function 'TFile.Create' has not been expanded because unit 'System.Classes' is not specified in USES list [dcc32 Hint] main.pas(244): H2443 Inline function 'Beep' has not been expanded because unit 'Winapi.Windows' is not specified in USES list Success Elapsed time: 00:00:07.7
As Steven takes all reports seriously, he asked me to test the project using Delphi 10. I have Delphi 10.3 with an older version of the libeay32.dll file. I was able to compile and run the program successfully. I also saw the block numbers being updated. We are not sure what your problem is, but it seems to be more related to your local environment than to the code itself. Therefore, please check your setup, firewall, API keys, etc.
Thank you PieterValentijn, I studied Steven's code just in spare time, sorry for late reponse. My infura API key should be ok because I have used this API key do other things successfully. Today I closed firewall, still no response.
As my environment , the most suspecious thing is : I used VPN and this VPN acted as global proxy. Is VPN the possible reason to cause this no-response? If it was, how to solve this problem?
You say no response but does that also mean no error when you run this in the debugger? I have not studied this in full but as we needed to install some commercial components I guess that does something INDY could not. Is this the only example for Delphereum that does not work for you?
“You say no response but does that also mean no error when you run this in the debugger?” No error in the debugger. And seconds later, the APP give no response. Then I have to kill it after several miniutes. "I guess that does something INDY could not." At least, I have made other APP call FTP components in Indy10.1.5 ( in my delphi10.4.1 ). and this APP worked. "Is this the only example for Delphereum that does not work for you?" Yes, I followed the examples one by one, till now 1st till 10th all workd for me , and this 11th one failed.
And just now I tried 64-bit target, again no-reponse .
@Stefan can this example run on ganache? Just to see if the VPN is the problem.
Oh, sorry, I made a mistake. After building in my physical PC , I always run the PubSub.exe standalone in a virtual PC (WIN 7 + 3G RAM + VPN). Your comment reminded me something. Just now, I re-configured my virtual PC to WIN7+6G RAM + VPN . And run the PubSub.exe in Delphi debug environment, the error occcured. But it is very strange that I have copied the dlls to all the possible used places.
oh, need register these two dlls?
Did you buy the comercial components. if not then that is probably why it does not work.
And the libeay32.dll must ifcource be the same as your project 32 or 64 bit. I guess thats what is wrong now.
I used VPN and this VPN acted as global proxy.
Please rule out as many external factors as possible. In other words: close your VPN connection and anything else that might interfere with your WebSocket connection, then try again.
can this example run on ganache?
I'm afraid Ganache is JSON-REST only (no PubSub). That is why we need Infura or Alchemy or run our own node.
oh, need register these two dlls?
There is no need to register these two DLLs. They are not ActiveX components.
But it is very strange that I have copied the dlls to all the possible used places.
It is possible for your system to load other DLLs available elsewhere on your system. Please search your system for copies of them, then rename or delete those. You will want your executable to load version 1.0.2u only.
"Did you buy the comercial components." I found my sgcWebocket is not registered. :(
I found my sgcWebocket is not registered.
You should be fine. The example should just work with the trail version.
"It is possible for your system to load other DLLs available elsewhere on your system. Please search your system for copies of them, then rename or delete those. You will want your executable to load version 1.0.2u only." 1) There was an old version dll in <>\Embaracadero\Studio\21.0\bin\subversion, I renamed it; 2) There were two other APPs in my virtual PC contained old version dll, but I do not think they will affect our APP. 3) Other paths have the 1.0.2.u version dll.
But, still failed.
Then I unstalled the two other APPs mention in 2). Again failed.
I noticed "class DELPHICLASS EIdOSSLCouldNotLoadSSLLibrary;" in c:\Delphi10.4Update2\sgcWebSockets_D10_4\LibD10_4\win32\sgcIdSSLOpenSSL.hpp
So, I guess perhaps I should copy to other places to satisfy sgc things. But alas, failed again. I am confused, where is the right path to place this dll?
where is the right path to place this dll?
The same directory as where your 32-bit PubSub.exe is
Hi, gurus, I found that I had copied the 64-bit dll files to the directory to run 32-bit exe. So sorry for having wasted you both lots of time. Now the exception is(With VPN):
and(Without VPN), so perhaps no VPN ,no etherum for me here ;)
Now the exception is (With VPN)
socket error 10060 == WSAETIMEDOUT
and (Without VPN)
socket error 10061 == WSAECONNREFUSED
The latest situation: Alchemy is OK now. And Infura is still no-response. All I can say is: my Infura API key is no problem according to the former example. Please refer to the following pic that I got balance via my Infura API key.
Then I turned to 64bit version. The same situation: Alchemy passed;Infura failed. The new project was named as PubSub64. And the following pic proved that I did apply 64-bit dlls mentioned before in the project of PubSub64.
So, let's forget about Infura, just apply Alchemy to continue the 11th example in the git thread of delphereum. The target is 64bit and I used API Key from Alchemy, and still failed, and the exception is : Also I'll commet this on delphereum thread.
The latest situation: Alchemy is OK now.
Awesome! I am happy to hear you got the WebSocket connection to Alchemy working.
Then I turned to 64bit version.
Let's not complicate the matter and forget about the 64-bit version for a moment. Please compile the 32-bit target and use the 32-bit OpenSLL DLLs only.
We would like to request your assistance in debugging the issue that prevented you from connecting with Infura. This is an important task that will help us advance our cause and improve our service. Please explain the reason for the connection failure and whether it was due to your error or the server's security settings (such as TLS 1.3). Or was it due to Murphy's law? You know, the one that says anything that can go wrong will go wrong
ok sry that was AI generated as i dont type like that :-)
That's all right.:) It's my pleasure and honour to contribute about this . The error If press continue:
Change TLS_12 to TLS_13 Still the same error. And I found another compile "error" though this error did not effect the build of exe.
The bug was partly cleared. Notice I used VPN. So while infura, proxy should be configured.
But while alchemy, proxy should not be configured, or , exceptions will occur.
Hi,guru, My env: Embarcadero® Delphi 10.4 Version 27.0.38860.1461 (10.4 Update 1) Windows 7 Service Pack 1(Version 6.1, Build 7601 64-bit Edition) SSL DLL is 1.0.2u I did use my API keys from infura and Alchemy. But both no reponse.
and my exe