Giter VIP home page Giter VIP logo

polkadot-js / apps Goto Github PK

View Code? Open in Web Editor NEW
1.7K 64.0 1.5K 315.81 MB

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.

Home Page: https://dotapps.io

License: Apache License 2.0

JavaScript 0.14% HTML 0.02% TypeScript 99.83% Dockerfile 0.01% Shell 0.01%
polkadot substrate polkadot-js ui blockchain wallet

apps's Issues

Add settings apps, e.g changing api endpoint

  1. Add settings app, packages/app-settings
  2. Allow configuration of WS endpoint, anything allowed (ws://|wss:// prefixed)
  3. Show 2 pre-configured options, one for poc-1 hosted node (wss://poc-1.polkadot.io:9944) and one for locally-running node (ws://127.0.0.1:9944)
  4. WS URL should be stored in localstorage - by default we probably want to pull in WS_URL env variable for the running-instance default.
  5. On changing and setting endpoint via setApiWsUrl (assuming we wrap with ui-react-rx/with/api we probably need to refresh - the API itself won't automatically refresh existing subscriptions (that needs to be fix at the API layer, probably more involved - phase II)

Simple staking app

  • Allows users to stake/unstake
  • Allows a view of current validators + their balances
  • Allows a view of current intentions (i.e. accounts wishing to stake) + their balances
  • indication if any current accounts are validators and/or has the intention to stake (this probably goes on accounts/addresses as well)

UI does not work in FF

Safari also not tested - Babel config is set properly, but none of the dev team has actually tried Chrome, alas, reports are there are some issues..

Add additional metadata on accounts/addresses

Goal:

We want to be able to manage the accounts and addresses better, so the user actually have a better way of categorizing their accounts and, at first glance, be able to see what the account/address relates to.

Background:

With the number of icons, accounts and addresses in the system, it is quite difficult to, at first glance, be able to see what this relates to. On Alexander, my setup has 12+ accounts (for various purposes), and it can be difficult to spot the "right one".

The suggestion here is to to add additional metadata to the saved keyring infomation, initially just focussed on labels that the user can add.

Actions:

  • Add the ability for the user to define custom labels (used either for accounts of addresses) - this can simply be an input with "pick from existing" or "add new"
  • Defined labels are saved in storage (basically anything defined in the accounts/addresses)
  • Re-use this component on accounts and addresses - as mentioned above, just another add/edit input
  • Save this information along with the account. The Keyring supports the meta fields so a "labels" array can just be added with no other overhead.
  • For the AddressSummary and AddressRow components, show the actual attached labels (as available) - this way it is useful wherever it is used in the UI

Optionally:

  • With the AddressRow, AddressSummary components, allow in-place adding of labels. So without adding an account to my addressbook, I can label it with a "+" (This can actually be a "quick add to addresses" functionality - so specify labels & name, save.

Follow-ups:

Once the above is in-place, we can start doing filtering through the UI based on labels. i.e. on staking, I can filter to see only the validators I am interested in, based on their labelling.

Unable to Create account due to colors package error

When running the latest version of polkadot-js, if I click "Create account" on the Accounts page it returns the following error in Chrome Inspector Console Uncaught TypeError: all.splice(...)[0].alpha(...).string is not a function

Show transaction fee when submitting transactions

staking.transactionFee() from storage should be included and shown on-screen when we are submitting an extrinsic. (i.e. it is probably useful to have a "total to be sent" display).

Especially in POC-1, this is confusing for some users - they transfer 1 DOT, however 101 gets deducted (100 DOT tx fee as set). For dev chains this is set to 1 DOT only, i.e. 2 gets deducted.

Convert the hashing to libsodium-wasm for vanity addr

... not a high priority since the functionality is just a "o, this can be cool", however should bring in a nice boost which should make it actually useful. https://github.com/alexcrichton/wasm-sodium

(For the command-line app the generation uses natively compiled sodium (as available), it is faster.)

Probably seeing this bit as a POC, when done properly it is added to the @polkadot/util-crypto, however in that case we probably wnat native & wasm support. So for now, trial with just the vanitygen app.

polkadot-dev-yarn-only: command not found

I pulled the latest changes from the master branch and then switched to the latest Node.js version using NVM with nvm use v10.4.0. I then ran yarn install, but it gave the following error sh: polkadot-dev-yarn-only: command not found:

$ yarn
yarn install v0.24.6
(node:12387) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
warning "[email protected]" has unmet peer dependency "react@^15.0.0 || ^16.0.0".
[4/4] ๐Ÿ“ƒ  Building fresh packages...
$ polkadot-dev-yarn-only
sh: polkadot-dev-yarn-only: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

It's trying to run the line "postinstall": "polkadot-dev-yarn-only", in package.json.
I understand that the intention is that after installing the dependencies into the node_modules/ directory, it'd run indirectly via a shell script the Node.js CLI script that would then be available in ./node_modules/@polkadot/dev/scripts/polkadot-dev-yarn-only.js. When using "postinstall": "polkadot-dev-yarn-only", it tries to calling a binary executable file in node_modules/.bin named polkadot-dev-yarn-only but it doesn't exist and the shell script /node_modules/@polkadot/dev/scripts/polkadot-dev-yarn-only doesn't exist either.

Account edit currently is a bit confusing...

This is just something small... however it is not very obvious that if you change the name the save becomes active. Most will expect to "click before doing". The functionality without extra clicks is not bad, however it is completely non-obvious.

Unable to connect to PoC-2 using WebSockets

I am using the master branch for the latest version of Polkadot to run a Polkadot Node on my local machine. I am using it to connect to PoC-2 Testnet with polkadot --chain=poc-2 --ws-port=8081. Unfortunately it does not appear to be backwards compatible, as poc-1 is no longer an available value for the --chain CLI option in the latest version of Polkadot. If I then run the latest version of Polkadot.js apps portal front-end and try to connect it to PoC-2 using WebSockets with WS_URL=wss://poc-2.polkadot.io:9944 yarn run start and open http://localhost:3000/ in Chrome web browser it gives the following error in Chrome Inspector WebSocket connection to 'wss://poc-2.polkadot.io:9944/' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED. It only works if I connect to PoC-1 via WebSockets with WS_URL=wss://poc-1.polkadot.io:9944 yarn run start. How can I connect to PoC-2 via WebSockets?

Change ui-react/IdentityIcon to PureComponent

Current implementation is probably a bit anti-pattern-ish. (Trying to shoe-horn in a functional component - especially the append is fragile. Do it with a proper component & in-class refs)

Combine "unlock to sign" with packages/ui-signer

Currently we have duplicated logic. It would mean a bit of rework on the signer since it currently has a purpose of unlock, sign & submit, but from an overall perspective we don't want keychain management in multiple places.

Convert components to React.PureComponent

It is currently a (tiny bit) of mental gymnasics since it is not always clear when to use functional or PureComponent. (Well, it is - the latter has state and lifecycle methods). However, moving between files has some context-switching overhead.

It probably makes sense to convert all functional components to PureComponent - slightly less performant (?), however from a "this is how it is done" perspective it makes understanding and contributing easier.

(Not super important, however something to look at)

Cleanup CSS using PostCSS

(Low priority, just for when bored)

Now that we have PostCSS, we can cleanup the CSS nicely, as an example, https://github.com/polkadot-js/apps/blob/master/packages/ui-app/src/styles/components.css -

.ui--output {
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #f5f5f5;
  box-sizing: border-box;
  line-height: 1em;
  margin-bottom: 0.5em;
  padding: 0.75em 1em;
  position: relative;
  word-wrap: break-word;
 
  &.error {
    background: #fff6f6;
    border-color: #e0b4b4;
  } 

  .ui--output-button {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
  }
}

Nesting, variables, slowly does it.

author_submitExtrinsic encoding number[] on master

The serialisation of exterinsics now expects an array of bytes ([255, 245, 69, ..]) instead of a hex string (0xfff545...) - need to wait until a conclusion in reached and a fix is available. For now the enumerable accounts #102 is untested on master, where it actually has effect.

Basic governance app

(Still be be fully expanded)

  1. Shows a list of proposals (either for "general voting" or "council voting")
  2. Allows ability to see the votes, what it actually entails, the time left, etc.
  3. Allows the ability to make a vote on the proposal
  4. Shows own votes slightly differently, i.e. "yes, you have done this" vs "no, you are not involved"
    ...

Use reactive store for account options

i.e.

const options = keyring.getOptions(type);

The above (and the actual comment around extending) does not bode well for things like the chain lookup where the options may change. This is the one place where a MobX (or alike) store can help - which obviously needs to be triggered in int's own right. (Possibly the trigger could be an observable instead of a store?)

What happens currently -

  1. Go to extrinsics page
  2. Start/stop node with dev chain
  3. Testing accounts don't immediately show up, rather leaving and entering the page makes them show

Make telemetry visible as an app

As the telemetry is available, pull it in as an app - the front-end can be pulled-in, the back-end is hosted, i.e. it should connect to the same one. There are probably some smaller changes required on the telemetry app, i.e. not connecting by default to the host. For the most part, should just be a navigation entry and launching.

Not an immediate, telemetry UI should stabilise first.

@maciejhirsz Any additional comments here? (Don't do anything to change/adapt, but would like to explore the possibility in the future)

Better display of accounts/others in storage

i.e. currently a list of accounts will show the addresses, however probably should be expanded to show the actual identitycon as well.

Where param names as displayed, it can be "paramName = paramValue"

Basically take what we have and turn it from a "text-dump" into something that actually looks and feels usable

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.