<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Block\Hash;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Block\BaseBlock;
+use Org\Shipsimu\Hub\Miner\Minable;
+
/**
* A Hash block class
*
// Return the prepared instance
return $blockInstance;
}
-}
-// [EOF]
-?>
+}
use Org\Shipsimu\Hub\Listener\BaseListener;
use Org\Shipsimu\Hub\Listener\Listenable;
use Org\Shipsimu\Hub\Locator\Node\LocateableNode;
+use Org\Shipsimu\Hub\Miner\Minable;
use Org\Shipsimu\Hub\Network\Delivery\Deliverable;
use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
use Org\Shipsimu\Hub\Network\Package\Delivery\Fragment\Fragmentable;
*/
private $packageInstance = NULL;
+ /**
+ * A Minable instance
+ */
+ private $minableInstance = NULL;
+
/**
* Name of used protocol
*/
return $this->packageInstance;
}
+ /**
+ * Setter for Minable instance
+ *
+ * @param $minableInstance A Minable instance
+ * @return void
+ */
+ protected final function setMinableInstance (Minable $minableInstance) {
+ $this->minableInstance = $minableInstance;
+ }
+
+ /**
+ * Getter for minable instance
+ *
+ * @return $minableInstance A Minable instance
+ */
+ protected final function getMinableInstance () {
+ return $this->minableInstance;
+ }
+
}
}
// Now convert the miner-mode in a class name
- $className = 'Hub' . self::convertToClassName($minerMode) . 'Miner';
+ $configEntry = sprintf('hub_%s_miner_mode_class', $minerMode);
// And try to instance it
try {
// Get an instance
- $minerInstance = ObjectFactory::createObjectByName($className);
+ $minerInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Own namespace
namespace Org\Shipsimu\Hub\Miner;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Helper\Miner\MinerHelper;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
namespace Org\Shipsimu\Hub\Miner;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\State\Miner\MinerStateFactory;
use Org\Shipsimu\Hub\Generic\BaseHubSystem;
+use Org\Shipsimu\Hub\Helper\Miner\MinerHelper;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
// Import framework stuff
use Org\Mxchange\CoreFramework\Database\Updateable;
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Stacker\Stackable;
/**
* A general Producer class
<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Key;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
/**
* A general KeyProducer class
*
<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Unit;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
/**
* A general UnitProducer class
*
// Own namespace
namespace Org\Shipsimu\Hub\Producer\Cruncher\Key;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\Registerable;
// Own namespace
namespace Org\Shipsimu\Hub\Cruncher\Producer\Unit;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
// Own namespace
namespace Org\Shipsimu\Hub\Miner\Producer\Block\Genesis;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\Registerable;
<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\miner\Producer\Block\Genesis;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+use Org\Shipsimu\Hub\Producer\Block\BaseBlockProducer;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\State\Stateable;
+
/**
* A MinerTestGenesisBlock producer class
*
* to this.
*/
}
+
}
<?php
+// Own namespace
+namespace Org\Shipsimu\Hub\Producer\Block;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\BaseProducer;
+
/**
* A general BlockProducer class
*
// Get new instance
$stateInstance = new MinerBootingState();
- // Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MINER-STATE: Has changed from ' . $minerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');
-
// Return the prepared instance
return $stateInstance;
}
<?php
// Own namespace
-namespace Org\Shipsimu\Hub\Miner\State;
+namespace Org\Shipsimu\Hub\State\Miner;
+
+// Import application-specific stuff
+use Org\Shipsimu\Hub\State\Miner\MinerBootingState;
+use Org\Shipsimu\Hub\State\Miner\MinerInitState;
// Import framework stuff
use Org\Mxchange\CoreFramework\State\BaseState;
// Own namespace
namespace Org\Shipsimu\Hub\State\Miner;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\State\Miner\MinerStateFactory;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Executor\Executor;
use Org\Mxchange\CoreFramework\State\Stateable;
namespace Org\Shipsimu\Hub\Cruncher\Producer\Key;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Producer\ProducerFactory;
use Org\Shipsimu\Hub\Task\BaseHubTask;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Task\BaseTask;
use Org\Mxchange\CoreFramework\Task\Taskable;
use Org\Mxchange\CoreFramework\Visitor\Visitable;
namespace Org\Shipsimu\Hub\Cruncher\Task\Producer\Unit;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Producer\ProducerFactory;
use Org\Shipsimu\Hub\Task\BaseHubTask;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Task\BaseTask;
use Org\Mxchange\CoreFramework\Task\Taskable;
use Org\Mxchange\CoreFramework\Visitor\Visitable;
<?php
// Own namespace
-namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock;
+namespace Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Producer\ProducerFactory;
use Org\Shipsimu\Hub\Task\BaseHubTask;
// Import framework stuff
<?php
// Own namespace
-namespace Org\Shipsimu\Hub\Miner\Task\Producer\GenesisBlock;
+namespace Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis;
// Import application-specific stuff
+use Org\Shipsimu\Hub\Factory\Producer\ProducerFactory;
use Org\Shipsimu\Hub\Task\BaseHubTask;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Task\BaseTask;
use Org\Mxchange\CoreFramework\Task\Taskable;
use Org\Mxchange\CoreFramework\Visitor\Visitable;
$cfg->setConfigEntry('miner_php_requirements_filter_class', 'Org\Shipsimu\Hub\Miner\Filter\Requirements\MinerPhpRequirementsFilter');
// CFG: MINER-INITIALIZER-FILTER
-$cfg->setConfigEntry('miner_initializer_filter_class', 'MinerInitializationFilter');
+$cfg->setConfigEntry('miner_initializer_filter_class', 'Org\Shipsimu\Hub\Miner\Filter\Initialization\MinerInitializationFilter');
// CFG: MINER-WELCOME-TEASER-FILTER
-$cfg->setConfigEntry('miner_welcome_teaser_filter_class', 'MinerWelcomeTeaserFilter');
+$cfg->setConfigEntry('miner_welcome_teaser_filter_class', 'Org\Shipsimu\Hub\Miner\Filter\WelcomeTeaser\MinerWelcomeTeaserFilter');
// CFG: MINER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER
-$cfg->setConfigEntry('miner_bootstrap_task_handler_initializer_filter_class', 'MinerTaskHandlerInitializerFilter');
+$cfg->setConfigEntry('miner_bootstrap_task_handler_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Initializer\Miner\Handler\Task\MinerTaskHandlerInitializerFilter');
// CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER
-$cfg->setConfigEntry('miner_bootstrap_extra_bootstrapping_filter_class', 'MinerBootstrapExtraBootstrappingFilter');
+$cfg->setConfigEntry('miner_bootstrap_extra_bootstrapping_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Miner\Extra\MinerBootstrapExtraBootstrappingFilter');
// CFG: MINHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER
-$cfg->setConfigEntry('miner_bootstrap_buffer_queue_initializer_filter_class', 'MinerBootstrapBufferQueueInitializerFilter');
+$cfg->setConfigEntry('miner_bootstrap_buffer_queue_initializer_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Miner\Queue\MinerBootstrapBufferQueueInitializerFilter');
// CFG: MINER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER
-$cfg->setConfigEntry('miner_bootstrap_generic_activation_filter_class', 'MinerBootstrapGenericActivationFilter');
+$cfg->setConfigEntry('miner_bootstrap_generic_activation_filter_class', 'Org\Shipsimu\Hub\Filter\Bootstrap\Miner\Activation\MinerBootstrapGenericActivationFilter');
// CFG: MINER-SHUTDOWN-FILTER
-$cfg->setConfigEntry('miner_shutdown_filter_class', 'MinerShutdownFilter');
+$cfg->setConfigEntry('miner_shutdown_filter_class', 'Org\Shipsimu\Hub\Filter\Shutdown\Miner\MinerShutdownFilter');
// CFG: MINER-INIT-STATE-CLASS
-$cfg->setConfigEntry('miner_init_state_class', 'MinerInitState');
+$cfg->setConfigEntry('miner_init_state_class', 'Org\Shipsimu\Hub\State\Miner\MinerInitState');
// CFG: MINER-BOOTING-STATE-CLASS
-$cfg->setConfigEntry('miner_booting_state_class', 'MinerBootingState');
+$cfg->setConfigEntry('miner_booting_state_class', 'Org\Shipsimu\Hub\State\Miner\MinerBootingState');
// CFG: MINER-BLOCK-FETCHER-TASK-CLASS
-$cfg->setConfigEntry('miner_block_fetcher_task_class', 'MinerBlockFetcherTask');
+$cfg->setConfigEntry('miner_block_fetcher_task_class', 'Org\Shipsimu\Hub\Miner\Task\Fetcher\Block\MinerBlockFetcherTask');
// CFG: TASK-MINER-BLOCK-FETCHER-STARTUP-DELAY
$cfg->setConfigEntry('task_miner_block_fetcher_startup_delay', 1000);
$cfg->setConfigEntry('task_miner_block_fetcher_max_runs', 0);
// CFG: MINER-TEST-GENESIS-BLOCK-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('miner_test_genesis_block_producer_task_class', 'MinerTestGenesisBlockProducerTask');
+$cfg->setConfigEntry('miner_test_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis\MinerTestGenesisBlockProducerTask');
// CFG: TASK-MINER-TEST-GENESIS-BLOCK-PRODUCER-STARTUP-DELAY
$cfg->setConfigEntry('task_miner_test_genesis_block_producer_startup_delay', 1000);
$cfg->setConfigEntry('task_miner_test_genesis_block_producer_max_runs', 0);
// CFG: MINER-REAL-GENESIS-BLOCK-PRODUCER-TASK-CLASS
-$cfg->setConfigEntry('miner_real_genesis_block_producer_task_class', 'MinerRealGenesisBlockProducerTask');
+$cfg->setConfigEntry('miner_real_genesis_block_producer_task_class', 'Org\Shipsimu\Hub\Miner\Task\Producer\Block\Genesis\MinerRealGenesisBlockProducerTask');
// CFG: TASK-MINER-REAL-GENESIS-BLOCK-PRODUCER-STARTUP-DELAY
$cfg->setConfigEntry('task_miner_real_genesis_block_producer_startup_delay', 500);
$cfg->setConfigEntry('task_miner_real_genesis_block_producer_max_runs', 0);
// CFG: MINER_NODE-COMMUNICATOR-TASK-CLASS
-$cfg->setConfigEntry('miner_node_communicator_task_class', 'MinerNodeCommunicatorTask');
+$cfg->setConfigEntry('miner_node_communicator_task_class', 'Org\Shipsimu\Hub\Miner\Task\Communicator\Node\MinerNodeCommunicatorTask');
// CFG: TASK-MINER_NODE-COMMUNICATOR-STARTUP-DELAY
$cfg->setConfigEntry('task_miner_node_communicator_startup_delay', 500);
$cfg->setConfigEntry('task_miner_node_communicator_max_runs', 0);
// CFG: MINER-TEST-GENESIS-BLOCK-PRODUCER-CLASS
-$cfg->setConfigEntry('miner_test_genesis_block_producer_class', 'MinerTestGenesisBlockProducer');
+$cfg->setConfigEntry('miner_test_genesis_block_producer_class', 'Org\Shipsimu\Hub\miner\Producer\Block\Genesis\MinerTestGenesisBlockProducer');
// CFG: MINER-REAL-GENESIS-BLOCK-PRODUCER-CLASS
-$cfg->setConfigEntry('miner_real_genesis_block_producer_class', 'MinerRealGenesisBlockProducer');
+$cfg->setConfigEntry('miner_real_genesis_block_producer_class', 'Org\Shipsimu\Hub\Miner\Producer\Block\Genesis\MinerRealGenesisBlockProducer');
// CFG: MINER-NODE-COMMUNICATOR-CLASS
-$cfg->setConfigEntry('miner_node_communicator_class', 'MinerNodeCommunicator');
+$cfg->setConfigEntry('miner_node_communicator_class', 'Org\Shipsimu\Hub\Miner\Communicator\Node\MinerNodeCommunicator');
// CFG: MINER-TEST-HASH-BLOCK-CLASS
-$cfg->setConfigEntry('miner_test_hash_block_class', 'HashBlock');
+$cfg->setConfigEntry('miner_test_hash_block_class', 'Org\Shipsimu\Hub\Block\Hash\HashBlock');
// CFG: MINER-REAL-HASH-BLOCK-CLASS
-$cfg->setConfigEntry('miner_real_hash_block_class', 'HashBlock');
+$cfg->setConfigEntry('miner_real_hash_block_class', 'Org\Shipsimu\Hub\Block\Hash\HashBlock');
+
+// CFG: HUB-COIN-MINER-MODE-CLASS
+$cfg->setConfigEntry('hub_coin_miner_mode_class', 'Org\Shipsimu\Hub\Miner\HubCoinMiner');
///////////////////////////////////////////////////////////////////////////////
// Cruncher configuration
*/
interface Minable extends HubInterface {
}
-
-// [EOF]
-?>
// Import application-specific stuff
use Org\Shipsimu\Hub\Generic\HubInterface;
+use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
// Import framework stuff
use Org\Mxchange\CoreFramework\Controller\Controller;
* @return void
*/
function blockProducerHasInitialized (BlockProducer $producerInstance);
-}
-// [EOF]
-?>
+}
// Own namespace
namespace Org\Shipsimu\Hub\Producer\Block;
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Producer\Producer;
+
// Import framework stuff
use Org\Mxchange\CoreFramework\Executor\Executor;
use Org\Mxchange\CoreFramework\State\Stateable;
*/
interface Producer extends HubInterface {
}
-
-// [EOF]
-?>
-Subproject commit d1d4c27a298fb48a433ab3ee132229d88274b060
+Subproject commit 6d6b58a1042e6ad5d6277f8ff5144c95f1abd427