- Notifications
You must be signed in to change notification settings - Fork1.6k
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.
License
polkadot-js/apps
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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 viahttps://polkadot.js.org/apps/ or you can access the IPFS hosted version viahttps://polkadot.js.org/apps/ipfs (via hash) orhttps://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 inthe apps-config package, complete with instructions of what goes where.
The repo is split into a number of packages, each representing an application.
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 dependenciesshould be installed viayarn, not via npm, the latter will result in broken dependencies.
To get started -
- Clone the repo locally, via
git clone https://github.com/polkadot-js/apps <optional local path> - Ensure that you have a recent LTS version of Node.js, for development purposesNode >= 16 is recommended.
- Ensure that you have a recent version of Yarn, for development purposesYarn >= 1.22 is required.
- Install the dependencies by running
yarn install --frozen-lockfile - Ready! Now you can launch the UI (assuming you have a local Polkadot Node running), via
yarn run start - Access the UI viahttp://localhost:3000
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:latestTo build a docker container containing local changes -
docker build -t jacogr/polkadot-js-apps -f docker/Dockerfile .When using these Docker commands, you can access the UI viahttp://localhost:80 (or justhttp://localhost)
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 bypinning 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 CIDHere is a script you can save as/usr/local/bin/polkadotjs-ipfs-pin.sh:
#!/usr/bin/env bashIPFS='/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 CIDI 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.shpinned QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursivelyNow that you know the CID (hash), you can check whether the data is already pinned or not:
$ ipfs pin ls | grep QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oWQmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursiveNow that we know it works, we can automate that with a cron task. Runcrontab -e.If you see only comments, append the following to the file and save:
SHELL=/bin/bashHOME=/0 * * * * /usr/local/bin/polkadotjs-ipfs-pin.sh >/dev/null 2>&1Now our script will run every hours at minute '0' (8:00, 9:00, etc...). To check, we can unpin temporarily:
$ ipfs pin rm QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oWunpinned QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oWNow asking for the CID confirms that is it not there.
$ ipfs pin ls QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oWError: path 'QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW' is not pinnedWait until the your cron task runs and try again:
$ ipfs pin ls QmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oWQmNYAbzaE8kRAf68YiN3ZuUxgdwroeav3JhicsHsG5b2oW recursiveTada! 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 -lIf you are current about the content of what you just pinned, you may use the following command:
$ ipfs ls QmTejwB7mJPBHBoqubjzHSgSxfLMcjnZA3LFefqoQc87VJQmPJGyqVCcXm238noz7TZDByyGa35qqc8g6sfyXF3KDXZ3 38078 favicon.icoQmdouVsVE9rMVB84Cy1ehVi1LAGW1fKcqqQxSEjgxJrv7H 668 index.htmlQmWHcGf1JCFZCYjZsw52vM5RiJVbcNpX1fo2NyoBKBvtuf - ipfs/QmT6NwDsJzMyBs6bMq845nMumeJWbixBfNXA9hdAhAMdSG - locales/QmcgiZpwvpT1E1dkSS3zr5je89rZRVocNKPebgWhn3JVTC 2178582 main.ce05dfca.jsQmdnEtuhFDyw5Tjr82bFPzyveFrbkYjJAnUvBvzwT18YGG 337 manifest.jsonQmW7gDKHbmtD7sRTqsvyo84bDpyYPZR3w1wQo8pme2q5HC - next/Qmd8UnRQiBobm4qb6dhiC1HoQ7SvwZrWJenoN3JPEV3iiF 480594 polkadotjs.3af757ad.jsQmUfXPMfNys8Y8dekuankBx7BHiSAjALCpBDKH6F5DdcNm 628284 react.0cecb00d.cssQmSEgXdQbC1ek9Td1mHy3BRvJpfWHm9zQYegTgAUj1QC4g 924156 react.8f083b49.jsQmfGBgFe2aqf83Wv21m9k5DH2ew89CDj4tydoxJWdK6NNL 1552 runtime.3d77e510.jsQmYPa8jcHH7gfopMALr5XTW4i1QM2xgVBe3NeP11y3tErA - static/QmeYBC5EgbccC8NEwXC2rvbd93YiHtTM5xYzqCDohXerDf 859984 vendor.8b793a81.jsThe main advantage of using Desktop App is that it by default stores encrypted accounts on the filesystem instead of browser's local storage.Local storage is susceptible to attacks using XSS (Cross-Site Scripting). There's no such risk when with files stored on disk.
The desktop app uses theElectron framework. It provides the same features as web app, the only differencebeing different account storage.
The accounts are stored in the following directories:
- Mac:
~/Library/Application Support/polkadot-apps/polkadot-accounts - Linux:
~/.config/polkadot-apps/polkadot-accounts(or$XDG_CONFIG_HOME/polkadot-apps/polkadot-accountsif$XDG_CONFIG_HOMEis defined) - Windows:
%APPDATA%\polkadot-apps\polkadot-accounts
For more details on the desktop app, head over toElectron package README.
About
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.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.