Crypto-Currency / Emerald-OLD---DO-NOT-USE

Emerald Crypto scrypt-based cryptocurrency
http://emeraldcrypto.de/
MIT License
7 stars 8 forks source link

openssl-1.1 compliance #4

Open lvypaul opened 4 years ago

lvypaul commented 4 years ago

Hi

When I tried to compile your code I got multiple errors like: error: cannot convert ‘CBigNum’ to ‘BIGNUM’ {aka ‘bignum_st*’} As far as I read the problem is that code is writen for ssl 1.0.0 libs and I already have 1.1.1.

Can this code be updated? Thank you

Spidersbox commented 4 years ago

It can be updated, but not very easily. you could try sudo apt install openssl1.0 libssl1.0-dev

or compiling opennssl 1.0 yourself wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz

tar -xvzf openssl-1.0.1g.tar.gz

cd openssl-1.0.1g

./config --prefix=/usr/

make

sudo make install_sw

Spider

From: lvypaul Sent: Saturday, September 19, 2020 4:16 PM To: Crypto-Currency/Emerald Emerald@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Crypto-Currency/Emerald] openssl-1.1 compliance (#4)

Hi

When I tried to compile your code I got multiple errors like: error: cannot convert ‘CBigNum’ to ‘BIGNUM’ {aka ‘bignum_st*’} As far as I read the problem is that code is writen for ssl 1.0.0 libs and I already have 1.1.1.

Can this code be updated? Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Crypto-Currency/Emerald/issues/4 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM3N3N5RCGCSTTVMLY5D5TSGU3T3ANCNFSM4RTJGCQQ . https://github.com/notifications/beacon/ADM3N3KWUBPD3BM5OIBADHTSGU3T3A5CNFSM4RTJGCQ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KQFUXDA.gif

lvypaul commented 4 years ago

Thank you for your really fast response.

I am using FC30 to compile it. I solved the error above by removing opnessl-libs and installing compat-openssl rpm, those give the openssl 102 headers.

Of course now I have to disable UPNP

src/net.cpp:1071:68: error: invalid conversion from ‘int*’ to ‘unsigned char’ [-fpermissive] 1071 devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); ^~
int*

src/net.cpp:1071:74: error: too few arguments to function ‘UPNPDev upnpDiscover(int, const char, const char, int, int, unsigned char, int)’ 1071 | devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);

As I read in the other closed issue is not in useful anymore.

I am compiling this because the precompiled emerald-qt from the site is requiring "/Emerald-qt: error while loading shared libraries: libminiupnpc.so.10: cannot open shared object file: No such file or directory" and I prefer to compile it to avoid searching and installing this lib on Fedora.

Spidersbox commented 4 years ago

True, the upnp does not compile anyway. I use makefile -f makefile.unix USE_UPNP=-

Spider

From: lvypaul Sent: Saturday, September 19, 2020 5:32 PM To: Crypto-Currency/Emerald Emerald@noreply.github.com Cc: Spidersbox Spider@Spidersbox.com; Comment comment@noreply.github.com Subject: Re: [Crypto-Currency/Emerald] openssl-1.1 compliance (#4)

Thank you for your really fast response.

I am using FC30 to compile it. I solved the error above by removing opnessl-libs and installing compat-openssl rpm, those give the openssl 102 headers.

Of course now I have to disable UPNP

src/net.cpp:1071:68: error: invalid conversion from ‘int*’ to ‘unsigned char’ [-fpermissive] 1071 devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); ^~
int*

src/net.cpp:1071:74: error: too few arguments to function ‘UPNPDev upnpDiscover(int, const char, const char, int, int, unsigned char, int)’ 1071 | devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);

As I read in the other closed issue is not in useful anymore.

I am compiling this because the precompiled emerald-qt from the site is requiring "/Emerald-qt: error while loading shared libraries: libminiupnpc.so.10: cannot open shared object file: No such file or directory" and I prefer to compile it to avoid searching and installing this lib on Fedora.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Crypto-Currency/Emerald/issues/4#issuecomment-695371097 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM3N3LQIFQJGJX4KGL2S73SGVEPRANCNFSM4RTJGCQQ . https://github.com/notifications/beacon/ADM3N3LWSG6BERFSUQJ2TP3SGVEPRA5CNFSM4RTJGCQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFFZIKWI.gif

lvypaul commented 3 years ago

Hi,

Well, I did not wanted the work around so I started to look around and tried to make it work. I am not a programmer so please understand that some of the things that I made it is possible that they are not good at all. Anyway I use openssl 1.1.1g-1.fc30.x86_64 and boost 1.69.0-9.fc30.x86_64 , on rpc I had to remove some extra things to make it work because of changes in boost.

Seems that the code is well forked and modified by other too, most of the code fixes I found on curecoin. I manage to compile it against ssl, still I have to find how to fix an error on main cpp and I used -fpermissive to go fast around it but of course I need to fix it, maybe you can help me with that. And of course, probably because of that I get the crash when I try to encrypt the wallet.

emerald_wallet

so, here is what is changed:

diff -q Emerald_modif/src Emerald/src | grep -v subdirect

Files Emerald_modif/src/bignum.h and Emerald/src/bignum.h differ Files Emerald_modif/src/bitcoinrpc.cpp and Emerald/src/bitcoinrpc.cpp differ Files Emerald_modif/src/crypter.cpp and Emerald/src/crypter.cpp differ Only in Emerald_modif/src: emeraldd Files Emerald_modif/src/key.cpp and Emerald/src/key.cpp differ Files Emerald_modif/src/makefile.unix and Emerald/src/makefile.unix differ Files Emerald_modif/src/script.h and Emerald/src/script.h differ

main.cpp: In function ‘void InvalidChainFound(CBlockIndex*)’: main.cpp:1377:103: error: passing ‘const CBigNum’ as ‘this’ argument discards qualifiers [-fpermissive] 1377 if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())

and the thing repeats at:

main.cpp: In function ‘std::string GetWarnings(std::string)’: main.cpp:3150:103: error: passing ‘const CBigNum’ as ‘this’ argument discards qualifiers [-fpermissive] 3150 if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())

It looks like I need to change some variable declaration, I did not do that yet as this is hard to find guidance about it, most probably because it is something very basic in c :)

Also, I saw that diffs can be uploaded very nice in github, If you can provide me some guidance about that once i clean them of comments I can put them up.

Thank you, Paul

lvypaul commented 3 years ago

/usr/bin/ld: build/main.o: in function void boost::this_thread::sleep_for<long, boost::ratio<1l, 1000l> >(boost::chrono::duration<long, boost::ratio<1l, 1000l> > const&)': main.cpp:(.text._ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE[_ZN5boost11this_thread9sleep_forIlNS_5ratioILl1ELl1000EEEEEvRKNS_6chrono8durationIT_T0_EE]+0x66): undefined reference toboost::chrono::steady_clock::now()' collect2: error: ld returned 1 exit status

Adding -lboost_chrono into Makefile

I found also the missing "const" probably my fault. Compiled also with upnp, not sure what that does :)

now I will test it again, see if it crashes or not when using encryption of the wallet.

lvypaul commented 3 years ago

Well, it is staying for a while and exiting when I try to encrypt wallet. I will strace it when I'll have some time for it. For now this is the diff. Please take a look over it.

diff.txt

Spidersbox commented 3 years ago

Yes, openssl is such a pain when they don’t bother to make things backwards compatible. it’s the BigNum that is the major pain in the butt.

after testing thoroughly, you can submit a pull request on github. (make sure you have a current wallet.dat backup 😊 )

Spider

From: lvypaul Sent: Sunday, October 11, 2020 5:53 PM To: Crypto-Currency/Emerald Emerald@noreply.github.com Cc: Spidersbox Spider@Spidersbox.com; Comment comment@noreply.github.com Subject: Re: [Crypto-Currency/Emerald] openssl-1.1 compliance (#4)

Hi,

Well, I did not wanted the work around so I started to look around and tried to make it work. I am not a programmer so please understand that some of the things that I made it is possible that they are not good at all. Anyway I use openssl 1.1.1g-1.fc30.x86_64 and boost 1.69.0-9.fc30.x86_64 , on rpc I had to remove some extra things to make it work because of changes in boost.

Seems that the code is well forked and modified by other too, most of the code fixes I found on curecoin. I manage to compile it against ssl, still I have to find how to fix an error on main cpp and I used -fpermissive to go fast around it but of course I need to fix it, maybe you can help me with that. And of course, probably because of that I get the crash when I try to encrypt the wallet.

https://user-images.githubusercontent.com/71461213/95694441-c2c10c00-0c3a-11eb-9b2a-968e6a7c0c21.png

so, here is what is changed:

diff -q Emerald_modif/src Emerald/src | grep -v subdirect

Files Emerald_modif/src/bignum.h and Emerald/src/bignum.h differ Files Emerald_modif/src/bitcoinrpc.cpp and Emerald/src/bitcoinrpc.cpp differ Files Emerald_modif/src/crypter.cpp and Emerald/src/crypter.cpp differ Only in Emerald_modif/src: emeraldd Files Emerald_modif/src/key.cpp and Emerald/src/key.cpp differ Files Emerald_modif/src/makefile.unix and Emerald/src/makefile.unix differ Files Emerald_modif/src/script.h and Emerald/src/script.h differ

main.cpp: In function ‘void InvalidChainFound(CBlockIndex*)’: main.cpp:1377:103: error: passing ‘const CBigNum’ as ‘this’ argument discards qualifiers [-fpermissive] 1377 if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())

and the thing repeats at:

main.cpp: In function ‘std::string GetWarnings(std::string)’: main.cpp:3150:103: error: passing ‘const CBigNum’ as ‘this’ argument discards qualifiers [-fpermissive] 3150 if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())

It looks like I need to change some variable declaration, I did not do that yet as this is hard to find guidance about it, most probably because it is something very basic in c :)

Also, I saw that diffs can be uploaded very nice in github, If you can provide me some guidance about that once i clean them of comments I can put them up.

Thank you, Paul

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Crypto-Currency/Emerald/issues/4#issuecomment-706799556 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM3N3PAP2GBZBMQTZ2DV4DSKJHP5ANCNFSM4RTJGCQQ . https://github.com/notifications/beacon/ADM3N3OTXWJ7QY4EQPQLHOLSKJHP5A5CNFSM4RTJGCQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFIQOPRA.gif

lvypaul commented 3 years ago

I found these code changes to make backward compatibility:

https://github.com/bitcoin/bitcoin/commit/4a8d0f3b108b8dc42d526779f9068f3e329429b0

But in my case I am going forward and I do not want to revert to ssl 101 :))