caravan-x
Version:
A terminal-based utility for managing Caravan multisig wallets in regtest mode. This tool simplifies development and testing with Caravan by providing an easy-to-use interface
208 lines (207 loc) • 5.57 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BUILT_IN_SCENARIOS = exports.DEFAULT_DOCKER_CONFIG = exports.SetupMode = exports.DEFAULT_CONFIG = void 0;
/**
* Default application configuration
*/
exports.DEFAULT_CONFIG = {
bitcoin: {
protocol: "http",
host: "127.0.0.1",
port: 18443, // Default regtest port
user: "user",
pass: "pass",
dataDir: process.env.HOME + "/.bitcoin",
},
appDir: process.env.HOME + "/.caravan-regtest",
caravanDir: process.env.HOME + "/.caravan-regtest/wallets",
keysDir: process.env.HOME + "/.caravan-regtest/keys",
};
/**
* Other configuration types for Caravan-X
* Supports Docker mode, Manual mode, snapshots, and shared configs
*/
/**
* Setup mode for Caravan-X
*/
var SetupMode;
(function (SetupMode) {
SetupMode["DOCKER"] = "docker";
SetupMode["MANUAL"] = "manual";
})(SetupMode || (exports.SetupMode = SetupMode = {}));
/**
* Default Docker configuration
*/
exports.DEFAULT_DOCKER_CONFIG = {
enabled: false,
image: "bitcoin/bitcoin:27.0",
containerName: "caravan-x-bitcoin",
ports: {
rpc: 18443,
p2p: 18444,
nginx: 8080,
},
volumes: {
bitcoinData: "/var/lib/caravan-x/bitcoin",
coordinator: "/var/lib/caravan-x/coordinator",
},
network: "caravan-x-network",
autoStart: true,
};
/**
* Pre-configured test scenarios
*/
exports.BUILT_IN_SCENARIOS = {
"basic-rbf": {
id: "basic-rbf",
name: "Basic RBF (Replace-By-Fee)",
description: "A simple RBF scenario with an unconfirmed transaction that can be replaced",
blockHeight: 101,
wallets: [
{
name: "alice",
type: "singlesig",
balance: 50,
},
{
name: "bob",
type: "singlesig",
balance: 0,
},
],
transactions: [
{
from: "alice",
to: "bob",
amount: 1,
confirmed: false,
rbf: true,
feeRate: 1,
},
],
},
"cpfp-chain": {
id: "cpfp-chain",
name: "CPFP (Child-Pays-For-Parent)",
description: "A parent transaction with low fee and a child transaction that bumps the fee",
blockHeight: 101,
wallets: [
{
name: "alice",
type: "singlesig",
balance: 50,
},
{
name: "bob",
type: "singlesig",
balance: 0,
},
],
transactions: [
{
from: "alice",
to: "bob",
amount: 5,
confirmed: false,
feeRate: 1,
},
{
from: "bob",
to: "alice",
amount: 1,
confirmed: false,
cpfp: true,
feeRate: 10,
},
],
},
"multisig-2-of-3": {
id: "multisig-2-of-3",
name: "Multisig 2-of-3 Setup",
description: "A 2-of-3 multisig wallet with initial funding",
blockHeight: 101,
wallets: [
{
name: "funder",
type: "singlesig",
balance: 100,
},
{
name: "multisig_2of3",
type: "multisig",
balance: 10,
quorum: {
requiredSigners: 2,
totalSigners: 3,
},
},
],
transactions: [
{
from: "funder",
to: "multisig_2of3",
amount: 10,
confirmed: true,
},
],
},
"timelock-test": {
id: "timelock-test",
name: "Timelock Transactions",
description: "Transactions with various timelocks (absolute and relative)",
blockHeight: 101,
wallets: [
{
name: "alice",
type: "singlesig",
balance: 50,
},
{
name: "bob",
type: "singlesig",
balance: 50,
},
],
transactions: [
{
from: "alice",
to: "bob",
amount: 5,
confirmed: true,
},
],
},
"address-types": {
id: "address-types",
name: "Different Address Types",
description: "Wallets with different address types (P2PKH, P2WPKH, P2WSH, P2TR)",
blockHeight: 101,
wallets: [
{
name: "legacy_wallet",
type: "singlesig",
addressType: "legacy",
balance: 25,
},
{
name: "segwit_wallet",
type: "singlesig",
addressType: "p2sh-segwit",
balance: 25,
},
{
name: "native_segwit_wallet",
type: "singlesig",
addressType: "bech32",
balance: 25,
},
{
name: "taproot_wallet",
type: "singlesig",
addressType: "bech32m",
balance: 25,
},
],
transactions: [],
},
};