# satoshi-tv

> Satoshi TV ==========

Latest version **0.1.3** (published 2015-07-01) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install satoshi-tv
pnpm add satoshi-tv
yarn add satoshi-tv
bun add satoshi-tv
```

Provides the commands `pm2`, `satoshi-tv`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2015-07-01 |
| First published | 2015-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 33 |
| Known vulnerabilities | 0 (+13 in 6 direct dependencies) |
| Install scripts | no |
| Author | Chris Arnesen |
| Maintainers | carnesen |

## Links

- npm: https://www.npmjs.com/package/satoshi-tv
- Repository: https://github.com/carnesen/satoshi-tv
- Issues: https://github.com/carnesen/satoshi-tv/issues
- npm.io page: https://npm.io/package/satoshi-tv

## Dependencies (33)

- [d3](https://npm.io/package/d3.md) ^3.5.5
- [ini](https://npm.io/package/ini.md) ^1.3.4
- [pm2](https://npm.io/package/pm2.md) ^0.14.2
- [flux](https://npm.io/package/flux.md) ^2.0.3
- [nock](https://npm.io/package/nock.md) ^2.6.0
- [tail](https://npm.io/package/tail.md) ^0.4.0
- [async](https://npm.io/package/async.md) ^1.2.1
- [chalk](https://npm.io/package/chalk.md) ^1.0.0
- [level](https://npm.io/package/level.md) ^1.1.0
- [react](https://npm.io/package/react.md) ^0.13.3
- [touch](https://npm.io/package/touch.md) 0.0.3
- [config](https://npm.io/package/config.md) ^1.14.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [morgan](https://npm.io/package/morgan.md) ^1.5.3
- [bitcore](https://npm.io/package/bitcore.md) ^0.12.8
- [express](https://npm.io/package/express.md) ^4.12.3
- [git-rev](https://npm.io/package/git-rev.md) ^0.2.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.3.1
- [request](https://npm.io/package/request.md) ^2.58.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.5.1
- [winston](https://npm.io/package/winston.md) ^1.0.0
- [node-jsx](https://npm.io/package/node-jsx.md) ^0.13.3
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [keymirror](https://npm.io/package/keymirror.md) ^0.1.1
- [react-art](https://npm.io/package/react-art.md) ^0.13.0
- [socket.io](https://npm.io/package/socket.io.md) ^1.3.5
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.0.4
- [swagger-ui](https://npm.io/package/swagger-ui.md) ^2.1.0
- [bitcoin-rpc](https://npm.io/package/bitcoin-rpc.md) ^0.2.1
- [bitcore-p2p](https://npm.io/package/bitcore-p2p.md) ^0.14.1
- [object-assign](https://npm.io/package/object-assign.md) ^2.0.0
- [expand-home-dir](https://npm.io/package/expand-home-dir.md) 0.0.2
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^1.3.5

## Recent versions

- 0.1.3 (latest) — 2015-07-01
- 0.1.2 — 2015-07-01
- 0.1.1 — 2015-07-01
- 0.1.0 — 2015-06-30
- 0.0.1 — 2015-06-30

## README

Satoshi TV
==========

[![Build Status](https://travis-ci.org/carnesen/satoshi-tv.svg)](https://travis-ci.org/carnesen/satoshi-tv)
[![Coverage Status](https://coveralls.io/repos/carnesen/satoshi-tv/badge.svg)](https://coveralls.io/r/carnesen/satoshi-tv)

Install
-------

To install using the Node.js package manager [NPM](https://www.npmjs.com/~carnesen):

```
npm install satoshi-tv -g
```


a Node.js JSON API daemon that serves a [React](https://facebook.github.io/react/React.js) JavaScript browser app.

First step is to [download](https://bitcoin.org/en/download) and install Bitcoin Core. Satoshi TV needs access to both the remote procedure call (RPC) and peer-to-peer (P2P) interfaces of bitcoind, the Bitcoin Core "daemon". Create a file named bitcoin.conf in the Bitcoin Core data directory (by default "~/Library/Application Support/Bitcoin" on Mac OS X or "~/.bitcoin" on Linux) with contents:

```
rpcuser=username
rpcpassword=password
txindex=1
port=8333
rpcport=8332
```

The "rpc" properties activate the remote procedure call (RPC) interface. The "txindex=1" property tells it to maintain an index of all transactions by address.

Now start Bitcoin Core by either running the desktop UI "Bitcoin-QT", or by firing up the headless daemon bitcoind.

Satoshi TV is powered by [Node.js](https://nodejs.org/) and its package manager npm. To install Satoshi TV and its dependencies, in a terminal shell do:

```
git clone https://github.com/carnesen/satoshi-tv
cd satoshi-tv
npm install
```

Satoshi TV reads its configuration from [YAML](https://en.wikipedia.org/wiki/YAML) files in the "config" directory. To override [the defaults](https://github.com/carnesen/satoshi-tv/tree/master/config/default.yml), create a file "local.yml" in that directory. 

Now to start Satoshi TV, do:

```
npm start
```

First that [browserify](http://browserify.org/)'s the [Satoshi TV React app](https://github.com/carnesen/satoshi-tv/blob/master/app/index.js) into the [public directory]. Then it starts up the Node.js back end, which serves the public static assets as well as the JSON API. If everything went according to plan, you should now be able to connect to Satoshi TV at http://localhost:20832.

HTTP API
--------

The Satoshi TV API is served under the URI /api. A GET request to any of the endpoints returns a JSON list of timestamped data points of the form:
```
{
  key: <timestamp>,
  value: <value>
}
```
where ```<timestamp>``` is the number of milliseconds since January 1 1970 that the data point was captured and ```<value>``` is the data value payload. You can limit the date range of data returned in the list using query parameters ```gt``` and ```lt```. For example:

```
curl localhost:20832/api/bitcoin/transactions?gt=1434305100025
```
returns transactions relayed to Satoshi TV by its Bitcoin Core peer after June 14th 2015 at 12:17PM.

API documentation is in progress. For now you can see which endpoints are available by looking at the Javascript files in the [/lib](https://github.com/carnesen/satoshi-tv/tree/master/lib) subdirectories bitcoin, bitcoind, satoshi-tv, and system.

WebSocket API
-------------

Each of the HTTP endpoints is also exposed as a WebSocket ["namespace"](http://socket.io/docs/rooms-and-namespaces/) that on connection emits the latest data point all updates then thereafter.

---
_Source: https://npm.io/package/satoshi-tv · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
