Skip to content
Snippets Groups Projects
Commit bbd41f33 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Rename "onPluggedDALExecute" to "onDatabaseExecute"

parent 57df1d34
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ module.exports = { ...@@ -8,7 +8,7 @@ module.exports = {
cli: [{ cli: [{
name: 'start', name: 'start',
desc: 'Start Duniter node daemon.', desc: 'Start Duniter node daemon.',
onPluggedDALExecute: (server, conf, program, params, startServices) => co(function*() { onDatabaseExecute: (server, conf, program, params, startServices) => co(function*() {
const logger = server.logger; const logger = server.logger;
logger.info(">> Server starting..."); logger.info(">> Server starting...");
......
...@@ -10,7 +10,7 @@ module.exports = { ...@@ -10,7 +10,7 @@ module.exports = {
name: 'export-bc [upto]', name: 'export-bc [upto]',
desc: 'Exports the whole blockchain as JSON array, up to [upto] block number (excluded).', desc: 'Exports the whole blockchain as JSON array, up to [upto] block number (excluded).',
logs: false, logs: false,
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const upto = params[0]; const upto = params[0];
const logger = server.logger; const logger = server.logger;
try { try {
......
...@@ -18,7 +18,7 @@ module.exports = { ...@@ -18,7 +18,7 @@ module.exports = {
cli: [{ cli: [{
name: 'gen-next [host] [port] [difficulty]', name: 'gen-next [host] [port] [difficulty]',
desc: 'Tries to generate the next block of the blockchain.', desc: 'Tries to generate the next block of the blockchain.',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const host = params[0]; const host = params[0];
const port = params[1]; const port = params[1];
const difficulty = params[2]; const difficulty = params[2];
...@@ -27,7 +27,7 @@ module.exports = { ...@@ -27,7 +27,7 @@ module.exports = {
}, { }, {
name: 'gen-root [host] [port] [difficulty]', name: 'gen-root [host] [port] [difficulty]',
desc: 'Tries to generate root block, with choice of root members.', desc: 'Tries to generate root block, with choice of root members.',
onPluggedDALExecute: (server, conf, program, params, startServices, stopServices) => co(function*() { onDatabaseExecute: (server, conf, program, params, startServices, stopServices) => co(function*() {
const host = params[0]; const host = params[0];
const port = params[1]; const port = params[1];
const difficulty = params[2]; const difficulty = params[2];
......
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
cli: [{ cli: [{
name: 'peer [host] [port]', name: 'peer [host] [port]',
desc: 'Exchange peerings with another node', desc: 'Exchange peerings with another node',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const host = params[0]; const host = params[0];
const port = params[1]; const port = params[1];
const logger = server.logger; const logger = server.logger;
......
...@@ -7,7 +7,7 @@ module.exports = { ...@@ -7,7 +7,7 @@ module.exports = {
cli: [{ cli: [{
name: 'reapply-to [number]', name: 'reapply-to [number]',
desc: 'Reapply reverted blocks until block #[number] is reached. EXPERIMENTAL', desc: 'Reapply reverted blocks until block #[number] is reached. EXPERIMENTAL',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const number = params[0]; const number = params[0];
const logger = server.logger; const logger = server.logger;
try { try {
......
...@@ -7,7 +7,7 @@ module.exports = { ...@@ -7,7 +7,7 @@ module.exports = {
cli: [{ cli: [{
name: 'revert [count]', name: 'revert [count]',
desc: 'Revert (undo + remove) the top [count] blocks from the blockchain. EXPERIMENTAL', desc: 'Revert (undo + remove) the top [count] blocks from the blockchain. EXPERIMENTAL',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const count = params[0]; const count = params[0];
const logger = server.logger; const logger = server.logger;
try { try {
...@@ -23,7 +23,7 @@ module.exports = { ...@@ -23,7 +23,7 @@ module.exports = {
},{ },{
name: 'revert-to [number]', name: 'revert-to [number]',
desc: 'Revert (undo + remove) top blockchain blocks until block #[number] is reached. EXPERIMENTAL', desc: 'Revert (undo + remove) top blockchain blocks until block #[number] is reached. EXPERIMENTAL',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const number = params[0]; const number = params[0];
const logger = server.logger; const logger = server.logger;
try { try {
......
...@@ -7,7 +7,7 @@ module.exports = { ...@@ -7,7 +7,7 @@ module.exports = {
cli: [{ cli: [{
name: 'sync [host] [port] [to]', name: 'sync [host] [port] [to]',
desc: 'Synchronize blockchain from a remote Duniter node', desc: 'Synchronize blockchain from a remote Duniter node',
onPluggedDALExecute: (server, conf, program, params) => co(function*() { onDatabaseExecute: (server, conf, program, params) => co(function*() {
const host = params[0]; const host = params[0];
const port = params[1]; const port = params[1];
const to = params[2]; const to = params[2];
......
...@@ -263,7 +263,7 @@ function Stack(dependencies) { ...@@ -263,7 +263,7 @@ function Stack(dependencies) {
} }
} }
return yield command.onPluggedDALExecute(server, conf, program, params, return yield command.onDatabaseExecute(server, conf, program, params,
// Start services and streaming between them // Start services and streaming between them
() => co(function*() { () => co(function*() {
......
...@@ -160,7 +160,7 @@ function Node (dbName, options) { ...@@ -160,7 +160,7 @@ function Node (dbName, options) {
cli: [{ cli: [{
name: 'execute', name: 'execute',
desc: 'Unit Test execution', desc: 'Unit Test execution',
onPluggedDALExecute: (server, conf, program, params, startServices) => co(function*() { onDatabaseExecute: (server, conf, program, params, startServices) => co(function*() {
yield startServices(); yield startServices();
callback(null, server); callback(null, server);
yield Promise.resolve((res) => null); // Never ending yield Promise.resolve((res) => null); // Never ending
......
...@@ -88,7 +88,7 @@ describe("v1.0 Module API", () => { ...@@ -88,7 +88,7 @@ describe("v1.0 Module API", () => {
cli: [{ cli: [{
name: 'gimme-conf', name: 'gimme-conf',
desc: 'Returns the configuration object.', desc: 'Returns the configuration object.',
onPluggedDALExecute: (server, conf, program, params, startServices, stopServices) => co(function*() { onDatabaseExecute: (server, conf, program, params, startServices, stopServices) => co(function*() {
// Gimme the conf! // Gimme the conf!
return conf; return conf;
}) })
...@@ -177,7 +177,7 @@ describe("v1.0 Module API", () => { ...@@ -177,7 +177,7 @@ describe("v1.0 Module API", () => {
cli: [{ cli: [{
name: 'hello-service', name: 'hello-service',
desc: 'Says hello to the world, at service phase. And feed INPUT with a transaction.', desc: 'Says hello to the world, at service phase. And feed INPUT with a transaction.',
onPluggedDALExecute: (duniterServer, conf, program, programArgs, startServices, stopServices) => co(function*(){ onDatabaseExecute: (duniterServer, conf, program, programArgs, startServices, stopServices) => co(function*(){
yield startServices(); yield startServices();
fakeI.push("Version: 10\n" + fakeI.push("Version: 10\n" +
"Type: Transaction\n" + "Type: Transaction\n" +
...@@ -211,7 +211,7 @@ describe("v1.0 Module API", () => { ...@@ -211,7 +211,7 @@ describe("v1.0 Module API", () => {
cli: [{ cli: [{
name: 'bye-service', name: 'bye-service',
desc: 'Says goodbye to the world, at service phase.', desc: 'Says goodbye to the world, at service phase.',
onPluggedDALExecute: (duniterServer, conf, program, programArgs, startServices, stopServices) => co(function*(){ onDatabaseExecute: (duniterServer, conf, program, programArgs, startServices, stopServices) => co(function*(){
yield stopServices(); yield stopServices();
return Promise.resolve(); return Promise.resolve();
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment