GithubHelp home page GithubHelp logo

poanetwork / poa-dapps-validators Goto Github PK

View Code? Open in Web Editor NEW
13.0 8.0 41.0 8.63 MB

DApp for a list of validators with metadata for POA Network (Core/Sokol). Validators can update metadata using DApp.

Home Page: https://validators.poa.network

License: GNU General Public License v3.0

JavaScript 78.35% HTML 0.48% SCSS 21.18%
dapp ethereum governance

poa-dapps-validators's Introduction

POA Network Validators DApp

Validators DApp is built for POA Network based blockchains. It gives an opportunity for the current validators of the network to set their personal information on-chain. Also, everyone can view current validators' personal data from this DApp.

Base supported networks

  • Core POA network (RPC endpoint: https://core.poa.network)
  • Sokol testnet (RPC endpoint: https://sokol.poa.network)
  • Kovan testnet (RPC endpoint: https://kovan.infura.io/)

Supported browsers

  • Google Chrome v 59.0.3071.115+

MetaMask/Nifty Wallet extensions setup

Validators DApp is based on POA Network Governance contracts

Validator role

Set metadata

If you are a new validator of the POA Network and your validator node is successfully launched, you should fill your personal data. To do it you need:

  • connect to the corresponding endpoint of POA Network in Metamask
  • select your voting key from accounts in Metamask
  • click SET METADATA in the navigation bar
  • fill all fields in the form of a new validator
  • click + SET METADATA button
  • confirm transaction in Metamask.

That's it. After DApp will get a receipt for the transaction you'll see a success message and your personal data will be added to the list of validators.

If you need to change already submitted data you need to repeat previous instruction with the only difference your changes will be applied after two confirmations from other validators.

Confirm and finalize change in metadata

If you are an active validator of POA Network you have an ability to confirm pending changes of personal information from other validators. To do it you need:

  • connect to the corresponding endpoint of POA Network in Metamask
  • select your voting key from accounts in Metamask
  • click PENDING CHANGES in the navigation bar. You'll see all pending changes
  • find pending changes card
  • click Confirm button

If you see Finalize button, then 2 confirmations are already submitted and you or any other validator might click it to apply changes of validator's personal data.

Building from source

  1. npm i

  2. npm start

poa-dapps-validators's People

Contributors

gabitoesmiapodo avatar igorbarinov avatar maxaleks avatar maxgrapps avatar phahulin avatar rstormsf avatar unjapones avatar varasev avatar vbaranov avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poa-dapps-validators's Issues

(Feature) Render validators' registered (unconfirmed) physical address from PoPA

The PR that implements #74 only retrieves & renders a confirmed address from PoPA. This issue covers retrieving & rendering a registered (unconfirmed) address.

This also aims to prioritize the address information. The following list may represent the order of how reliable the information is:

  1. Confirmed physical address from PoPA.
  2. Registered (unconfirmed) address from PoPA.
  3. Already existing address from ValidatorMetadata.sol (fallback scenario, meant to be deprecated/dropped/hidden?)

How this is prioritization is represented on the UI needs to be defined.

ALERT: Transaction Error. Exception thrown in contract code.

Frontend (on our private network) works for both dapps (validators and voting), but when we try to submit transactions (to finalize metadata or create new ballot for voting), we get this error in Metamask:

ALERT: Transaction Error. Exception thrown in contract code.

P.S.
It used to work and we were able to set metadata for validator and also confirm it. Now, we can't finalize it and submit any transaction

Is is related to gas limit? Metamask changes? How do we fix or debug it? Also, what additional information do you need?

UI Changes to make better Metadata for the Validators

There needs to be more error trapping and explicitly defined fields.

Whilst reviewing https://validators.poa.network/ for myself, I saw a number of mistakes/issues (screen shots upon request - however, if you just look you too will see these.) I too had an issue initially during Network roll as a member of the Trinity Validator Set. I believe my issue was whether or not to use a comma or semi-semicolon to separate fields.

There were obviously bigger issues in those days. However, the issues that I’m seeing are probably fixed with a small cleanup of the UI. I think having explicitly defined fields such as:

Address 1, Address 2, City, State (Drop down), ZIP, USA (automatically appended due to current requirement - but there for completeness):

img_4341

Furthermore - I actually think that we ought to hook in a third party API to check and perhaps suggests an address after the user submits there work. Should the individual not take the requirement - I’d like to suggest the idea of presenting the one that the individual provided AND the API for all to see.

In the case of a minor issue, I fully expect a reasonable individual to understand. But if there’s a ‘larger’ issue - again, I trust in the individual reviewing the data to come to their own conclusions.

Call `window.ethereum.enable` only when that really needed

Problem: For a user who has installed MetaMask and opened the Validators DApp for the first time in the current browser's session, the DApp asks permissions to get access to the list of accounts in MetaMask. But the app doesn't need to know the list of user's accounts until validator's Voting Key is really needed for some operation.

Solution: call window.ethereum.enable only when DApp requires Voting Key to take some action which supposes transaction signing (when the user goes to Set Metadata page or wants to Confirm/Finalize on Pending Changes page).

UX/UI - Verify/Finalize Validator's Data

Confirming a validator's metadata: there needs to be verbiage on the 'pending changes' tab to compel another validator that is confirming and/or finalizing to either verify the information via a different channel, know that the information is correct, and/or reach out to the new validator that the information is correct.

I could see people otherwise hitting 'ok' without giving this much thought - potentially resulting in bad data and having to re-do work later down the line.

Network switcher is not displayed

In an old version of the Validators DApp we had a network switcher at the top right corner which allowed us to switch between networks if MetaMask is not installed:

async onNetworkChange(e) {
this.setState({ loading: true })
const netId = e.value
const web3 = setWeb3(netId)
networkAddresses({ netId }).then(async config => {
const { addresses } = config
await this.initContracts({ web3, netId, addresses })
})
}

Please return this switcher back. It seemed to be removed with the latest changes made in January 2019.

(Feature) Make Validators DApp display company info for xDai Network

xDai network will have companies as validators, so UI needs to be changed to be able to display company info instead of notary info.

A company as validator will only have the next data:

  • wallet address (miningKey)
  • company name
  • contact email
  • creation date

So, the validator card for the company should look like this:

image

Also, the Set Metadata page must let the validator mark the Company checkbox (to let the DApp know that the validator is a company, not a notary) and enter company's contact e-mail.

The company name should be stored in the existing firstName field of ValidatorMetadata contract. There're two additional fields should be added to the contract: contactEmail (bytes32) and isCompany (bool).

Display physical addresses status based on voting key

It turns out, most validators use their voting key to send postcards in PoPA.

So it would be better to fetched physical addresses based on that key (except for MoC who doesn't have voting key). If there are no addresses on that voting key or voting key doesn't exist - retry fetching by mining key.

Retrieve validators' physical addresses from PoPA dapp

  • Retrieve validators' physical addresses from PoPA dapp rather than from validators dapp registry.
  • Display the physical address in the same way it's being displayed nowadays. Evaluate adding a green circle (or any other visual aid) to state the fact of confirmation.

Open questions may have to be addressed in new issues:

  1. Display only confirmed physical addresses or can we display unconfirmed ones (with some visual aid to reflect the fact of the pending confirmation)
  2. Can a validator have multiple physical addresses? How to deal with this from a frontend perspective?
  3. Evaluate removing physical addresses from validators dapp registry

Confirm and Finalize buttons don't work on the `Pending Changes` page

We have a pending change for Kovan network: https://validators.poa.network/poa-dapps-validators/pending-changes

image

When clicking on the Confirm or Finalize button the miningkey attribute is empty for some reason:

const miningKey = event.currentTarget.getAttribute('miningkey')

It is set on the line

return React.cloneElement(child, { miningkey: validator.address })
where it is not empty.

@gabitoesmiapodo any idea how to fix this?

Coins stuck in Nifty wallet

Hey all. If any one!
Trying to send on Ethereum.
Have no probs sending ETH.
But one coin - when trying to send from Nifty to MetaMask - always gets: "Transaction Error. Exception thrown in contract code."
With a sky high gas estimation, and Not enough balance to send etc.
Am new to Nifty. Can any one say what i´m doing wrong?
Many thanks.

(Bug) "Pending changes" page shows duplicated rows

When I create pending change I see duplicated rows: http://prntscr.com/j05jd4 - the number of duplicated rows is equal to the number of previous pending changes creations.

I.e. if I created two pending changes before and I create a new one, I will see three pending changes. And so on.

I think the reason is in the next line of src/contracts/Metadata.contract.js:

let allChanges = await this.metadataInstance.getPastEvents('ChangeRequestInitiated', {fromBlock: 0});

The ChangeRequestInitiated event is tracked from the first block.

METAMASK- Used Chainswap from Eth to BSC then: ALERT: Transaction Error. Exception thrown in contract code.

Can anyone help me sort this problem? I was trying to get my COURT from the Eth chain to the BSC chain so that I can stake them for Governance. Everything went well, swapped the tokens over, but when I try to depost them in the OptionRoom dAPP gvoernance page, I get the message "ALERT: Transaction Error. Exception thrown in contract code."

So, I don't want to hit the confirm button because I'm assuming this means something has gone wrong.

(see attachment for
Metamask Problem
Metamask Problem

screenshot)

Readme.md page is missing description and purpose of the app

  • What is this app about
  • What you can do in the app as a validator
  • What you can do in the app as a contributor/token holder
  • Which networks are supported

Also, I don't understand a purpose of screenshots in Readme. The app is available using a link. How to interact with the app should be available in wiki

(Bug) Validator expiration date incorrect for different time zones

Validator in Eastern time zone set metadata expiration date to 01/31/2025 and others who have verified in a different time zone had seen 01/30/2025

This seems to be an issue with which "time" was used as a base for the expiration date. Possible to convert validator input directly to unix time for storage or to use some type of string with validation rules.

(Feature) Handle multiple addresses from PoPA

Issues #75 and #78 render only one address from PoPA on the UI, but the ProoOfPhysicalAddress contract can store multiple confirmed and unconfirmed physical addressed of a given validator. This ticket is meant to cover these scenarios and how the UI should render the data.

Some suggestions:

  • Render the first (confirmed or unconfirmed) physical address and show a tooltip/accordeon/etc to reveal the extra addresses.
  • Just a tooltip that states that the validator has multiple addresses, either confirmed or unconfirmed.
  • A link to the PoPA DApp, although we should add the corresponding feature to the UI of the latter DApp.

(Fix) Update DApp loading code considering upcoming Breaking Change in MetaMask

Problem: On November 2nd, 2018 MetaMask and other DApp browsers will stop exposing user accounts by default. Instead, dapps must request access using a new provider method: provider.enable(). Detailed info is available here: https://medium.com/metamask/https-medium-com-metamask-breaking-change-injecting-web3-7722797916a8

Solution: Fix the code which loads DApp according to instructions from What this means for developers section of the article mentioned above.

(Feature) Drop or Deprecate validators' address info from ValidatorMetadata.sol

Assuming the prioritization in issue #78 has been made, this issue covers, either:

  • "Stop showing the physical address metadata from ValidatorMetadata.sol" (i.e. drop its usage) and remove/hide the corresponding set Metadata form fields + a link to the PoPA DApp, or...
  • "Still show the physical address metadata from ValidatorMetadata.sol but highlight the fact that it has a low priority information is unconfirmed" (i.e. eventually deprecate its usage).

After the decision has been made, update the description of the ticket with more detailed requirements.

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.