Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Possible log in to this forum with BTS id?  (Read 814 times)

0 Members and 1 Guest are viewing this topic.

Offline abit

Possible log in to this forum with BTS id?
« on: January 14, 2015, 02:02:24 PM »

Just an idea, don't know whether others asked yet.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12277
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Possible log in to this forum with BTS id?
« Reply #1 on: January 14, 2015, 02:40:07 PM »
Gamey has a working plugin running at bitnation.org or so ...


//edit: url: http://bitsharesnation.org/
« Last Edit: January 14, 2015, 02:52:11 PM by xeroc »
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline islandking

  • Sr. Member
  • ****
  • Posts: 378
  • The king of the island
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #2 on: January 14, 2015, 02:50:19 PM »
You could always ask bitsapphire if they can add it to the forum. Gamey already has a plugin.
I've been working on a new electronic cash system that's fully peer-to-peer, with no trusted third party. - Satoshi

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #3 on: January 14, 2015, 04:15:11 PM »
It is pretty much done but the plugin included a work-around for a bug that was in the wallet.  I am waiting for a new release of the wallet.  (or I could test the site off devshares I suppose.. ).  I wanted to remove that work-around in the plugin and have it as polished as possible.  I'll be messing with it over the next few days too as I want to wrap that project up but I'm waiting on a fixed wallet.  I also posted on the simplemachines forum for advice a couple days ago ..

So it is more or less completed, but it is a security plugin that does authentication so I've been quite slow and deliberate.  It sounds cool and all to throw it up but then if it was to start messing with people's SMF experience then that would not be good.  Also security breaches of the authentication type can't be rewound like a blockchain fix.  IMO always delete sensitive messages on the forum.
« Last Edit: January 14, 2015, 04:18:58 PM by gamey »
I speak for myself and only myself.

Offline sudo

  • Hero Member
  • *****
  • Posts: 2233
    • View Profile
  • BTS: ags
Re: Possible log in to this forum with BTS id?
« Reply #4 on: January 14, 2015, 04:57:20 PM »
 +5%

Offline abit

Re: Possible log in to this forum with BTS id?
« Reply #5 on: January 23, 2015, 01:28:18 PM »
It is pretty much done but the plugin included a work-around for a bug that was in the wallet.  I am waiting for a new release of the wallet.  (or I could test the site off devshares I suppose.. ).  I wanted to remove that work-around in the plugin and have it as polished as possible.  I'll be messing with it over the next few days too as I want to wrap that project up but I'm waiting on a fixed wallet.  I also posted on the simplemachines forum for advice a couple days ago ..

So it is more or less completed, but it is a security plugin that does authentication so I've been quite slow and deliberate.  It sounds cool and all to throw it up but then if it was to start messing with people's SMF experience then that would not be good.  Also security breaches of the authentication type can't be rewound like a blockchain fix.  IMO always delete sensitive messages on the forum.
@gamey any update? New wallet has been released.  :)
Thanks.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline sudo

  • Hero Member
  • *****
  • Posts: 2233
    • View Profile
  • BTS: ags
Re: Possible log in to this forum with BTS id?
« Reply #6 on: January 23, 2015, 03:57:17 PM »
 +5%

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #7 on: January 23, 2015, 08:03:13 PM »
I've done most of the research for last few issues so I'll be finishing it up in the next few days (end of weekend). (It already is finished).. but..then last round of testing when it is code complete.

It was updated/tested for the latest wallet.

I do have one problem where apache is binding to localhost at the same port and preventing the wallet from connecting.  So it took me shutting down apache and waiting and then starting them up in order.  I have no clue why using a curl-php5  would do this.  I guess I don't understand tcpip ?  Regardless it isn't really acceptable because if the wallet dies, a wallet restart won't work because it fails to bind to that port.  I've read all the curl lib options etc and nothing makes sense except that I don't understand tcpip as well as I thought.  I doubt it'd be a problem if everything wasn't using localhost. 
I speak for myself and only myself.

Offline btswildpig

  • Hero Member
  • *****
  • Posts: 1424
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #8 on: January 23, 2015, 08:13:50 PM »
I've done most of the research for last few issues so I'll be finishing it up in the next few days (end of weekend). (It already is finished).. but..then last round of testing when it is code complete.

It was updated/tested for the latest wallet.

I do have one problem where apache is binding to localhost at the same port and preventing the wallet from connecting.  So it took me shutting down apache and waiting and then starting them up in order.  I have no clue why using a curl-php5  would do this.  I guess I don't understand tcpip ?  Regardless it isn't really acceptable because if the wallet dies, a wallet restart won't work because it fails to bind to that port.  I've read all the curl lib options etc and nothing makes sense except that I don't understand tcpip as well as I thought.  I doubt it'd be a problem if everything wasn't using localhost.

what's the number of the port ?
这个是私人账号,表达的一切言论均不代表任何团队和任何人。This is my personal account , anything I said with this account will be my opinion alone and has nothing to do with any group.

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #9 on: January 23, 2015, 08:20:55 PM »
I've done most of the research for last few issues so I'll be finishing it up in the next few days (end of weekend). (It already is finished).. but..then last round of testing when it is code complete.

It was updated/tested for the latest wallet.

I do have one problem where apache is binding to localhost at the same port and preventing the wallet from connecting.  So it took me shutting down apache and waiting and then starting them up in order.  I have no clue why using a curl-php5  would do this.  I guess I don't understand tcpip ?  Regardless it isn't really acceptable because if the wallet dies, a wallet restart won't work because it fails to bind to that port.  I've read all the curl lib options etc and nothing makes sense except that I don't understand tcpip as well as I thought.  I doubt it'd be a problem if everything wasn't using localhost.

what's the number of the port ?

57133.
I speak for myself and only myself.

Offline abit

Re: Possible log in to this forum with BTS id?
« Reply #10 on: January 24, 2015, 12:59:18 AM »
I do have one problem where apache is binding to localhost at the same port and preventing the wallet from connecting.  So it took me shutting down apache and waiting and then starting them up in order.  I have no clue why using a curl-php5  would do this.  I guess I don't understand tcpip ?  Regardless it isn't really acceptable because if the wallet dies, a wallet restart won't work because it fails to bind to that port.  I've read all the curl lib options etc and nothing makes sense except that I don't understand tcpip as well as I thought.  I doubt it'd be a problem if everything wasn't using localhost.
I'm not sure if it's a curl-php5 problem.. Maybe set different ports for apache and the wallet will work.
Could you post your apache config files here?
And the command line you starting your wallet, and the config.json of your wallet?
And the code how you're using curl-php?
Reminder: don't set CURLOPT_LOCALPORT or set it to a different value in curl-php.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #11 on: January 24, 2015, 01:56:02 AM »
I do have one problem where apache is binding to localhost at the same port and preventing the wallet from connecting.  So it took me shutting down apache and waiting and then starting them up in order.  I have no clue why using a curl-php5  would do this.  I guess I don't understand tcpip ?  Regardless it isn't really acceptable because if the wallet dies, a wallet restart won't work because it fails to bind to that port.  I've read all the curl lib options etc and nothing makes sense except that I don't understand tcpip as well as I thought.  I doubt it'd be a problem if everything wasn't using localhost.
I'm not sure if it's a curl-php5 problem.. Maybe set different ports for apache and the wallet will work.
Could you post your apache config files here?
And the command line you starting your wallet, and the config.json of your wallet?
And the code how you're using curl-php?
Reminder: don't set CURLOPT_LOCALPORT or set it to a different value in curl-php.

There are no ports for apache.  Just database settings that are fed into curl.  I'm not going to go through basic IT support but I will look at that setting.
...
Ahh wow.  I went through full list of curl options looking for that because my theory is that the local port is defaulting to the destination port which would match up the 4tuple if ports/ips. So I looked through settings and for whatever reason didn't see it.  I made a list of possible curl options to inspect but I missed the one I needed.  I suspect the above option will fix it as it was what I was looking for to begin with, so thank you for your input !
I speak for myself and only myself.

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #12 on: January 24, 2015, 01:59:39 AM »
Actually the reason I didn't find that is because you linked me to C code.  My code is the standard php curl lib that you get when you install php5-curl or whatever it is.

It uses easybitcoin which is a real simple php lib that uses __call or whatever it is to overload the class into rpc calls.  You can google and find it.  If I remember I'll grep through file system for that port #, but.. its just a random port.
« Last Edit: January 24, 2015, 02:01:38 AM by gamey »
I speak for myself and only myself.

Offline abit

Re: Possible log in to this forum with BTS id?
« Reply #13 on: January 24, 2015, 04:16:16 AM »
CURLOPT_LOCALPORT has a random value by default. I checked the easybitcoin code and didn't find the option, so it should be ok.

Are you sure the port is bond by apache, but not the wallet itself (or previous instance of the wallet)? Is the problem only happens when restarting the wallet? In my Linux box, after a wallet quits, the ports will still be unavailable for some time (2 minutes by default), with some connections remain 'TIME_WAIT' state. You can check it with 'netstat -an | grep YOUR_PORT'. I don't know if it's a bug of the wallet or it's a feature of Linux though (whether the wallet properly closes all connections before quit). If it's a feature of Linux, it's possible to tweak via 'sysctl' utility:
Code: [Select]
sysctl net.ipv4.tcp_tw_reuse = 1
sysctl net.ipv4.tcp_tw_recycle = 1

EDIT:
Be careful while tweaking kernel options. It may cause other problems occasionally.

EDIT again:
If you have iptables/netfilter loaded into the kernel, you may have interest to try:
Code: [Select]
sysctl net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1
It means every connection will stay in 'TIME_WAIT' state for only one second. Again, be careful.

Another solution could be wait for 2 minutes after the wallet quits, before a restart.
Or change the listening port number every time (and let the php program know it).

BTW does anybody know whether it's necessary for the wallet to check connections in TIME_WAIT state before bind/listen to the port?
« Last Edit: January 24, 2015, 04:56:05 AM by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: Possible log in to this forum with BTS id?
« Reply #14 on: January 24, 2015, 04:46:42 AM »
CURLOPT_LOCALPORT has a random value by default. I checked the easybitcoin code and didn't find the option, so it should be ok.

Are you sure the port is bond by apache, but not the wallet itself (or previous instance of the wallet)? Is the problem only happens when restarting the wallet? In my Linux box, after a wallet quits, the ports will still be unavailable for some time, with some connections remain 'TIME_WAIT' state. You can check it with 'netstat -an | grep YOUR_PORT'. I don't know if it's a bug of the wallet or it's a feature of Linux though (whether the wallet properly closes all connections before quit). If it's a feature of Linux, it's possible to tweak via 'sysctl' utility:
Code: [Select]
sysctl net.ipv4.tcp_tw_reuse = 1
sysctl net.ipv4.tcp_tw_recycle = 1

EDIT:
Be careful while tweaking kernel options. It may cause other problems occasionally.

I do appreciate your indepth checking because I'm a bit of a loss how to fix it properly... but I was thinking this over dinner and I'll probably just leave it alone after recreating it again and making sure.  I need to ask itnom if the wallet will run on the same machine.  I imagine it won't, but I really don't know. 

Yes it is apache. I use a command lsof to match up open file handles to processes.  There is another problem where the wallet had the ports locked up by the OS after quitting but it isn't the problem.  My problem has only happened once, I just realized how annoying it is because even when I stopped apached the port was not immediately available.  So if the wallet dies and tries to bind to that port and there is this weird race condition where the easybitcoin php lib keeps it from binding... then wallet can never start. THere is also a chance that the options for the socket creation in the wallet constrain it too much. It has to be fixed in php but if there were other suggestions to put in the readme file.. that could be considered a solution, but this is a php project that interacts with RPC and SMF.

I have a list of php options that might would fix it in a different manner, but it really isn't a show stopper.  Just a bit puzzling.  Anyway, it will likely just be made an issue on github and i'll consider it done.
« Last Edit: January 24, 2015, 04:49:50 AM by gamey »
I speak for myself and only myself.

 

Google+