Bitcoin Forum
December 04, 2016, 12:13:08 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Testnet ClearCoin  (Read 920 times)
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
April 25, 2011, 02:40:03 PM
 #1

I've deployed a -testnet version of ClearCoin, at:
  https://testnet.clearcoin.appspot.com/

It is fully functional, so feel free to creates some escrow transactions and get some testnet bitcoins from the the testnet faucet (which I will eventually move to testnet.freebitcoins.appspost.com).

For anybody else developing on App Engine, here's what I did to make it work:

In my main.py:
Code:
  # Set testnet namespace                                                                                                               
  if 'test' in os.environ['CURRENT_VERSION_ID']:
    set_namespace('testnet')
CURRENT_VERSION_ID is the version of your app that's running, and is set by App Engine.
set_namespace makes all subsequent datastore and memcache operations read/write from a different database.  So almost all of the code for ClearCoin doesn't care whether it is handling testnet coins, it just works.

The only other change needed was a check for 'test' in os.environ['CURRENT_VERSION_ID'] when deciding which bitcoind server to use.  I run the -testnet bitcoind for ClearCoin on a different machine than the production bitcoind, so experiments on the test net won't affect the production ClearCoin at all.

If you're not running on App Engine, you should think about building in the equivalent of CURRENT_VERSION_ID and 'set_namespace' so deploying test and production versions of your application is easy.

How often do you get the chance to work on a potentially world-changing project?
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
1480810388
Hero Member
*
Offline Offline

Posts: 1480810388

View Profile Personal Message (Offline)

Ignore
1480810388
Reply with quote  #2

1480810388
Report to moderator
xf2_org
Member
**
Offline Offline

Activity: 70


View Profile
April 25, 2011, 07:54:56 PM
 #2

Nice!

I encourage all bitcoin vendors to run a testnet version of their site, if feasible.  For example, PayPal provides a "sandbox" which includes all supported APIs, but no real money is transferred.  When developing sites that deal with money, being able to test without losing real money due to bugs is critical.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!