Bitcoin Forum

Bitcoin => Project Development => Topic started by: Zen00 on February 06, 2014, 02:32:15 AM



Title: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 06, 2014, 02:32:15 AM
Hey all, it's time for me to unwrap this project I've been working on for the last couple weeks. Having just recently begun working with the MPOS dev team, this has been a great way for me to stretch my abilities and learn new ways of thinking about PHP.


OpenFaucet
The open source coin faucet implementation!
http://i7.photobucket.com/albums/y269/Zen00/openfaucet/index_zps209a6cf9.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/index_zps209a6cf9.png.html)



Source
 (https://github.com/Zen00/openfaucet)

OpenFaucet is the culmination of a desire I've had since I first ran across a Bitcoin faucet many years ago. When I saw that people were actually giving away coins to people for nothing, it really sparked that charity button in me. I like giving things away, and do so whenever I have something to spare. It makes me feel good, and helps those I give to. Now you have the opportunity to share in that feeling as you too can give coins to friends, families, and anyone else on a fair and even distribution over a time span you set.

You may notice some similarities between this implementation and PHP-MPOS. That is because I built this site using the code from PHP-MPOS, and it shows in the amount of legacy code still sitting in the project, but more on that latter. I have taken screenshots of all parts of the website (12 in total) and a walk through of all the features is to be found in the break. Most of what is to be seen is placeholders that will be updated throughout the coming week, as the faucet itself is currently fully functional I will be taking time to work on appearances.








***************************************************************

The page in the main screenshot above is the index.php or home page for non-logged users. This is what people will see who are not registered for the website, which should be everyone except the site admin.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/home_zps31474e4c.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/home_zps31474e4c.png.html)


Once logged in, the admin will see the home page along with the administration bar.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/wallet_zps9a497da6.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/wallet_zps9a497da6.png.html)


Here the admin can see their wallet balance and information. Unfortunately the visible coins are all testnet coins, sadly I do not have 1000+ litecoin, maybe someone out there can rectify that for me. :P

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/transactions_zps88fab8a3.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/transactions_zps88fab8a3.png.html)

Transactions are all kept so that you can see how visitors your site is getting.


http://i7.photobucket.com/albums/y269/Zen00/openfaucet/templates_zpsa5ceddbc.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/templates_zpsa5ceddbc.png.html)

Templates are easily editable through the web interface, though this is a feature I'm considering removing as it's not practicable for any serious developer anyways.


http://i7.photobucket.com/albums/y269/Zen00/openfaucet/pool_zps3a39f283.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/pool_zps3a39f283.png.html)

An optional about page where you can enter information about your coin for visitors to see and learn.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/monitoring_zpsbec19e75.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/monitoring_zpsbec19e75.png.html)


Monitor your crons, which are up, down, and around.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/news_zps09298918.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/news_zps09298918.png.html)


News can be posted just like in MPOS.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/settings_zpsdbd471d5.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/settings_zpsdbd471d5.png.html)


Settings can also be changed as needed through this panel.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/edit_zps12c03c5d.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/edit_zps12c03c5d.png.html)


Additional account settings can be changed as needed.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/contactform_zpsf66701bf.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/contactform_zpsf66701bf.png.html)


A contact form (optional) which users can use to let you know if there is a problem.

http://i7.photobucket.com/albums/y269/Zen00/openfaucet/dashboard_zps0d0c8a5d.png (http://i7.photobucket.com/albums/y269/Zen00/openfaucet/dashboard_zps0d0c8a5d.png.html)


Your main dashboard, mainly for letting you know if there are any errors and if anyone other than you has logged in.

***************************************************************










What can you do to help?

As this project is only just entering open alpha testing, help with the following would be greatly appreciated. You can chat with me live in the #mpos-dev irc channel, just send me a PM at any time, though if I'm asleep a response is not guaranteed right away.

Critical Priority
  • Build a better repeat user detection system, currently the site relies on IP logging, but that is easily spoofabal.
  • Remove legacy code that is not needed for site functionality
High Priority
  • Prepare features for users such as warning messages that help guide along
  • Undock from PHP-MPOS such that OpenFaucet uses its own database and variables
Low Priority
  • Unify code style
  • Typo fixing, css fixes

Future plans:


Once the project is completely independent, the goal is to then refold it back into MPOS as a separate optional plugin for pool owners, such that a portion of their proceeds can be routed into funding the faucet.


If you find this project has been useful to you and your coin, I do accept donations at this address for LTC, a portion of all donations are routed back into running my own faucet.

LUdR1pN1M3eCpi2Gb1DKDzJhzmgqsGiZKk


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: super3 on February 06, 2014, 04:32:37 AM
Source?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 06, 2014, 04:42:09 AM
Source?

Doh!


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: RGBKey on February 06, 2014, 04:43:47 AM
Wow, this is a great contribution to the community. Thank you alot for the work you put into this.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 06, 2014, 05:07:21 AM
Wow, this is a great contribution to the community. Thank you alot for the work you put into this.
zens a great user and is amazing a contributing!
This is a great step for the community as a whole,
are the current reqs the same as mpos for running the system,?




No, you can run this implementation on much leaner hardware as it completely eliminates stratum and the huge amount of database calls required under it for things like stats and user account information.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: maco on February 06, 2014, 06:35:16 AM
I want to get one of these up and running for 42 some day. :P


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 06, 2014, 09:06:43 PM
Just pushed a new update that will break everything. This update creates a new database, cuts out unused classes, finalizes a lot of presets, updates the config file, and more! Also it's guaranteed to not be working for at least another 8 hours until I've had time to debug it thoroughly.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Voodah on February 07, 2014, 06:02:42 AM
Pretty cool. Let us know when it's fixed !


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 07, 2014, 09:35:24 AM
Pretty cool. Let us know when it's fixed !

It's working, but somehow I killed templates for logged in users, and admin authentication. I'll figure it out eventually though.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 07, 2014, 07:48:27 PM
Got templates back up, there are still a few bugs to work out though, but for the most part everything seems to be working again, just some annoying error messages and displays that don't query right yet.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 07, 2014, 09:17:20 PM
Transaction page is now back to normal, just need to work on the monitoring page to have everything up and running.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 14, 2014, 10:15:38 PM
I'm just curious how this is coming along. I'm currently looking for a good faucet software and there is a need for this.

I did get the latest git and am having issues with it working. I edited the global.inc.dist.php accordingly and then figured out I needed to rename it to global.inc.php but now all I get is a blank index.php page.

Any more instructions for setup would be great. Thanks for the work!


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 15, 2014, 05:47:43 AM
I'm just curious how this is coming along. I'm currently looking for a good faucet software and there is a need for this.

I did get the latest git and am having issues with it working. I edited the global.inc.dist.php accordingly and then figured out I needed to rename it to global.inc.php but now all I get is a blank index.php page.

Any more instructions for setup would be great. Thanks for the work!


Instructions are identical to those for setting up MPOS, minus the stratum mining portion.

Check your Apache error logs, the reason for your blank page is to be found in there.

The software works, though I would like some more help to do the debugging and fixing as really I need to be looking for a job of my own, I'm not really making any money doing this.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 15, 2014, 03:28:53 PM
I'd be happy to help you debug. I am experiencing the blank page still after redoing the install from the ground up. I followed the MPOS instructions excluding the stratum section so I hope I'm not missing something really simply.

First, you need to update the 000_base_structure.sql file. There is a syntax error preventing the final table creation. Remove the last comma from the syntax KEY `type` (`type`),.

Code:
CREATE TABLE IF NOT EXISTS `transactions` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `type` varchar(25) DEFAULT NULL,
  `coin_address` varchar(255) DEFAULT NULL,
  `amount` double DEFAULT '0',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `txid` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8

becomes

Code:
CREATE TABLE IF NOT EXISTS `transactions` (
  `id` int(255) NOT NULL AUTO_INCREMENT,
  `type` varchar(25) DEFAULT NULL,
  `coin_address` varchar(255) DEFAULT NULL,
  `amount` double DEFAULT '0',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `txid` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Also, the blank page is providing the error:
Quote
PHP Fatal error:  Call to undefined method mysqli_stmt::get_result() in /var/www/openfaucet/public/include/classes/setting.class.php on line 16.

I'm not sure what this means. Any help is appreciated.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 17, 2014, 03:05:22 PM
Alright, I updated that SQL typo you found and updated the settings class to the latest version, however I'm not having that issue you're having, so no idea what may be causing it. Maybe the update will fix it for you. As far as it goes, the statement referred to is a MySQLi statement, so it could be possible I messed something up, or possibly that you have the wrong user info somewhere in your config file, maybe you're using a none-admin account for your table?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: ciocgun on February 19, 2014, 12:01:52 AM
i got the same error,

first time i've to set up my config file and rename it and run sql on database?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 19, 2014, 03:46:23 AM
Yea no dice for me. I get the same error after updating and also starting with a clean install.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 19, 2014, 06:43:40 PM
So since I don't have this issue with my server which was already being used for other things, I'm going to start with a clean server as well to see if I can find the root of your issues.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: ahmedjadoon on February 19, 2014, 07:04:48 PM
Great contribution this is!


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 22, 2014, 12:25:22 AM
Okay, for all you people out there who have had trouble. I just went through the entire setup process with a fresh install of Ubuntu Server 12.0.4 and here are my findings.

You need to remember to install all dependencies, namely these ones in particular.

Code:
apt-get install php5-mysqlnd php5-curl build-essential libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev git

Additionally you need to remember to set file permissions, own your public folders with the Apache file group, www-data, and make your logging directory writable, for testing purposes I just 777'd all the files and folders, never do that on a production site. See MPOS setup for more information.

Code:
chown www-data public/templates/compile public/templates/cache logs


Also remember to update to the latest version of all things with apt-get update/upgrade.

This should clear up any errors you're having, if you experience any other errors, well let me know as usual.


And thanks to those who found bugs for this project and reported them.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: maco on February 22, 2014, 08:25:34 AM
I just want to give my review of Zen00 for the community to find out what type of guy he is.

Zen00 is dedicated to the success of any coin, without him worrying about his pockets or constantly asking for bounties. He has been proactive and making new updates and backing up his word with his new open source faucet because he really believes in himself. He is even humble enough to push updates without much crypto coins trying to jump on his software. Zen00 is a go getter.

If any crypto currency wants an official or even community driven (adopters) faucet hosted on your domain without worrying about being scammed by a third party faucet holder, or virus driven site filled with ads that can potentially hurt you and your community, this is the right faucet to go to. Not only is this project open source (we all love that) the best part is -- Zen00 is here to back you up through the entire process. I see a big window of opportunity for many crypto currencies to use his software, and I for one, am a big 42 coin adopter, and would like to get this faucet updated on 42 coin very soon, and any of my other adoptions.

He is worth being paid bounty!  Zen00 please post your 42 Coin Address here or pm me that info. I'll donate to you.

I haven't fully installed it on the site yet but I want to make sure others know about you and you are paid for your
efforts to help the crypto currency industry. I'll make a donation on behalf of the Bitcointalk (Crypto) community now.



Okay, for all you people out there who have had trouble. I just went through the entire setup process with a fresh install of Ubuntu Server 12.0.4 and here are my findings.

You need to remember to install all dependencies, namely these ones in particular.

Code:
apt-get install php5-mysqlnd php5-curl build-essential libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev git

Additionally you need to remember to set file permissions, own your public folders with the Apache file group, www-data, and make your logging directory writable, for testing purposes I just 777'd all the files and folders, never do that on a production site. See MPOS setup for more information.

Code:
chown www-data public/templates/compile public/templates/cache logs


Also remember to update to the latest version of all things with apt-get update/upgrade.

This should clear up any errors you're having, if you experience any other errors, well let me know as usual.


And thanks to those who found bugs for this project and reported them.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 22, 2014, 03:32:13 PM
Found 2 new critical bugs in the crons which would cause them to fail. Please update now to have working crons. Also, remember to set your crons .sh files as executable.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 22, 2014, 04:13:26 PM
I'm still getting the same error in the setting.php

Code:
PHP Fatal error:  Call to undefined method mysqli_stmt::get_result() in /var/www/openfaucet/public/include/classes/setting.class.php on line 16

I'm wondering if there needs to be some values in the DB or it's returning no values for tcertain tables. Would you be able to provide a dump of your test DB so I can import those values and test with them?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 22, 2014, 04:26:24 PM
I'm still getting the same error in the setting.php

Code:
PHP Fatal error:  Call to undefined method mysqli_stmt::get_result() in /var/www/openfaucet/public/include/classes/setting.class.php on line 16

I'm wondering if there needs to be some values in the DB or it's returning no values for tcertain tables. Would you be able to provide a dump of your test DB so I can import those values and test with them?

That error is specifically caused by not installing php5-mysqlnd and php5-curl. Try reinstalling them and updating.

The specifics being that get_result() is a mysqlnd function and if you haven't installed mysqlnd properly it will not be able to be called, resulting in a undefined method. It has nothing to do with the DB in general.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 22, 2014, 05:27:02 PM
OK I'll give that another shot.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: squiggie on February 24, 2014, 12:19:01 AM
Well that worked! I'm not sure why it didn't work when I specified the dependencies below.

Code:
apt-get install php5-mysqlnd php5-curl build-essential libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev git

I did have an issue with libboost-all-dev so perhaps that prevented php5-mysqlnd for some reason.

So now it's working but I have another stupid question. How do you access the admin section? Did I miss how to do that?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 24, 2014, 01:31:39 AM
You'll need to register.

index.php?page=register
index.php?page=login


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: JTeam on February 24, 2014, 03:56:05 PM
Zen - this is amazing! We've been praying to find some good open faucet software.
Thank you!

You'll be getting some LTC your way soon. For the MPOS wiki and this.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 24, 2014, 08:09:50 PM
Currently working on integrating bootstrapping, new security checks, and other major changes right now.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Bitcoin_Mafia on February 25, 2014, 02:55:12 PM
What cryptocurrencies will this support? I can't wait for the roll-out...it sounds EXACTLY like what I've been looking for.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on February 25, 2014, 11:09:22 PM
What cryptocurrencies will this support? I can't wait for the roll-out...it sounds EXACTLY like what I've been looking for.

It will support all currencies with standard JSONRPC calls.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Zen00 on March 09, 2014, 12:42:25 AM
Security update is live on branch Security-Test. Check it out and let me know if you find any bugs.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: vual on April 13, 2014, 06:32:27 AM
Any news when we may see this implemented into MPOS ?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: somic on April 13, 2014, 11:24:47 AM
OpenFaucet: The open source coin faucet implementation!

where is the source?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: Bitcoin_Mafia on April 30, 2014, 01:08:55 PM
Dumb question - where do I put the cronjob files?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: ahmedjadoon on April 30, 2014, 01:46:50 PM
OpenFaucet: The open source coin faucet implementation!

where is the source?
Here is source https://github.com/Zen00/openfaucet


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: ahmedjadoon on April 30, 2014, 01:47:04 PM
Dumb question - where do I put the cronjob files?
No idea.
It would be great if someone posts a manual how to start a faucet for certain Crypto using this script.How to configure etc!


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: JedWafu on July 28, 2014, 07:11:38 AM
is this project still pursuing? Thanks for the great contribution!


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: milly6 on March 01, 2016, 08:47:34 PM
is this project still pursuing? Thanks for the great contribution!

Any fork of this project out there? Reliable?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: wdnj on March 02, 2016, 01:51:02 PM
What cryptocurrencies will this support? I can't wait for the roll-out...it sounds EXACTLY like what I've been looking for.

It will support all currencies with standard JSONRPC calls.
Is this software under development or complete project? is there setup, install guide on Debian7.

     


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: tyz on March 03, 2016, 08:30:46 PM
@Zen00: Thanks for releasing this peace of software open source. I decided to use it (over faucetbox) for my crypto blog.
I let you know when I have it integrated into Wordpress.


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: BellaBitBit on March 04, 2016, 04:50:29 AM
Great project, you have put a lot of thought into it and the features are very thorough. Do you still need someone to look at CSS?


Title: Re: OpenFaucet: The open source coin faucet implementation!
Post by: TheGrimm on March 04, 2016, 05:03:37 AM
This project looks like it was last updated 2 years ago, I highly recommend no one use it until the php is audited, no one knows if there are anymore security risks and looks like OP is not updating it.