@muirglacier/testcontainers
Version:
A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin
58 lines • 2.24 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegTestContainer = void 0;
const DeFiDContainer_1 = require("../DeFiDContainer");
const SPV_1 = require("./SPV");
/**
* RegTest DeFiD container
*/
class RegTestContainer extends DeFiDContainer_1.DeFiDContainer {
/**
* @param {string} image docker image name
* @param {DockerOptions} [options]
*/
constructor(image = DeFiDContainer_1.DeFiDContainer.image, options) {
super('regtest', image, options);
this.spv = new SPV_1.SPV(this);
}
getCmd(opts) {
return [...super.getCmd(opts),
'-regtest=1',
'-jellyfish_regtest=1',
'-txnotokens=0',
'-logtimemicros',
'-txindex=1',
'-acindex=1',
'-amkheight=0',
'-bayfrontheight=1',
'-bayfrontgardensheight=2',
'-clarkequayheight=3',
'-dakotaheight=4',
'-dakotacrescentheight=5',
'-eunosheight=6',
'-eunospayaheight=7',
'-fortcanningheight=8'
];
}
getNewAddress(label = '', addressType = 'bech32') {
return __awaiter(this, void 0, void 0, function* () {
return yield this.call('getnewaddress', [label, addressType]);
});
}
getRpcPort() {
return __awaiter(this, void 0, void 0, function* () {
return yield this.getPort('19554/tcp');
});
}
}
exports.RegTestContainer = RegTestContainer;
//# sourceMappingURL=index.js.map