Permalink
Browse files

Prelminary support for other chains

  • Loading branch information...
gertjaap committed Nov 11, 2017
1 parent f1e0444 commit 36280180ce1ffee14840e35a2653e90a8746cec4
@@ -0,0 +1,36 @@
version: "2"
services:

bitcoind-main:
image: ruimarinho/bitcoin-core
restart: always
expose:
- "8332"
ports:
- "8333:8333"
volumes:
- ./data/btc/main/coind:/bitcoin/.bitcoin
environment:
- RPCUSER=middleware
- RPCPASSWORD=middleware
command: -rpcport=8332 -server -rpcallowip='0.0.0.0/0' -txindex

btc-middleware-cpp-main:
image: vtc-wallet-middleware
restart: always
environment:
- COIND_HOST=bitcoind-main
expose:
- "8888"
depends_on:
- bitcoind-main
volumes:
- ./data/btc/main/coind/blocks:/blocks
- ./data/btc/main/index:/index
- ./coins:/coins
command: --coinParams=/coins/bitcoin-mainnet.json

networks:
default:
external:
name: coin-middleware
@@ -0,0 +1,36 @@
version: "2"
services:

bitcoind-test:
image: kylemanna/bitcoind
restart: always
expose:
- "8332"
ports:
- "8333:8333"
volumes:
- ./data/btc/test/coind:/bitcoin/.bitcoin
environment:
- RPCUSER=middleware
- RPCPASSWORD=middleware
command: -rpcport=8332 -server -rpcallowip='0.0.0.0/0' -testnet -txindex

btc-middleware-cpp-test:
image: vtc-wallet-middleware
restart: always
environment:
- COIND_HOST=bitcoind-test
expose:
- "8888"
depends_on:
- bitcoind-test
volumes:
- ./data/btc/test/coind/testnet3/blocks:/blocks
- ./data/btc/test/index:/index
- ./coins:/coins
command: --coinParams=/coins/bitcoin-testnet.json

networks:
default:
external:
name: coin-middleware
@@ -0,0 +1,6 @@
{
"magic" : "f9beb4d9",
"version_p2pkh" : "00",
"version_p2sh" : "05",
"prefix_bech32": "btc"
}
@@ -0,0 +1,6 @@
{
"magic" : "0b110907",
"version_p2pkh" : "6f",
"version_p2sh" : "c4",
"prefix_bech32": "tbtc"
}
@@ -0,0 +1,6 @@
{
"magic" : "fbc0b6db",
"version_p2pkh" : "30",
"version_p2sh" : "32",
"prefix_bech32": "ltc"
}
@@ -0,0 +1,6 @@
{
"magic" : "fdd2c8f1",
"version_p2pkh" : "6f",
"version_p2sh" : "c4",
"prefix_bech32": "tltc"
}
@@ -3,5 +3,4 @@
"version_p2pkh" : "47",
"version_p2sh" : "05",
"prefix_bech32": "vtc"

}
@@ -0,0 +1,31 @@
version: "2"
services:

litecoind-main:
image: uphold/litecoind
restart: always
expose:
- "8332"
ports:
- "9333:9333"
volumes:
- ./data/ltc/main/coind:/home/litecoin/.litecoin
command: -rpcuser=middleware -rpcpassword=middleware -rpcallowip='0.0.0.0/0' -rpcport=8332 -server -txindex

ltc-middleware-cpp-main:
image: vtc-wallet-middleware
restart: always
environment:
- COIND_HOST=litecoind-main
expose:
- "8888"
volumes:
- ./data/ltc/main/coind/blocks:/blocks
- ./data/ltc/main/index:/index
- ./coins:/coins
command: --coinParams=/coins/litecoin-mainnet.json

networks:
default:
external:
name: coin-middleware
@@ -0,0 +1,31 @@
version: "2"
services:

litecoind-test:
image: uphold/litecoind
restart: always
expose:
- "8332"
ports:
- "9333:9333"
volumes:
- ./data/ltc/test/coind:/home/litecoin/.litecoin
command: -rpcuser=middleware -rpcpassword=middleware -rpcport=8332 -rpcallowip='0.0.0.0/0' -testnet -server -txindex

ltc-middleware-cpp-test:
image: vtc-wallet-middleware
restart: always
environment:
- COIND_HOST=litecoind-test
expose:
- "8888"
volumes:
- ./data/ltc/test/coind/testnet4/blocks:/blocks
- ./data/ltc/test/index:/index
- ./coins:/coins
command: --coinParams=/coins/litecoin-testnet.json

networks:
default:
external:
name: coin-middleware
@@ -42,9 +42,6 @@ struct ScannedBlock {

// The hash of the previous block used to form the chain. This string is the the "reverse hash" used on block explorers
string previousBlockHash;

// Contains true if the scanned block came from the testnet
bool testnet;
};

// Describes a transaction output inside a blockchain transaction
@@ -146,9 +143,6 @@ struct Block {

// The list of transactions inside this block
vector<Transaction> transactions;

// Indicates if this block is from the testnet
bool testnet;
};


@@ -34,6 +34,7 @@ unsigned char VtcBlockIndexer::CoinParams::p2shVersion;

void VtcBlockIndexer::CoinParams::readFromFile(string fileName)
{
cout << "Reading coin params from [" << fileName << "]" << endl;
ifstream i(fileName);
json j;
i >> j;
@@ -40,7 +40,7 @@ VtcBlockIndexer::HttpServer::HttpServer(shared_ptr<leveldb::DB> db, shared_ptr<V
this->mempoolMonitor = mempoolMonitor;
blockReader.reset(new VtcBlockIndexer::BlockReader(blocksDir));
scriptSolver = std::make_unique<VtcBlockIndexer::ScriptSolver>();
httpClient.reset(new jsonrpc::HttpClient("http://middleware:middleware@" + std::string(std::getenv("VERTCOIND_HOST")) + ":8332"));
httpClient.reset(new jsonrpc::HttpClient("http://middleware:middleware@" + std::string(std::getenv("COIND_HOST")) + ":8332"));
vertcoind.reset(new VertcoinClient(*httpClient));
}

@@ -32,7 +32,7 @@ using namespace std;


VtcBlockIndexer::MempoolMonitor::MempoolMonitor() {
httpClient.reset(new jsonrpc::HttpClient("http://middleware:middleware@" + std::string(std::getenv("VERTCOIND_HOST")) + ":8332"));
httpClient.reset(new jsonrpc::HttpClient("http://middleware:middleware@" + std::string(std::getenv("COIND_HOST")) + ":8332"));
vertcoind.reset(new VertcoinClient(*httpClient));
blockReader.reset(new VtcBlockIndexer::BlockReader(""));
scriptSolver.reset(new VtcBlockIndexer::ScriptSolver());
@@ -10,23 +10,23 @@ services:
ports:
- "5889:5889"
volumes:
- ./data/main/vertcoind:/data
- ./data/vtc/main/coind:/data
command: -rpcuser=middleware -rpcpassword=middleware -addnode=jlovejoy.mit.edu -addnode=gertjaap.ddns.net -txindex

vtc-middleware-cpp-main:
image: vtc-wallet-middleware
restart: always
environment:
- VERTCOIND_HOST=vertcoind-main
- COIND_HOST=vertcoind-main
expose:
- "8888"
volumes:
- ./data/main/vertcoind/blocks:/blocks
- ./data/main/index:/index
- ./data/vtc/main/coind/blocks:/blocks
- ./data/vtc/main/index:/index
- ./coins:/coins
command: --coinParams=/coins/vertcoin-mainnet.json

networks:
default:
external:
name: vertcoin-middleware
name: coin-middleware
@@ -10,23 +10,23 @@ services:
ports:
- "15889:15889"
volumes:
- ./data/test/vertcoind:/data
- ./data/vtc/test/coind:/data
command: -rpcuser=middleware -rpcpassword=middleware -testnet -addnode=jlovejoy.mit.edu -addnode=gertjaap.ddns.net -txindex

vtc-middleware-cpp-test:
image: vtc-wallet-middleware
restart: always
environment:
- VERTCOIND_HOST=vertcoind-test
- COIND_HOST=vertcoind-test
expose:
- "8888"
volumes:
- ./data/test/vertcoind/testnet3/blocks:/blocks
- ./data/test/index:/index
- ./data/vtc/test/coind/testnet3/blocks:/blocks
- ./data/vtc/test/index:/index
- ./coins:/coins
command: --coinParams=/coins/vertcoin-testnet.json

networks:
default:
external:
name: vertcoin-middleware
name: coin-middleware

0 comments on commit 3628018

Please sign in to comment.