Bitcoin Forum
June 15, 2024, 11:23:12 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Coin-connecting website framework for sale/ Framework guide  (Read 551 times)
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
February 12, 2014, 08:34:34 PM
 #1

Alot of you guys want to do some kind of e-commerce with various coins but don't have the patience or know-how to do it. Simple. I will sell you my framework (example at minegamble.com). NOTE: my wallets for minegamble are not open at the moment because I am compiling a hefty amount of java code and it lags entirely too much.

I think $50 is a fair price, because to do it yourself you'll have several hours into it.. it's probably more valuable to you to just buy this framework. You'll still have to tweak it but everything works.

The online example I gave you will mostly work, except that i dont have the wallets open at the moment so you wont see any balances.

Or you can follow this halphazard guide to make one.... its probably not worth the time..
...you have to do a bunch of groundwork for it to work, unfortunately.

Connecting to your wallet doesn't work if you are hosting this thing on something like godaddy-- they have the ports blocked you will need. Lame, but thats how it is unless you wanna pay them ALOT for a vps.

This should work fine though-- set up new service at digitalocean.com
create a new droplet- the cheap 5$ / month one should work just fine.

You will need to install quite a bit to make it run.
Install kittehcoin from github on your droplet. (you'll have to familirize yourself with SSH, its not too bad)
using the command (something like this): git clone http://github.com/whatevertherepoisforkittehcoin

before you can do that, of course, youll have to distro upgrade and install all build essential software. It shouldn't be too hard to google, honestly.
If you have any issues, google "digital ocean xpm mining", and do most of the first few steps; that will get you to where you can compile the coin.

when you get to an 'error 4' in the compiling, its a RAM issue.. go back and google "xpm primecoin digital ocean error 4" and in one of the first 3 or 4 links was the instructions of how to correct this.. the 5$ droplet didnt have enough ram and you have to create a swap file

from there youre good to go.

Once you have the coin compilled, you SHOULD be in the ~/kittehcoin/src folder. If not, get there.
from there type ./kittehcoind so that the coin opens and starts downloading the blockchain

then type "vi /root/.kittehcoin/kittehcoin.conf" and that will open an editor so that you can make your conf file. hit the S button to enter text-entry mode. type in your conf data, and hit escape, then type ":x" to save and exit

now your coin is up  and running, and should be able to accept connections on the port you set in the conf file. (you cant test this until the blockchain is downloaded"

from here, you need to download php, mysql, and apache. google is your friend. use apt-get, so that you don't have to build all these from code.
 
using mysql, create a database with one table called users. this table needs 3 columns: username, salt, password.

using php, create a site that can connect to that database. since the database is on the droplet the site will be on, use 127.0.0.1 for the IP address-- much faster (the mysql port is 3306)
make sure that the site has an active connection to the wallet using RPCclient.php(available on github and some other places... look up bitcoin rpc connections on google, youll find it)
basically,  that works like this: 
Code:
<?php include 'rpcclient.php'
    
$meow = new jsonRPCClient('http://CONFUSERNAME:CONFPASSWORD@127.0.0.1:CONFPORT/');

once you have that set up, you can use php  to make calls to the wallet. look up the bitcoin API. it works the same way. for example, to get your balance you do this:
Code:
  $balance = $meow->getbalance;
  echo $balance

sometimes you need data specific to the USER. in that case:
Code:
 $balance -> getbalance($username) ;
 echo $balance;


create an index page, that users can see your site concept. allow logins. The login button should go to login.php
login.php should have a link to register.php in case they are not registered. login.php takes the input password, looks to the matching input username in the database, pulls the SALT that matches it. Then it takes the password and appends it with the salt, so it would look like "passwordSALT", and encrypts it, then makes sure the encrypted value matches the one in the database. if not, the user is not logged in. if so, it creates a session cookie (google it)

registration.php does a few important things:
takes the username and password, and generates a random salt. creates a variable with the salt, password, encrypted salted password (like above). stores these in the database.
then it does THIS:
Quote
$meowwallet = $meow->getnewaddress($username);

this creates an account for the user inside your wallet. anything they upload there they should be allowed to withdrawal instantly. make a withdrawal page for this.

moving funds back and forth is easy and theres no transaction fee
if a logged in user buys something for, say, 2000 MEOW, you firstly store the transaction amount in a variable, then move the money, like this:
Code:
$amount = 2000
$meow->move($sendfromaddress, $sendtoaddress, $amount)
Or in this case:
Code:
$meow->($username, $MASTER, $amount)
This moves their 2000 into your balance, making it untouchable to the user. its yours now.

for a withdrawal, use this:
Code:
$trans = $meow->sendfrom($username,$send_to,$w_amount);
echo $trans

this sends money from the logged in users account to the address they put in an html field, and the 3rd argument is the amount of the withdrawal, also from an html text field.
because this method returns a transaction id, we want to echo that to the user, which we did below.



Alternatively, I could save you the programming aspect of it. I can sell you a bundle that includes the RPC client, login session, index page, logged in index page, navigation, withdrawal page, and anything else needed, and all youll have to do is edit them down a bit to custom fit your solution. For example, make a new page for each product, and add it to the navigation.. which is literally copy and paste.

youll still need to make a database, and add that to the db_new.php file to get the connection.

Your call. This could take you several hours to write the programming. Alternatively, I would be willing to go around 50$... you'll probably find it alot easier this way.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!