Giter Club home page Giter Club logo

bitcoin-central's Introduction

Bitcoin Central

Bitcoin Central powers bitcoin-central.net, a bitcoin trading platform. It is :

  • Open Source,
  • Based on Ruby on Rails,
  • Fully localizable,
  • Multi-currency.

Installation

Linux and Windows setup work well, I found the easiest to be an Ubuntu install

Windows

Linux (Debian flavors)

  • Install required packages

      $ sudo apt-get install ruby ruby-dev libssl-dev irb rubygems mysql-server libmysql++-dev build-essential git-core
    
  • Add gem binaries to path and re-login

      # I simply add this at the end of /etc/bash.bashrc (feel free to point out a cleaner way)
      PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin"
    

Common

  • Install the bundler rubygem, it will easily manage and compile all the other dependencies

      $ sudo gem install bundler
    
  • Fork project if relevant

  • Check out sources with git

      $ git clone https://github.com/davout/bitcoin-central.git
    
  • Get into the sources directory

      $ cd bitcoin-central
    
  • Compile and install the required dependencies

      $ bundle
    
  • Log-in to MySQL console and run the following commands. If you are installing a production machine you'll obviously need to pick different credentials. Update the config/database.yml file accordingly.

      > CREATE DATABASE `bitcoin-bank_development`;
      > GRANT ALL PRIVILEGES ON `bitcoin-bank_development`.* TO 'rails'@'localhost' IDENTIFIED BY 'rails';
    
  • Run a couple of rake tasks (omit the RAILS_ENV option if you're setting up a development environment, Rails will grab the database configuration in the config/database.yml file under the right section (development, test, or production)

      $ rake db:migrate RAILS_ENV=production
    
  • Edit config/bitcoin.yml to be able to connect your instance to a bitcoin client, the config/bitcoin.yml file contents are self-explanatory, just add a production section if you're deploying on a production server.

  • You're good to go! Run the rails server

      $ rails s
    

Your fresh instance should now be running on http://localhost:3000/ !

Production deployment

Usually, Rails applications are deployed in production using nginx or Apache, I'll introduce the Apache option.

The capistrano tool is used to automate pretty much every deployment step. Deploying a new version is as easy as typing cap deploy in your local command prompt.

To use the cap sweetness a couple of extra steps are required :

  • You'll need to fork the project since all your deployment configuration is stored in config/deploy.rb, these configs are pulled directly from GitHub when deploying, so go for it, change them to suit your needs.
  • Set the remote machine up by typing cap deploy:setup
  • Log in to the remote machine and create the production configuration files in {APP PATH}/shared/config/*.yml, they will be used in production (you don't want your production passwords hanging around on GitHub do you ?)
  • Create the remote DB
  • Now you can run locally cap deploy:migrations, this will update the remote sources and run the migrations on the remote database
  • Now you just need to install the passenger gem on the remote server which will install an apache module
  • Create an apache virtual host and you're good to go.

You'll just need to issue a cap deploy locally for any subsequent deployment.

Contributions

All are welcome, improvements, fixes and translations (the string extraction bounty has been paid).

  • The use of the Numeric#to_f method is big no-no, every single numeric that passes through the code should be typed as BigDecimal,
  • Bugfixes should include a failing test,
  • Pull requests should apply cleanly on top of master, rebase if necessary

Music

Bitcoin-Central was, and is currently being developed with the following musical background :

License

AGPL License. Copyright 2010-2011 David FRANCOIS

bitcoin-central's People

Contributors

ptmhd avatar voirgag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoin-central's Issues

Implement automated checks

  • Check that the bitcoin client balance is >= to the sum of all bitcoin balances
  • Same for Liberty Reserve
  • Check that BC balances are equal to those reported by the bitcoin client

Split trade orders if necessary

Right now, orders are inactivated if the user has insufficient balance to complete them.
Instead, orders should be splitted in a part that can be honored with the current balance and an inactivated one.

Pop-up upon successful transfer

Somehow transfer notifications should be pushed to the client in order to display a pop-up when an incoming transfer is detected server-side

Wallet backup

Allow users to download an encrypted wallet backup, in case of server failure any user can send his latest backup.

Rake task + cron job for periodic wallet backup to email, FTP etc.

The keypool should be massively increased in order to account for increased address generation due to shared wallet.

Discussion on rounding

[23:53] #bitcoin-otc> it quacks? it's a fucking duck
[23:54]  Round actual btc amount bought down then if it is a buy, and currency up if it is a sale?
[23:54] #bitcoin-otc> sturles: then people will complain i'm stealing them
[23:54] #bitcoin-otc> i'm curious to find a cheating use case
[23:54] #bitcoin-otc> evan: wtf are you talking about?
[23:54]  But you are not -- it is just to the other partys advantage, so it is impossible to cheat on rounding.
[23:55]  davout: nothing
[23:55] #bitcoin-otc> yea, but won't some people end up getting charged more than they actually have on their account ?
[23:56]  I don't think anyone will complain about the fifth decimal.  Perhaps when one BTC is worth USD 100, if that ever happens.
[23:56] #bitcoin-otc> hmm
[23:56] #bitcoin-otc> evan: elaborate
[23:57]  Not i you round down the amount they are getting.  If A bought 0.00001 BTC and have 0 USD on the account, the user should get 0 BTC.
[23:58] #bitcoin-otc> sturles: that can't happen
[23:58] #bitcoin-otc> trade orders are checked before getting executed, you can't enter an order that goes over your buying power at the given ppc
[23:58] #bitcoin-otc> you have 10 lrusd
[23:58] #bitcoin-otc> you can enter
[23:59] #bitcoin-otc> buy 100 btc @ 0.1
[23:59] #bitcoin-otc> but not 100 btc @ 0.100000001
[23:59] #bitcoin-otc> it won't let you
[23:59]  If A has any amount of LR, he can buy 0.00001 BTC at 0.299999 and pay nothing.  For nothing he should get 0 BTC.
[00:00]  arbitrage trading between mtgox and bitcoin-central promises to be fun, if we need 10 minutes to get tx confirmations
[00:01] #bitcoin-otc> you need 3 confirmations before being able to use your funds on BC
[00:01]  And he can buy 1.00001 BTC for 0.299999, and get the 0.00001 BTC for free.
[00:01] #bitcoin-otc> have fun doing arbitrage :)
[00:01] #bitcoin-otc> sturles: that's interesting
[00:02] #bitcoin-otc> sturles: i'm going to copypaste your last bits, stuff it all in a github issue and look at it when my brain is not on screensaver :)

Session time-outs

Show time out before auto-logout (see Liberty Reserve)
Decide and implement a default time out.

Allow users to forbid sessions to remember them after the browser is closed.

Functional logs

Implement a functional log level :
Account XXX : Added X LREUR

etc

Truncate LR withdrawals precision to 2 decimal places

It seems that people withdrew X.XXYYY getting only XX.XX sent to them and 0.00YYY being lost in limbo.

Needs some more investigation, but there might be a little problem here.

Doesn't look like a vulnerability though.

Donation accounts

Allow accounts to have an auto market sell for incoming BTC transfers.

Allow auto-forward to an address.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.