);
}
-
- onHideApp = (id) => {
- const { hidden } = this.state;
- const newHidden = hidden.concat(id);
-
- this.setState({ hidden: newHidden });
- writeHiddenApps(newHidden);
- }
-
- onShowApp = (id) => {
- const { hidden } = this.state;
- const newHidden = hidden.filter((_id) => _id !== id);
-
- this.setState({ hidden: newHidden });
- writeHiddenApps(newHidden);
- }
-
- openModal = () => {
- this.setState({ modalOpen: true });
- };
-
- closeModal = () => {
- this.setState({ modalOpen: false });
- };
-
- loadAvailableApps () {
- const { api } = this.context;
-
- fetchAvailable(api)
- .then((available) => {
- this.setState({
- available,
- hidden: readHiddenApps()
- });
-
- this.loadContent();
- });
- }
-
- loadContent () {
- const { api } = this.context;
- const { available } = this.state;
- const { dappReg } = Contracts.get();
-
- return Promise
- .all(available.map((app) => dappReg.getImage(app.id)))
- .then((images) => {
- const _available = images
- .map(hashToImageUrl)
- .map((image, index) => Object.assign({}, available[index], { image }));
-
- this.setState({ available: _available });
- const _networkApps = _available.filter((app) => app.network);
-
- return Promise
- .all(_networkApps.map((app) => dappReg.getContent(app.id)))
- .then((content) => {
- const networkApps = content.map((_contentHash, index) => {
- const networkApp = _networkApps[index];
- const contentHash = api.util.bytesToHex(_contentHash).substr(2);
- const app = _available.find((_app) => _app.id === networkApp.id);
-
- console.log(`found content for ${app.id} at ${contentHash}`);
- return Object.assign({}, app, { contentHash });
- });
-
- this.setState({
- available: _available.map((app) => {
- return Object.assign({}, networkApps.find((napp) => app.id === napp.id) || app);
- })
- });
- });
- })
- .catch((error) => {
- console.warn('loadImages', error);
- });
- }
}
diff --git a/js/src/views/Dapps/dappsStore.js b/js/src/views/Dapps/dappsStore.js
new file mode 100644
index 000000000..443a58649
--- /dev/null
+++ b/js/src/views/Dapps/dappsStore.js
@@ -0,0 +1,256 @@
+// Copyright 2015, 2016 Ethcore (UK) Ltd.
+// This file is part of Parity.
+
+// Parity is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Parity is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Parity. If not, see .
+
+import { action, computed, observable } from 'mobx';
+
+import Contracts from '../../contracts';
+import { hashToImageUrl } from '../../redux/util';
+
+const builtinApps = [
+ {
+ id: '0xf9f2d620c2e08f83e45555247146c62185e4ab7cf82a4b9002a265a0d020348f',
+ url: 'basiccoin',
+ name: 'Token Deployment',
+ description: 'Deploy new basic tokens that you are able to send around',
+ author: 'Parity Team ',
+ version: '1.0.0'
+ },
+ {
+ id: '0xd1adaede68d344519025e2ff574650cd99d3830fe6d274c7a7843cdc00e17938',
+ url: 'registry',
+ name: 'Registry',
+ description: 'A global registry of addresses on the network',
+ author: 'Parity Team ',
+ version: '1.0.0'
+ },
+ {
+ id: '0x0a8048117e51e964628d0f2d26342b3cd915248b59bcce2721e1d05f5cfa2208',
+ url: 'tokenreg',
+ name: 'Token Registry',
+ description: 'A registry of transactable tokens on the network',
+ author: 'Parity Team ',
+ version: '1.0.0'
+ },
+ {
+ id: '0xf49089046f53f5d2e5f3513c1c32f5ff57d986e46309a42d2b249070e4e72c46',
+ url: 'signaturereg',
+ name: 'Method Registry',
+ description: 'A registry of method signatures for lookups on transactions',
+ author: 'Parity Team ',
+ version: '1.0.0'
+ },
+ {
+ id: '0x058740ee9a5a3fb9f1cfa10752baec87e09cc45cd7027fd54708271aca300c75',
+ url: 'githubhint',
+ name: 'GitHub Hint',
+ description: 'A mapping of GitHub URLs to hashes for use in contracts as references',
+ author: 'Parity Team ',
+ version: '1.0.0'
+ }
+];
+
+export default class DappsStore {
+ @observable apps = [];
+ @observable hidden = [];
+ @observable modalOpen = false;
+
+ constructor (api) {
+ this._api = api;
+
+ this._readHiddenApps();
+ this._fetch();
+ }
+
+ @computed get visible () {
+ return this.apps.filter((app) => !this.hidden.includes(app.id));
+ }
+
+ @action openModal = () => {
+ this.modalOpen = true;
+ }
+
+ @action closeModal = () => {
+ this.modalOpen = false;
+ }
+
+ @action hideApp = (id) => {
+ this.hidden = this.hidden.concat(id);
+ this._writeHiddenApps();
+ }
+
+ @action showApp = (id) => {
+ this.hidden = this.hidden.filter((_id) => _id !== id);
+ this._writeHiddenApps();
+ }
+
+ _getHost (api) {
+ return process.env.NODE_ENV === 'production'
+ ? this._api.dappsUrl
+ : '';
+ }
+
+ _fetch () {
+ Promise
+ .all([
+ this._fetchLocal(),
+ this._fetchRegistry()
+ ])
+ .then(([localApps, registryApps]) => {
+ this.apps = []
+ .concat(localApps)
+ .concat(registryApps)
+ .filter((app) => app.id)
+ .sort((a, b) => (a.name || '').localeCompare(b.name || ''));
+ })
+ .catch((error) => {
+ console.warn('DappStore:fetch', error);
+ });
+ }
+
+ _fetchRegistry () {
+ const { dappReg } = Contracts.get();
+
+ return dappReg
+ .count()
+ .then((_count) => {
+ const count = _count.toNumber();
+ const promises = [];
+
+ for (let index = 0; index < count; index++) {
+ promises.push(dappReg.at(index));
+ }
+
+ return Promise.all(promises);
+ })
+ .then((appsInfo) => {
+ const appIds = appsInfo.map(([appId, owner]) => {
+ return this._api.util.bytesToHex(appId);
+ });
+
+ return Promise
+ .all([
+ Promise.all(appIds.map((appId) => dappReg.getImage(appId))),
+ Promise.all(appIds.map((appId) => dappReg.getContent(appId))),
+ Promise.all(appIds.map((appId) => dappReg.getManifest(appId)))
+ ])
+ .then(([imageIds, contentIds, manifestIds]) => {
+ return appIds.map((appId, index) => {
+ const app = builtinApps.find((ba) => ba.id === appId) || {
+ id: appId,
+ contentHash: this._api.util.bytesToHex(contentIds[index]).substr(2),
+ manifestHash: this._api.util.bytesToHex(manifestIds[index]).substr(2),
+ type: 'network'
+ };
+
+ app.image = hashToImageUrl(imageIds[index]);
+ app.type = app.type || 'builtin';
+
+ return app;
+ });
+ });
+ })
+ .then((apps) => {
+ return Promise
+ .all(apps.map((app) => {
+ return app.manifestHash
+ ? this._fetchManifest(app.manifestHash)
+ : null;
+ }))
+ .then((manifests) => {
+ return apps.map((app, index) => {
+ const manifest = manifests[index];
+
+ if (manifest) {
+ app.manifestHash = null;
+ Object.keys(manifest)
+ .filter((key) => key !== 'id')
+ .forEach((key) => {
+ app[key] = manifest[key];
+ });
+ }
+
+ return app;
+ });
+ })
+ .then((apps) => {
+ return apps.filter((app) => {
+ return !app.manifestHash && app.id;
+ });
+ });
+ })
+ .catch((error) => {
+ console.warn('DappsStore:fetchRegistry', error);
+ });
+ }
+
+ _fetchManifest (manifestHash, count = 0) {
+ return fetch(`${this._getHost()}/api/content/${manifestHash}/`)
+ .then((response) => {
+ if (response.ok) {
+ return response.json();
+ }
+
+ if (count < 1) {
+ return this._fetchManifest(manifestHash, count + 1);
+ }
+
+ return null;
+ })
+ .catch(() => {
+ if (count < 1) {
+ return this._fetchManifest(manifestHash, count + 1);
+ }
+
+ return null;
+ });
+ }
+
+ _fetchLocal () {
+ return fetch(`${this._getHost()}/api/apps`)
+ .then((response) => {
+ return response.ok
+ ? response.json()
+ : [];
+ })
+ .then((localApps) => {
+ return localApps
+ .filter((app) => app && app.id && !['ui'].includes(app.id))
+ .map((app) => {
+ app.type = 'local';
+ return app;
+ });
+ })
+ .catch((error) => {
+ console.warn('DappsStore:fetchLocal', error);
+ });
+ }
+
+ _readHiddenApps () {
+ const stored = localStorage.getItem('hiddenApps');
+
+ if (stored) {
+ try {
+ this.hidden = JSON.parse(stored);
+ } catch (error) {
+ console.warn('DappsStore:readHiddenApps', error);
+ }
+ }
+ }
+
+ _writeHiddenApps () {
+ localStorage.setItem('hiddenApps', JSON.stringify(this.hidden));
+ }
+}
diff --git a/js/src/views/Dapps/hidden.js b/js/src/views/Dapps/hidden.js
deleted file mode 100644
index fa5458bac..000000000
--- a/js/src/views/Dapps/hidden.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015, 2016 Ethcore (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-const defaultHidden = [];
-
-export function readHiddenApps () {
- const stored = localStorage.getItem('hiddenApps');
-
- if (stored) {
- try {
- return JSON.parse(stored);
- } catch (error) {
- console.warn('readHiddenApps', error);
- }
- }
-
- return defaultHidden;
-}
-
-export function writeHiddenApps (hidden) {
- localStorage.setItem('hiddenApps', JSON.stringify(hidden));
-}
diff --git a/js/src/views/Dapps/registry.js b/js/src/views/Dapps/registry.js
deleted file mode 100644
index 5502bd3ff..000000000
--- a/js/src/views/Dapps/registry.js
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2015, 2016 Ethcore (UK) Ltd.
-// This file is part of Parity.
-
-// Parity is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Parity is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
-
-import BigNumber from 'bignumber.js';
-
-const builtinApps = [
- {
- id: '0xf9f2d620c2e08f83e45555247146c62185e4ab7cf82a4b9002a265a0d020348f',
- url: 'basiccoin',
- name: 'Token Deployment',
- description: 'Deploy new basic tokens that you are able to send around',
- author: 'Parity Team ',
- version: '1.0.0'
- },
- {
- id: '0xd1adaede68d344519025e2ff574650cd99d3830fe6d274c7a7843cdc00e17938',
- url: 'registry',
- name: 'Registry',
- description: 'A global registry of addresses on the network',
- author: 'Parity Team ',
- version: '1.0.0'
- },
- {
- id: '0x0a8048117e51e964628d0f2d26342b3cd915248b59bcce2721e1d05f5cfa2208',
- url: 'tokenreg',
- name: 'Token Registry',
- description: 'A registry of transactable tokens on the network',
- author: 'Parity Team ',
- version: '1.0.0'
- },
- {
- id: '0xf49089046f53f5d2e5f3513c1c32f5ff57d986e46309a42d2b249070e4e72c46',
- url: 'signaturereg',
- name: 'Method Registry',
- description: 'A registry of method signatures for lookups on transactions',
- author: 'Parity Team ',
- version: '1.0.0'
- },
- {
- id: '0x058740ee9a5a3fb9f1cfa10752baec87e09cc45cd7027fd54708271aca300c75',
- url: 'githubhint',
- name: 'GitHub Hint',
- description: 'A mapping of GitHub URLs to hashes for use in contracts as references',
- author: 'Parity Team ',
- version: '1.0.0',
- secure: true
- }
-];
-
-// TODO: This is just since we are moving gavcoin to its own repo, for a proper network solution
-// we need to pull the network apps from the dapp registry. (Builtins & local apps unaffected)
-// TODO: Manifest needs to be pulled from the content as well, however since the content may or may
-// not be available locally (and refreshes work for index, and will give a 503), we are putting it
-// in here. This part needs to be cleaned up.
-const networkApps = [
- {
- id: '0xd798a48831b4ccdbc71de206a1d6a4aa73546c7b6f59c22a47452af414dc64d6',
- name: 'GAVcoin',
- description: 'Manage your GAVcoins, the hottest new property in crypto',
- author: 'Gavin Wood',
- version: '1.0.0'
- }
-];
-
-function getHost (api) {
- return process.env.NODE_ENV === 'production'
- ? api.dappsUrl
- : '';
-}
-
-export function fetchAvailable (api) {
- return fetch(`${getHost(api)}/api/apps`)
- .then((response) => {
- return response.ok
- ? response.json()
- : [];
- })
- .catch((error) => {
- console.warn('fetchAvailable', error);
- return [];
- })
- .then((_localApps) => {
- const localApps = _localApps
- .filter((app) => !['ui'].includes(app.id))
- .map((app) => {
- app.type = 'local';
- return app;
- });
-
- return api.parity
- .registryAddress()
- .then((registryAddress) => {
- if (new BigNumber(registryAddress).eq(0)) {
- return [];
- }
-
- const _builtinApps = builtinApps
- .map((app) => {
- app.type = 'builtin';
- return app;
- });
-
- return networkApps
- .map((app) => {
- app.type = 'network';
- return app;
- })
- .concat(_builtinApps);
- })
- .then((registryApps) => {
- return registryApps
- .concat(localApps)
- .sort((a, b) => (a.name || '').localeCompare(b.name || ''));
- });
- })
- .catch((error) => {
- console.warn('fetchAvailable', error);
- });
-}
-
-export function fetchManifest (api, app, contentHash) {
- return fetch(`${getHost(api)}/${contentHash}/manifest.json`)
- .then((response) => {
- return response.ok
- ? response.json()
- : {};
- })
- .then((manifest) => {
- Object.keys.forEach((key) => {
- app[key] = manifest[key];
- });
-
- return app;
- })
- .catch((error) => {
- console.warn('fetchManifest', error);
- });
-}
diff --git a/js/src/views/Settings/Proxy/proxy.js b/js/src/views/Settings/Proxy/proxy.js
index db32d3461..69e415d1f 100644
--- a/js/src/views/Settings/Proxy/proxy.js
+++ b/js/src/views/Settings/Proxy/proxy.js
@@ -35,7 +35,7 @@ export default class Proxy extends Component {
-
The proxy setup allows you to access Parity and all associated decentralized applications via memororable addresses.
+
The proxy setup allows you to access Parity and all associated decentralized applications via memorable addresses.
diff --git a/js/src/views/Settings/Views/defaults.js b/js/src/views/Settings/Views/defaults.js
index 3d1eb889f..819e3938d 100644
--- a/js/src/views/Settings/Views/defaults.js
+++ b/js/src/views/Settings/Views/defaults.js
@@ -49,7 +49,7 @@ const defaultViews = {
label: 'Applications',
route: '/apps',
value: 'app',
- description: 'Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the newtork.'
+ description: 'Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.'
},
contracts: {
diff --git a/js/src/views/Settings/Views/views.js b/js/src/views/Settings/Views/views.js
index 27dcc7ee4..a485876c8 100644
--- a/js/src/views/Settings/Views/views.js
+++ b/js/src/views/Settings/Views/views.js
@@ -40,7 +40,7 @@ class Views extends Component {
Manage the available application views, using only the parts of the application that is applicable to you.
Are you an end-user? The defaults are setups for both beginner and advanced users alike.
-
Are you a developer? Add some features to manage contracts are interact with application develoyments.
+
Are you a developer? Add some features to manage contracts are interact with application deployments.
Are you a miner or run a large-scale node? Add the features to give you all the information needed to watch the node operation.
diff --git a/parity/cli/config.full.toml b/parity/cli/config.full.toml
index dcba8dbee..841cf5f24 100644
--- a/parity/cli/config.full.toml
+++ b/parity/cli/config.full.toml
@@ -12,7 +12,7 @@ unlock = ["0xdeadbeefcafe0000000000000000000000000000"]
password = ["~/.safe/password.file"]
keys_iterations = 10240
-[signer]
+[ui]
force = false
disable = false
port = 8180
diff --git a/parity/cli/config.toml b/parity/cli/config.toml
index e6f01e1ae..c9bd563a8 100644
--- a/parity/cli/config.toml
+++ b/parity/cli/config.toml
@@ -8,7 +8,7 @@ chain = "./chain.json"
unlock = ["0x1", "0x2", "0x3"]
password = ["passwdfile path"]
-[signer]
+[ui]
disable = true
[network]
diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs
index 12536e444..3ad6259b8 100644
--- a/parity/cli/mod.rs
+++ b/parity/cli/mod.rs
@@ -90,18 +90,18 @@ usage! {
flag_keys_iterations: u32 = 10240u32,
or |c: &Config| otry!(c.account).keys_iterations.clone(),
- flag_force_signer: bool = false,
- or |c: &Config| otry!(c.signer).force.clone(),
- flag_no_signer: bool = false,
- or |c: &Config| otry!(c.signer).disable.clone(),
- flag_signer_port: u16 = 8180u16,
- or |c: &Config| otry!(c.signer).port.clone(),
- flag_signer_interface: String = "local",
- or |c: &Config| otry!(c.signer).interface.clone(),
- flag_signer_path: String = "$HOME/.parity/signer",
- or |c: &Config| otry!(c.signer).path.clone(),
+ flag_force_ui: bool = false,
+ or |c: &Config| otry!(c.ui).force.clone(),
+ flag_no_ui: bool = false,
+ or |c: &Config| otry!(c.ui).disable.clone(),
+ flag_ui_port: u16 = 8180u16,
+ or |c: &Config| otry!(c.ui).port.clone(),
+ flag_ui_interface: String = "local",
+ or |c: &Config| otry!(c.ui).interface.clone(),
+ flag_ui_path: String = "$HOME/.parity/signer",
+ or |c: &Config| otry!(c.ui).path.clone(),
// NOTE [todr] For security reasons don't put this to config files
- flag_signer_no_validation: bool = false, or |_| None,
+ flag_ui_no_validation: bool = false, or |_| None,
// -- Networking Options
flag_warp: bool = false,
@@ -271,7 +271,7 @@ usage! {
struct Config {
parity: Option,
account: Option,
- signer: Option,
+ ui: Option,
network: Option,
rpc: Option,
ipc: Option,
@@ -302,7 +302,7 @@ struct Account {
}
#[derive(Default, Debug, PartialEq, RustcDecodable)]
-struct Signer {
+struct Ui {
force: Option,
disable: Option,
port: Option,
@@ -418,7 +418,7 @@ struct Misc {
mod tests {
use super::{
Args, ArgsError,
- Config, Operating, Account, Signer, Network, Rpc, Ipc, Dapps, Mining, Footprint, Snapshots, VM, Misc
+ Config, Operating, Account, Ui, Network, Rpc, Ipc, Dapps, Mining, Footprint, Snapshots, VM, Misc
};
use toml;
@@ -511,12 +511,12 @@ mod tests {
flag_password: vec!["~/.safe/password.file".into()],
flag_keys_iterations: 10240u32,
- flag_force_signer: false,
- flag_no_signer: false,
- flag_signer_port: 8180u16,
- flag_signer_interface: "127.0.0.1".into(),
- flag_signer_path: "$HOME/.parity/signer".into(),
- flag_signer_no_validation: false,
+ flag_force_ui: false,
+ flag_no_ui: false,
+ flag_ui_port: 8180u16,
+ flag_ui_interface: "127.0.0.1".into(),
+ flag_ui_path: "$HOME/.parity/signer".into(),
+ flag_ui_no_validation: false,
// -- Networking Options
flag_warp: true,
@@ -675,7 +675,7 @@ mod tests {
password: Some(vec!["passwdfile path".into()]),
keys_iterations: None,
}),
- signer: Some(Signer {
+ ui: Some(Ui {
force: None,
disable: Some(true),
port: None,
diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt
index 8f453d874..ba27c4902 100644
--- a/parity/cli/usage.txt
+++ b/parity/cli/usage.txt
@@ -43,28 +43,29 @@ Operating Options:
Account Options:
--unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution.
ACCOUNTS is a comma-delimited list of addresses.
- Implies --no-signer. (default: {flag_unlock:?})
+ Implies --no-ui. (default: {flag_unlock:?})
--password FILE Provide a file containing a password for unlocking
an account. Leading and trailing whitespace is trimmed.
(default: {flag_password:?})
--keys-iterations NUM Specify the number of iterations to use when
deriving key from the password (bigger is more
secure) (default: {flag_keys_iterations}).
- --force-signer Enable Trusted Signer WebSocket endpoint used by
- Signer UIs, even when --unlock is in use.
- (default: ${flag_force_signer})
- --no-signer Disable Trusted Signer WebSocket endpoint used by
- Signer UIs. (default: ${flag_no_signer})
- --signer-port PORT Specify the port of Trusted Signer server
- (default: {flag_signer_port}).
- --signer-interface IP Specify the hostname portion of the Trusted Signer
+
+UI Options:
+ --force-ui Enable Trusted UI WebSocket endpoint,
+ even when --unlock is in use. (default: ${flag_force_ui})
+ --no-ui Disable Trusted UI WebSocket endpoint.
+ (default: ${flag_no_ui})
+ --ui-port PORT Specify the port of Trusted UI server
+ (default: {flag_ui_port}).
+ --ui-interface IP Specify the hostname portion of the Trusted UI
server, IP should be an interface's IP address,
- or local (default: {flag_signer_interface}).
- --signer-path PATH Specify directory where Signer UIs tokens should
- be stored. (default: {flag_signer_path})
- --signer-no-validation Disable Origin and Host headers validation for
- Trusted Signer. WARNING: INSECURE. Used only for
- development. (default: {flag_signer_no_validation})
+ or local (default: {flag_ui_interface}).
+ --ui-path PATH Specify directory where Trusted UIs tokens should
+ be stored. (default: {flag_ui_path})
+ --ui-no-validation Disable Origin and Host headers validation for
+ Trusted UI. WARNING: INSECURE. Used only for
+ development. (default: {flag_ui_no_validation})
Networking Options:
--warp Enable syncing from the snapshot over the network. (default: {flag_warp})
diff --git a/parity/configuration.rs b/parity/configuration.rs
index 0617e76f3..aff868ce2 100644
--- a/parity/configuration.rs
+++ b/parity/configuration.rs
@@ -95,7 +95,7 @@ impl Configuration {
let wal = !self.args.flag_fast_and_loose;
let warp_sync = self.args.flag_warp;
let geth_compatibility = self.args.flag_geth;
- let signer_port = self.signer_port();
+ let ui_port = self.ui_port();
let dapps_conf = self.dapps_config();
let signer_conf = self.signer_config();
let format = try!(self.format());
@@ -243,7 +243,7 @@ impl Configuration {
vm_type: vm_type,
warp_sync: warp_sync,
geth_compatibility: geth_compatibility,
- signer_port: signer_port,
+ ui_port: ui_port,
net_settings: self.network_settings(),
dapps_conf: dapps_conf,
signer_conf: signer_conf,
@@ -396,11 +396,11 @@ impl Configuration {
fn signer_config(&self) -> SignerConfiguration {
SignerConfiguration {
- enabled: self.signer_enabled(),
- port: self.args.flag_signer_port,
- interface: self.signer_interface(),
+ enabled: self.ui_enabled(),
+ port: self.args.flag_ui_port,
+ interface: self.ui_interface(),
signer_path: self.directories().signer,
- skip_origin_validation: self.args.flag_signer_no_validation,
+ skip_origin_validation: self.args.flag_ui_no_validation,
}
}
@@ -595,7 +595,7 @@ impl Configuration {
);
let dapps_path = replace_home(&self.args.flag_dapps_path);
- let signer_path = replace_home(&self.args.flag_signer_path);
+ let ui_path = replace_home(&self.args.flag_ui_path);
if self.args.flag_geth && !cfg!(windows) {
let geth_root = if self.args.flag_testnet { path::ethereum::test() } else { path::ethereum::default() };
@@ -616,7 +616,7 @@ impl Configuration {
keys: keys_path,
db: db_path,
dapps: dapps_path,
- signer: signer_path,
+ signer: ui_path,
}
}
@@ -628,16 +628,16 @@ impl Configuration {
}
}
- fn signer_port(&self) -> Option {
- if !self.signer_enabled() {
+ fn ui_port(&self) -> Option {
+ if !self.ui_enabled() {
None
} else {
- Some(self.args.flag_signer_port)
+ Some(self.args.flag_ui_port)
}
}
- fn signer_interface(&self) -> String {
- match self.args.flag_signer_interface.as_str() {
+ fn ui_interface(&self) -> String {
+ match self.args.flag_ui_interface.as_str() {
"local" => "127.0.0.1",
x => x,
}.into()
@@ -662,16 +662,16 @@ impl Configuration {
!self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(feature = "dapps")
}
- fn signer_enabled(&self) -> bool {
- if self.args.flag_force_signer {
+ fn ui_enabled(&self) -> bool {
+ if self.args.flag_force_ui {
return true;
}
- let signer_disabled = self.args.flag_unlock.is_some() ||
+ let ui_disabled = self.args.flag_unlock.is_some() ||
self.args.flag_geth ||
- self.args.flag_no_signer;
+ self.args.flag_no_ui;
- !signer_disabled
+ !ui_disabled
}
}
@@ -853,7 +853,7 @@ mod tests {
wal: true,
vm_type: Default::default(),
geth_compatibility: false,
- signer_port: Some(8180),
+ ui_port: Some(8180),
net_settings: Default::default(),
dapps_conf: Default::default(),
signer_conf: Default::default(),
@@ -976,11 +976,11 @@ mod tests {
// when
let conf0 = parse(&["parity", "--geth"]);
- let conf1 = parse(&["parity", "--geth", "--force-signer"]);
+ let conf1 = parse(&["parity", "--geth", "--force-ui"]);
// then
- assert_eq!(conf0.signer_enabled(), false);
- assert_eq!(conf1.signer_enabled(), true);
+ assert_eq!(conf0.ui_enabled(), false);
+ assert_eq!(conf1.ui_enabled(), true);
}
#[test]
@@ -991,7 +991,7 @@ mod tests {
let conf0 = parse(&["parity", "--unlock", "0x0"]);
// then
- assert_eq!(conf0.signer_enabled(), false);
+ assert_eq!(conf0.ui_enabled(), false);
}
#[test]
@@ -999,10 +999,10 @@ mod tests {
// given
// when
- let conf0 = parse(&["parity", "--signer-path", "signer"]);
- let conf1 = parse(&["parity", "--signer-path", "signer", "--signer-no-validation"]);
- let conf2 = parse(&["parity", "--signer-path", "signer", "--signer-port", "3123"]);
- let conf3 = parse(&["parity", "--signer-path", "signer", "--signer-interface", "test"]);
+ let conf0 = parse(&["parity", "--ui-path", "signer"]);
+ let conf1 = parse(&["parity", "--ui-path", "signer", "--ui-no-validation"]);
+ let conf2 = parse(&["parity", "--ui-path", "signer", "--ui-port", "3123"]);
+ let conf3 = parse(&["parity", "--ui-path", "signer", "--ui-interface", "test"]);
// then
assert_eq!(conf0.signer_config(), SignerConfiguration {
diff --git a/parity/run.rs b/parity/run.rs
index d94eafc55..2af0d35ca 100644
--- a/parity/run.rs
+++ b/parity/run.rs
@@ -82,7 +82,7 @@ pub struct RunCmd {
pub wal: bool,
pub vm_type: VMType,
pub geth_compatibility: bool,
- pub signer_port: Option,
+ pub ui_port: Option,
pub net_settings: NetworkSettings,
pub dapps_conf: dapps::Configuration,
pub signer_conf: signer::Configuration,
@@ -262,7 +262,7 @@ pub fn execute(cmd: RunCmd, logger: Arc) -> Result<(), String> {
let deps_for_rpc_apis = Arc::new(rpc_apis::Dependencies {
signer_service: Arc::new(rpc_apis::SignerService::new(move || {
signer::generate_new_token(signer_path.clone()).map_err(|e| format!("{:?}", e))
- }, cmd.signer_port)),
+ }, cmd.ui_port)),
snapshot: snapshot_service.clone(),
client: client.clone(),
sync: sync_provider.clone(),
diff --git a/parity/signer.rs b/parity/signer.rs
index b3047c739..a26cc431a 100644
--- a/parity/signer.rs
+++ b/parity/signer.rs
@@ -109,7 +109,7 @@ fn do_start(conf: Configuration, deps: Dependencies) -> Result match err.kind() {
- io::ErrorKind::AddrInUse => Err(format!("Trusted Signer address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --signer-port and --signer-interface options.", addr)),
+ io::ErrorKind::AddrInUse => Err(format!("Trusted UI address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --ui-port and --ui-interface options.", addr)),
_ => Err(format!("Trusted Signer io error: {}", err)),
},
Err(e) => Err(format!("Trusted Signer Error: {:?}", e)),