Giter Site home page Giter Site logo

digitaldonkey / ethereum Goto Github PK

View Code? Open in Web Editor NEW
22.0 8.0 14.0 5.22 MB

Drupal Ethereum module

Home Page: https://www.drupal.org/project/ethereum

PHP 6.67% HTML 0.21% JavaScript 93.00% CSS 0.12%
drupal-8 drupal-module ethereum ethereum-client

ethereum's People

Contributors

amateescu avatar digitaldonkey avatar ethernomad avatar foxtrotcharlie avatar jeffanthony avatar marvil07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum's Issues

The frontend challenge

In order to reach a broader audience we need a frontend solution which:

  • Support all major browsers on desktop and mobile
  • TX signer supporting major wallets / identity providers
  • Does not depend on a centralized service
  • Fallback for users who don't have a wallet (Metamask Mascara?)
  • Standards for interactions for users
    • Learn to chose right network / unlocked account only once
  • Standards for Developers
    • Write once implement all
    • Not forced to use any particular front-end tech

Let's aggregate research on this here.

Error when configurating Ethereum and Ethereum User Connector

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}.

Add sever select to Ethereum status page

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>

image

For reference. The Servers are Drupal config Entities now. With the following properties.

id: infura_ropsten
label: 'Infura Ropsten test network'
url: 'https://ropsten.infura.io/drupal'
network_id: '3'
is_enabled: true
description: 'Infura (https://www.infura.io) provides access to Ethereum Nodes, so that you don''t require to host you own.'

Unable to verify user account

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}.

Ethereum Address Field info.yml file causes parse error

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

Implement ethereum_user_connector with a SmartContract Config

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.

Is development still on?

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?

Drupal ERC20 token implementation

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

  • Deploy from Admin interface (to multiple networks). See: https://tokenfactory.surge.sh/#/factory
  • Connect token holder addresses (users) with Drupal Users
  • Add a watch function so that you can mirror contract activities using Drupal entities (browse transactions using views)

Skope 2

  • Enable a Tokensale with Drupal. Integrating Signup and user management.
  • User status page: How many Tokens I own (Check Balance)

Challange:
In order to build this there is some work on the Drupal Ethereum module infrastructure and the Ethereum-PHP required:

  • Manage deployment and interaction with contracts including the Ability to deploy on different networks (and keeping track of that in Drupal)
  • General Drupal mechanism to watch Contract transactions
  • ABI -> Contract Object in Ethereum-php library. The library should be able to use ABI based Contract Objects. You may use this objects to call (non-payable) contract functions and listen to filters and logs
  • We will need Array support in Ethereum-php library to be able to read all data (RLP encoding)
  • Evaluating a standard way to integrate the user frontend interaction with a Drupal maintained smart contract. This might be hardcoded relating to the contract specific functionality. But at least a standard way to provide web3 for Drupal frontend should be done (Currently working on the integration of web3 using Metamask Mascara)

Possible README Issue.

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. "

admin/config/ethereum/smartcontract/register_drupal

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.

Can't import inherited ABIs

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.

Most simple non-anonymous voting

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

  • (research for existing similar solutions)
  • Allow users to vote on a fixed number of options (e.g: "entity hashes")
  • 1-n votes per user
  • User may change his vote
  • A fixed, deployed expire date, when voting is closed
  • Any kind of permission hook, so that we can limit users allowed to submit a vote (e.g based on a registry)

Drupal side

  • Voting interface: Create a vote field which can be added to entities. Enabling the user interaction. Maybe based on a view so that you can have one page to put your votes and submit at once using Metamask
  • Smart contract deployment from Drupal.
    • The UX challenge is to let an Editor curate a bunch of nodes and deploy a voting contract on this easily.
    • Manage different votes
  • Vote visualization

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.