digitaldonkey / ethereum Goto Github PK
View Code? Open in Web Editor NEWDrupal Ethereum module
Home Page: https://www.drupal.org/project/ethereum
Drupal Ethereum module
Home Page: https://www.drupal.org/project/ethereum
In order to reach a broader audience we need a frontend solution which:
Let's aggregate research on this here.
I am not able to verify address using testrpc after deploying the contracts.
I have followed all the steps in README.md
The installation is currently generating error because we have (:) in description within ethereum_address_field.info.yml.
Drupal 8.6.10 on PHP 7.3.
Network: Ropsten
admin/config/ethereum/user-connector
Error: Class 'Ethereum\Ethereum' not found in Drupal\ethereum\EthereumClientFactory->get() (line 46 of /home/sth/public_html/modules/ethereum/src/EthereumClientFactory.php) #0 /home/sth/public_html/modules/ethereum/src/Entity/EthereumServer.php(149): Drupal\ethereum\EthereumClientFactory->get('https://ropsten...') #1 /home/sth/public_html/modules/ethereum/src/Form/EthereumSettingsForm.php(82): Drupal\ethereum\Entity\EthereumServer->validateConnection() #2 [internal function]: Drupal\ethereum\Form\EthereumSettingsForm->buildForm(Array, Object(Drupal\Core\Form\FormState)) #3 /home/sth/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(518): call_user_func_array(Array, Array) #4 /home/sth/public_html/core/lib/Drupal/Core/Form/FormBuilder.php(275): Drupal\Core\Form\FormBuilder->retrieveForm('ethereum_settin...', Object(Drupal\Core\Form\FormState)) #5 /home/sth/public_html/core/lib/Drupal/Core/Controller/FormController.php(93): Drupal\Core\Form\FormBuilder->buildForm('ethereum_settin...', Object(Drupal\Core\Form\FormState)) #6 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #7 /home/sth/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #8 /home/sth/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #9 /home/sth/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #10 /home/sth/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #11 /home/sth/public_html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #12 /home/sth/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #13 /home/sth/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/sth/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/sth/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/sth/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/sth/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/sth/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /home/sth/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /home/sth/public_html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /home/sth/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #22 {main}.
On the long term i want to implement a Ethereum based Subscription Module.
There is a discussion on Ethereum based subscription models going on around EIP-948. (EIPs are Ethereum Improvement Proposals
The Server status page at admin/reports/ethereum currently works only for the default server.
With the refactored Server settings there should be a SELECT field on top, where you can switch the status page to any ACTIVE server.
Ideally we can reach every server config with admin/reports/ethereum/<id>
For reference. The Servers are Drupal config Entities now. With the following properties.
Hi,
I have this error when:
Thanks!
Hi Team,
I am trying to verify the "user" but status is not getting updated in Drupal Database. I am using Koven Network transaction are submitted successfully and block size also get increased only problem in Drupal
ValidateEthereumAccount.php in public function get($hash) function. Something problem in argument passing $eth = new EthereumUserConnectorController();
Please see below error for more details.
ArgumentCountError: Too few arguments to function Drupal\ethereum_user_connector\Plugin\rest\resource\ValidateEthereumAccount::__construct(), 6 passed in /opt/lampp/htdocs/drupal/web/modules/contrib/ethereum/ethereum_user_connector/src/Plugin/rest/resource/ValidateEthereumAccount.php on line 85 and exactly 7 expected in Drupal\ethereum_user_connector\Plugin\rest\resource\ValidateEthereumAccount->__construct() (line 62 of /opt/lampp/htdocs/drupal/web/modules/contrib/ethereum/ethereum_user_connector/src/Plugin/rest/resource/ValidateEthereumAccount.php) #0 /opt/lampp/htdocs/drupal/web/modules/contrib/ethereum/ethereum_user_connector/src/Plugin/rest/resource/ValidateEthereumAccount.php(85): Drupal\ethereum_user_connector\Plugin\rest\resource\ValidateEthereumAccount->__construct(Array, 'validate_ethere...', Array, Array, Object(Drupal\Core\Logger\LoggerChannel), Object(Drupal\Core\Session\AccountProxy)) #1 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\ethereum_user_connector\Plugin\rest\resource\ValidateEthereumAccount::create(Object(Drupal\Core\DependencyInjection\Container), Array, 'validate_ethere...', Array) #2 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(84): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('validate_ethere...', Array) #3 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(62): Drupal\Component\Plugin\PluginManagerBase->createInstance('validate_ethere...', Array) #4 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('validate_ethere...') #5 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(83): Drupal\Component\Plugin\LazyPluginCollection->get('validate_ethere...') #6 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(99): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array) #7 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Plugin/DefaultSingleLazyPluginCollection.php(55): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('validate_ethere...', Array) #8 /opt/lampp/htdocs/drupal/web/core/modules/rest/src/Entity/RestResourceConfig.php(206): Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object(Drupal\rest\Plugin\Type\ResourcePluginManager), 'validate_ethere...', Array) #9 /opt/lampp/htdocs/drupal/web/core/modules/rest/src/Entity/RestResourceConfig.php(111): Drupal\rest\Entity\RestResourceConfig->getPluginCollections() #10 /opt/lampp/htdocs/drupal/web/core/modules/rest/src/RequestHandler.php(78): Drupal\rest\Entity\RestResourceConfig->getResourcePlugin() #11 [internal function]: Drupal\rest\RequestHandler->handle(Object(Drupal\Core\Routing\RouteMatch), Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\rest\Entity\RestResourceConfig)) #12 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #13 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #14 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #15 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #16 /opt/lampp/htdocs/drupal/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #17 /opt/lampp/htdocs/drupal/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #18 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /opt/lampp/htdocs/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /opt/lampp/htdocs/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /opt/lampp/htdocs/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /opt/lampp/htdocs/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(664): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /opt/lampp/htdocs/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #27 {main}.
With #20 we introduced a Frontend server.
The frontend Server might look like username:[email protected]::PORT
.
Drupal Admins might unintentionally publish their Infura token or password.
Hello,
after following the installation instructions on a new D8 instance and attempting to enable the ethereum module, I get the following error:
Drupal\Core\Extension\InfoParserException: Unable to parse modules/contrib/ethereum/ethereum_address_field/ethereum_address_field.info.yml [error]
yaml_parse(): scanning error encountered during parsing: mapping values are not allowed in this context (line 3, column 54) in
/var/www/ethereum-test-site/docroot/core/lib/Drupal/Core/Extension/InfoParserDynamic.php:25
I believe this is related to the colon present in the module description
Hot-fixed the server config path for infura_ropsten and infura_kovan in ethereum_user_connector.
ethereum_user_connector
is a currently a hard coded example, as it served as a Proof of Concept.
ethereum_smartcontract module now can manage contract addresses and function calls at contract level.
The "migrated" Smart contract for ethereum_user_connector is now a config entity. See:
ethereum_user_connector/config/optional/ethereum_smartcontract.contract.register_drupal.yml
But the Contract Config is not connected yet with the module config.
Missing is...
SmartContract entities are missing instantiation (from config->call) currently. The API on the PHP-library level is ready.
I saw that the last commit was made in April of 2019. Is there activity on this project? If not is there another sound Ethereum project for Drupal?
There is a standard token contract created by Fabian Vogelsteller, which is considered the Ethereum standard token contract.
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
https://theethereum.wiki/w/index.php/ERC20_Token_Standard
It has serval implementations and there is some public interface at https://tokenfactory.surge.sh
The Idea: Create a Drupal Ethereum Submodule implementing that contract.
Skope 1
Skope 2
Challange:
In order to build this there is some work on the Drupal Ethereum module infrastructure and the Ethereum-PHP required:
In the 'Install Drupal' section we find:
# Create a configuration export directory. This is not required, but very usefull.
mkdir drupal/config
I was going to delete the extra 'l' in useful but a few lines down we find --config-dir="../config"
which I did not confirm but appears that it would break if that directory doesn't exist. I suggest deleting " This is not required, but very usefull. "
Upon page-load 1) even though the contract_src is not modified the ABI appears to be generated unnecessarily. Additionally, I seem to be 2) forced to modify contract_src in order for the 'Save' button to activate. This complicates attempting to modify the contract address for a given network as it is 3) not intuitive to make a change to the contract_src essentially appearing to be a broken Save button.
Kudos! to great work overall. I think it is great an ABI can be generated on the fly or through truffle via the interface but I'd appreciate the freedom to paste in my own ABI and not expose the contract for some cases. Regardless, the Solidity is not an essential component to Drupal so its importance should be downplayed here in my opinion, UNLESS...; the roadmap includes ability to compile and deploy smart contracts to the selected network and populate the form's address field with the newly generated contract's address.
no page shows when I try to assign my network URL
When using "Import from truffle option", ABIs for contract dependencies are not included. So for example in Solidity, if we have
contract someContract is ERC20
Only the functions in someContract are available in the ABI, ERC20 functions won't exist on the contract object.
I tried to work around this by importing an ERC20 contract separately, but since it is a dependency, the build file does not contain deployment information (eg address on Rinkeby) and thus the import form can't be saved.
Allowing editing of contract addresses in the import form, would be a fast fix to work around. Ideally, smart contract dependencies should have their ABI included with the parent.
I found that instantiating a contract directly with php-ethereum (instead of through GUI) includes all of the expect ABI items.
Create a Drupal Ethereum based most simple voting contract
Blockchain based anonymous voting has a lot of challenges and there are various approaches to enable that. It might be worth doing a deeper research into existing voting solutions, but I think there is one very simple approach with might fit well into Drupal architecture, while keeping things as simple as possible on the backend-, smart-contract- and user-interaction side.
Non-anonymous voting
Non anonymous voting is simpler to implement, as you don't require to hide current votes during the voting period from others (which is generally hard to do on Ethereum).
The general user story for this might be:
I have a organization of known users and wont to let them vote publicly provable on a set of options. Imagine I work for an NGO which want to decide which projects to found (e.g. once per year). People can submit project proposals and after a initial review and selection my Website editor should be able to start a voting on a set of projects.
Our Members will read the project proposals on our website and vote on them using the Ethereum blockchain as a proof layer.
Contract side
Drupal side
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.