Skip to content

Commit

Permalink
Document how to setup and run a gateway.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jul 28, 2014
1 parent a7e6ae7 commit 01ea2e3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -28,7 +28,9 @@ Things you can do:

* Create a transaction with `./pettycoin-tx`.

* **COMING SOON** Run a gateway.
* Send test coins from the bitcoin network to the prototype gateway at `muQY1RFhzu2exJj4wihqfotzDDztS1ieZv` (only if you control the sending address!)

* Run your own gateway (see [docs/RUNNING-A-GATEWAY.md](https://github.com/rustyrussell/pettycoin/blob/master/docs/RUNNING-A-GATEWAY.md).

* **COMING SOON** Create and monitor a simple test wallet.

Expand Down
62 changes: 62 additions & 0 deletions doc/RUNNING-A-GATEWAY.md
@@ -0,0 +1,62 @@
Running a Pettycoin Gateway
===========================

On the test network, anyone can run a pettycoin gateway. It listens
to the bitcoin (test) network for network sends, and injects funds
into the pettycoin network.

**It does not yet return funds to the bitcoin network!**

Daemons You Need To Be Running
------------------------------

To operate a gateway, you will need to also run the following:

* bitcoind, with configurtion like so (it will also insist you set an
rpcpassword when you first try to run it).

testnet=1
server=1
gen=0
txindex=1

* pettycoin, with no particular config.

pettycoin-gateway Setup
------------------------------

Make sure bitcoind, pettycoin-tx and pettycoin-query are in the
path (as pettycoin-gateway will invoke them).

First run `pettycoin-gateway --setup`:

rusty@Petty1:~/src/pettycoin$ pettycoin-gateway --setup
Gateway address is muQY1RFhzu2exJj4wihqfotzDDztS1ieZv

This will create the following files in ~/.pettycoin:

<dl>
<dt> `gateway-address`
<dd> The public address of the gateway (also printed by --setup above).
<dt> `gateway-privkey`
<dd> The private key of the gateway (needed to sign pettycoin gateway
transactions).
<dt> `gateway-txs`

<dd> The bitcoin transaction IDs the gateway already injected into the
pettycoin network, so it doesn't inject twice.
</dl>

It will also create a bitcoin account called "gateway" with a single
address in it (the same as listed above) to receive funds.

Running pettycoin-gateway
-------------------------

Now you can run pettycoin-gateway! It exits on any kind of error,
with no decent diagnostics. But if you run it again it should be
safe, as it only records injected transactions into gateway-tx after
they've been injected into the pettycoin network.

Good luck!<br>
Rusty Russell.

0 comments on commit 01ea2e3

Please sign in to comment.