bitcoin-faucet
所属分类:加密货币
开发工具:JavaScript
文件大小:3KB
下载次数:0
上传日期:2015-06-03 13:56:01
上 传 者:
sh-1993
说明: 一个Node.js应用程序,可以轻松创建一个可编程的比特币测试网水龙头。这使您可以轻松测试您的比特币应用程序...
(A Node.js app to easily create a programmable Bitcoin Testnet faucet. This allows you to easily test your Bitcoin applications.)
文件列表:
CHANGELOG.md (277, 2015-06-03)
index.js (2875, 2015-06-03)
package.json (917, 2015-06-03)
Bitcoin Faucet
==============
A Node.js app to easily create a programmable Bitcoin Testnet faucet. This allows you to
easily test your Bitcoin applications.
Installation
------------
npm i -g bitcoin-faucet
Usage
-----
run:
bitcoin-faucet
outputs something like:
bitcoin-faucet listening on port 14004
deposit funds to: n2hBww8z4cZE68SETVTAu4BvM52EpPVo7S
### ENV VARS
You can configure the faucet with the following commands:
- `FAUCET_PORT`: defaults to `14004`
- `FAUCET_WALLET`: defaults to `~/.bitcoin-faucet/wallet`. It's a plain text file with the faucet private key in WIF.
- `PRIVKEY`: the faucet private key in WIF
### Request Funds
CURL or make browser GET request to `/withdrawal` with params `address` and optional `amount`. If amount not specified, 10000 satoshi is used.
**Example**:
http://localhost:14004/withdrawal?address=msj42CCGruhRsFrGATiUuh25dtxYtnpbTx&amount=25000
response:
{
"status": "success",
"data": {
"txId": "7b139bdba00cbe506087444caa899b8c94cfac4ab660e0f***a50325cb41c458c"
}
}
#### Why GET?
While a `POST` probably would have been proper, a `GET` is super simple to implement and
easy to make requests in the browser.
Run as Mac OS X Service
-----------------------
Running it as a Mac OS X service allows you to always access it while developing.
Create the following file:
**~/Library/LaunchAgents/com.coinbolt.bitcoin-faucet**
```xml
Label
com.coinbolt.bitcoin-faucet
EnvironmentVariables
PATH
/Users/jp/.nvm/v0.10.32/bin:$PATH
ProgramArguments
/Users/jp/.nvm/v0.10.32/bin/bitcoin-faucet
WorkingDirectory
/Users/jp/.bitcoin-faucet
StandardOutPath
/Users/jp/.bitcoin-faucet/bitcoin-faucet.log
StandardErrorPath
/Users/jp/.bitcoin-faucet/bitcoin-faucet.log
RunAtLoad
KeepAlive
```
Configure the settings appropriate to your environment. Make sure that the `PATH`
above is pointing to the location of `node`.
Then run
launchctl load ~/Library/LaunchAgents/com.coinbolt.bitcoin-faucet.plist
License
-------
MIT
近期下载者:
相关文件:
收藏者: