Forked from Joystream/joystream https://github.com/Joystream/joystream

nsso 9c20758b40 support for acala mandala test network (#3242) 4 лет назад
.github 9d13277bb3 docker image -> stable 4 лет назад
.vscode 7bf992a1bb Remove non-working CI cache (#2387) 5 лет назад
.yarn 3c239810c2 Bump berry (#2715) 4 лет назад
docker 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
packages 9c20758b40 support for acala mandala test network (#3242) 4 лет назад
scripts d35b1a1d10 Optional close on council motions (#3252) 4 лет назад
test d677d64817 UI support for simple payouts (#2509) 4 лет назад
.123trigger 6ffb4ae51a [CI Skip] release/stable 0.45.2 4 лет назад
.babelrc.js 078e2e431a Support enumerable accounts (#102) 6 лет назад
.codeclimate.yml 4f96fc0d3f Merge next into master (#529) 6 лет назад
.dockerignore 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
.editorconfig d85ce9c263 Initial commit 7 лет назад
.env-example 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
.eslintignore 3c239810c2 Bump berry (#2715) 4 лет назад
.eslintrc.js 90200ed2f1 Tests for electron app storage (#3118) 4 лет назад
.gitignore 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
.npmignore d85ce9c263 Initial commit 7 лет назад
.nvmrc 4f96fc0d3f Merge next into master (#529) 6 лет назад
.stylelintrc 978c83d3e1 Add stylelint (testing impacts) (#2524) 5 лет назад
.yarnrc.yml 7bf992a1bb Remove non-working CI cache (#2387) 5 лет назад
BOUNTIES.md 63944662a1 Additional requests for working on bounties (#1704) 5 лет назад
CHANGELOG.md df1c32ca24 CHANGELOG 4 лет назад
CONTRIBUTING.md 449310e0c9 Don't pass UI_MODE/UI_THEME via env (#769) 6 лет назад
Dockerfile 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
I18N.md 5f2f7fcff7 Update I18N.md 4 лет назад
LICENSE 4f96fc0d3f Merge next into master (#529) 6 лет назад
README.md 826598c1b1 Display turnout for poll (#3223) 4 лет назад
babel.config.js d677d64817 UI support for simple payouts (#2509) 4 лет назад
env.sh 19f409023c Add ENV support to the generated site (#2450) 4 лет назад
i18next-scanner.config.js 9cc39d5a07 Publish electron apps on release (#2780) 4 лет назад
jest.config.js d677d64817 UI support for simple payouts (#2509) 4 лет назад
lerna.json 670d624b88 [CI Skip] release/beta 0.51.0-beta.16 4 лет назад
package.json 670d624b88 [CI Skip] release/beta 0.51.0-beta.16 4 лет назад
tsconfig.json 6b3539be58 Remove 123code (not maintained) (#3195) 4 лет назад
yarn.lock 9c20758b40 support for acala mandala test network (#3242) 4 лет назад

README.md

polkadotjs license maintainability

@polkadot/apps

A Portal into the Polkadot and Substrate networks. Provides a view and interaction layer from a browser.

This can be accessed as a hosted application via https://polkadot.js.org/apps/ or you can access the IPFS hosted version via https://polkadot.js.org/apps/ipfs (via hash) or https://dotapps.io (via ipns) to explore any of the supported Polkadot and Substrate chains.

If you run one or more IPFS node(s), pinning the UI (which only gets updated on releases) will make it faster for you and others. You can find details about that below in the IPFS chapter below.

Important If you are a chain developer and would like to add support for your chain to the UI, all the local configuration (API types, settings, logos) can be customized in the apps-config package, complete with instructions of what goes where.

overview

The repo is split into a number of packages, each representing an application. These are -

  • apps This is the main entry point. It handles the selection sidebar and routing to the specific application being displayed.
  • apps-electron Desktop app running apps.
  • page-accounts A basic account management app.
  • page-address-book A basic address management app.
  • page-democracy A basic voting app, allowing votes on activate proposals and referenda.
  • page-explorer A simple block explorer. It only shows the most recent blocks, updating as they become available.
  • page-extrinsics Submission of extrinsics to a node.
  • page-js An online code editor with @polkadot-js/api access to the currently connected node.
  • page-settings A basic settings management app, allowing choice of language, node to connect to, and theme
  • page-staking A basic staking management app, allowing staking and nominations.
  • page-storage A simple node storage query application. Multiple queries can be queued and updates as new values become available.
  • page-toolbox Submission of raw data to RPC endpoints and utility hashing functions.
  • page-transfer A basic account management app, allowing transfer of Units/DOTs between accounts.

In addition the following libraries are also included in the repo. These are to be moved to the @polkadot/ui repository once it reaches a base level of stability and usability. (At this point with the framework being tested on the apps above, it makes development easier having it close)

  • react-components A reactive (using RxJS) application framework with a number of useful shared components.
  • react-signer Signer implementation for apps.
  • react-query Base components that use the RxJS Observable APIs

Development

Contributions are welcome!

To start off, this repo (along with others in the @polkadot family) uses yarn workspaces to organize the code. As such, after cloning dependencies should be installed via yarn, not via npm, the latter will result in broken dependencies.

To get started -

  1. Clone the repo locally, via git clone https://github.com/polkadot-js/apps <optional local path>
  2. Ensure that you have a recent LTS version of Node.js, for development purposes Node >=10.13.0 is recommended.
  3. Ensure that you have a recent version of Yarn, for development purposes Yarn >=1.10.1 is required.
  4. Install the dependencies by running yarn
  5. Ready! Now you can launch the UI (assuming you have a local Polkadot Node running), via yarn run start
  6. Access the UI via http://localhost:3000

Docker

You can run a docker container via -

docker run --rm -it --name polkadot-ui -e WS_URL=ws://someip:9944 -p 80:80 jacogr/polkadot-js-apps:latest

To build a docker container containing local changes -

docker build -t jacogr/polkadot-js-apps .

When using these Docker commands, you can access the UI via http://localhost:80 (or just http://localhost)

IPFS

IPFS allows sharing files in a decentralized manner in a similar fashion the polkadot network exchanges blocks. IPFS works best when many nodes seed the same data. Nodes can seed specific data by pinning them.

You can pin with the following command:

curl -s https://polkadot.js.org/apps/ipfs/pin.json | jq -jr .IpfsHash | xargs -0 -I CID ipfs pin add --progress CID

Here is a script you can save as /usr/local/bin/polkadotjs-ipfs-pin.sh:

#!/usr/bin/env bash

IPFS='/usr/local/bin/ipfs'
curl -s https://polkadot.js.org/apps/ipfs/pin.json | jq -jr .IpfsHash | xargs -0 -I CID $IPFS pin add --progress CID

I suggest to run the script once. The output should be similar to (the CID/Hash will very likely be different though):

$ /usr/local/bin/polkadotjs-ipfs-pin.sh
pinned QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursively

Now that you know the CID (hash), you can check whether the data is already pinned or not:

$ ipfs pin ls | grep QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW
QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursive

Now that we know it works, we can automate that with a cron task. Run crontab -e. If you see only comments, append the following to the file and save:

SHELL=/bin/bash
HOME=/
0 * * * * /usr/local/bin/polkadotjs-ipfs-pin.sh >/dev/null 2>&1

Now our script will run every hours at minute '0' (8:00, 9:00, etc...). To check, we can unpin temporarily:

$ ipfs pin rm QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW
unpinned QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW

Now asking for the CID confirms that is it not there.

$ ipfs pin ls QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW
Error: path 'QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW' is not pinned

Wait until the your cron task runs and try again:

$ ipfs pin ls QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW
QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursive

Tada! This is now automatic and you may forget it.

If you are curious and want to know how many people seed the UI on IPFS, here is the magic command (it may take a while to return the answer as ipfs will search for about 1 minute):

ipfs dht findprovs QmTejwB7mJPBHBoqubjzHSgSxfLMcjnZA3LFefqoQc87VJ | wc -l

If you are current about the content of what you just pinned, you may use the following command:

$ ipfs ls QmTejwB7mJPBHBoqubjzHSgSxfLMcjnZA3LFefqoQc87VJ
QmPJGyqVCcXm238noz7TZDByyGa35qqc8g6sfyXF3KDXZ3 38078   favicon.ico
QmdouVsVE9rMVB84Cy1ehVi1LAGW1fKcqqQxSEjgxJrv7H 668     index.html
QmWHcGf1JCFZCYjZsw52vM5RiJVbcNpX1fo2NyoBKBvtuf -       ipfs/
QmT6NwDsJzMyBs6bMq845nMumeJWbixBfNXA9hdAhAMdSG -       locales/
QmcgiZpwvpT1E1dkSS3zr5je89rZRVocNKPebgWhn3JVTC 2178582 main.ce05dfca.js
QmdnEtuhFDyw5Tjr82bFPzyveFrbkYjJAnUvBvzwT18YGG 337     manifest.json
QmW7gDKHbmtD7sRTqsvyo84bDpyYPZR3w1wQo8pme2q5HC -       next/
Qmd8UnRQiBobm4qb6dhiC1HoQ7SvwZrWJenoN3JPEV3iiF 480594  polkadotjs.3af757ad.js
QmUfXPMfNys8Y8dekuankBx7BHiSAjALCpBDKH6F5DdcNm 628284  react.0cecb00d.css
QmSEgXdQbC1ek9Td1mHy3BRvJpfWHm9zQYegTgAUj1QC4g 924156  react.8f083b49.js
QmfGBgFe2aqf83Wv21m9k5DH2ew89CDj4tydoxJWdK6NNL 1552    runtime.3d77e510.js
QmYPa8jcHH7gfopMALr5XTW4i1QM2xgVBe3NeP11y3tErA -       static/
QmeYBC5EgbccC8NEwXC2rvbd93YiHtTM5xYzqCDohXerDf 859984  vendor.8b793a81.js