Change default RPC port to 8334 (18334 testnet).

This change paves the way for running btcwallet on the same system without
having to change any settings.  The well-known ports used by the
reference implementation (8332 mainnet, 18332 testnet) will be exposed by
the separate wallet process, which will in turn forward unknown requests
to btcd via websockets (on 8334/18334).  This allows the wallet process to
ultimately provide a unified interface that exposes the same RPC-JSON API
as the reference implementation will maintaining wallet and chain
separation.
This commit is contained in:
Dave Collins 2013-10-16 15:01:43 -05:00
parent ccfcbebbdc
commit ae5810bc50
3 changed files with 14 additions and 8 deletions

View file

@ -30,7 +30,11 @@ type params struct {
}
// mainNetParams contains parameters specific to the main network
// (btcwire.MainNet).
// (btcwire.MainNet). NOTE: The RPC port is intentionally different than the
// reference implementation because btcd does not handle wallet requests. The
// separate wallet process listens on the well-known port and forwards requests
// it does not handle on to btcd. This approach allows the wallet process
// to emulate the full reference implementation RPC API.
var mainNetParams = params{
netName: "mainnet",
btcnet: btcwire.MainNet,
@ -40,7 +44,7 @@ var mainNetParams = params{
powLimitBits: btcchain.ChainParams(btcwire.MainNet).PowLimitBits,
listenPort: btcwire.MainPort,
peerPort: btcwire.MainPort,
rpcPort: "8332",
rpcPort: "8334",
dnsSeeds: []string{
"seed.bitcoin.sipa.be",
"dnsseed.bluematt.me",
@ -50,7 +54,8 @@ var mainNetParams = params{
}
// regressionParams contains parameters specific to the regression test network
// (btcwire.TestNet).
// (btcwire.TestNet). NOTE: The RPC port is intentionally different than the
// reference implementation - see the mainNetParams comment for details.
var regressionParams = params{
netName: "regtest",
btcnet: btcwire.TestNet,
@ -60,12 +65,13 @@ var regressionParams = params{
powLimitBits: btcchain.ChainParams(btcwire.TestNet).PowLimitBits,
listenPort: btcwire.RegressionTestPort,
peerPort: btcwire.TestNetPort,
rpcPort: "18332",
rpcPort: "18334",
dnsSeeds: []string{},
}
// testNet3Params contains parameters specific to the test network (version 3)
// (btcwire.TestNet3).
// (btcwire.TestNet3). NOTE: The RPC port is intentionally different than the
// reference implementation - see the mainNetParams comment for details.
var testNet3Params = params{
netName: "testnet",
btcnet: btcwire.TestNet3,
@ -75,7 +81,7 @@ var testNet3Params = params{
powLimitBits: btcchain.ChainParams(btcwire.TestNet3).PowLimitBits,
listenPort: btcwire.TestNetPort,
peerPort: btcwire.TestNetPort,
rpcPort: "18332",
rpcPort: "18334",
dnsSeeds: []string{
"testnet-seed.bitcoin.petertodd.org",
"testnet-seed.bluematt.me",

View file

@ -108,7 +108,7 @@
; norpc=1
; The port used to listen for RPC connections.
; rpcport=8332
; rpcport=8334
; ------------------------------------------------------------------------------

View file

@ -12,7 +12,7 @@ import (
const (
User = "rpcuser"
Password = "rpcpass"
Server = "127.0.0.1:8332"
Server = "127.0.0.1:8334"
)
var (