nos / client Goto Github PK
View Code? Open in Web Editor NEWThe nOS Client
Home Page: https://nos.io
License: MIT License
The nOS Client
Home Page: https://nos.io
License: MIT License
On the authentication window, the Passphrase tab should provide the option for users to create new accounts, and to save them on creation or log-in.
Similar to neon-wallet
, users should be able to select previously saved accounts (only encrypted keys) so they only have to enter their Passphrase to log in.
Currently users can only select networks from a set of predetermined neoscan URLs. We should let users add custom ones.
Since invocations above 10 GAS are no longer free, users should be made aware of the fee when sending an invocation.
The invocation dialogue is currently not displaying any fees when reviewing real invocations.
Before sending a real invocation, the client should do a testinvoke, then display the fee information and the "expected output" retrieved from the test invocation in the invocation confirmation dialogue.
In the case they fee is <=10 GAS
, set displayed fee to "free".
In the case it's >10
GAS, display total GAS fee - 10
as the displayed fee.
withPrompt
HOC should use Confirm
component.withRejectMessage
HOC should use Alert
component.window.alert
function with custom Alert
component. We will have to change the behavior to be promise-based since we can't block JS execution.window.confirm
function with custom Confirm
component. We will have to change the behavior to be promise-based since we can't block JS execution.As part of this work, we will need to ensure these modals are provided one at a time using a queuing system. (This can be a simple redux state, similar to the request queue.)
We should start with implementing unit/integration tests for the nOS API as it's essential to track it's functioning
An error occurs when selecting a network twice and going to the account tab
No errors should occur when going to the account tab
An error does occur
Haven't had a look into it yet
1: login to nOS
2: go to settings
3: switch networks twice (ex: testnet --> coznet --> mainnet)
4: go to account tab
5: Console should display an error regarding an action on an unmounted component
I haven't seen any negative side effects of this issue - although it's a must-fix ^^
Yarn 1.6
Node LTS
windows
Extract neon-wallet's new redux architecture into an npm package so it can be shared. This will serve as the bed for all user actions in the app.
Copy/paste from Discord conversation w/ extra notes at the end.
All our existing IPC requests so far have taken one of two flows.
- dapp -> API -> IPC -> load data -> return result
- dapp -> API -> IPC -> confirm with user -> return result
This one would look more like:
- dapp -> API -> IPC -> load data (?) -> confirm with user -> load data -> return result
I'm realizing there are some bigger implications with the way
RequestProcessor
works right now.
It's currently a queue, and we're only working with the latest request on the stack.
So we basically have 2 options here:
- Keep the queue working like it is, handle this extra call to load data in the same way we have been where the next request can't start processing until this one finishes, but it prevents other things in the queue from kicking off till we're done.
- Make the queue work a bit differently so all requests can happen asynchronously. This would require some extra changes for things that require user confirmation since we don't want one confirmation dialog to pop up on top of another one if two user confirmation requests come in.
I have an idea around how #1 would work, but it's going to be a little bit of a shift in thinking from the existing example of how to do this.
We will basically need more higher order components in the flow.
My thought is that, instead of having the component you're building right now (the one that has the window.confirm call inside of componentDidMount), you would instead need that logic to happen in a higher order component. Denying that would cause onReject to be called, otherwise rendering would continue down the HOC call chain.
If rendering continues down the chain, then we would have another set ofwithCall
,withNullLoader
,withRejectMessage
, andwithData
steps that would actually perform/wait for the invocation to occur.
And your final component would just callonResolve
with the result of the invocation call/Going with option #1 will block the queue. I think that's fine for now.
Switching to option #2 will require a little bit of a shift in architecture. The actions will need to be reworked to support that.
As an example, if there are two invoke requests, and both get approved, we currently only have one
invokeActions
, and the store data would overwrite each other.I know what we can do to work around this, but it won't work out of the box with what we have.
What I'm alluding to in that last message, is that instead of directly calling createActions
from inside of our actions file, we can instead return a function that calls createActions
with its own unique ID. That way, we always have a distinct store lookup ID that won't interfere with other calls being made. The question I haven't answered is how we clean old store data that we don't need anymore.
The MVP version of the dApp Browser lets users enter a domain name to access a Github Pages repo as a child view in the client.
The dApp browseer consists of:
We need to clean the request queue when the user logs or navigates away from the current dapp. Otherwise, we will continue trying to process old requests the next time the user returns to the dapp browser.
There are several options to consider for this:
Have the parent expose a set of standard functions to child dApps and pages.
Essential functions:
Your issue may already be reported!
Please search on the issue track before creating one.
There's a problem compiling now that we're using electron-json-storage
:
โ yarn dist
yarn run v1.5.1
$ yarn run build && electron-builder
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.Failed to minify the code from this file:
./node_modules/electron-json-storage/lib/storage.js:335
Read more here: http://bit.ly/2tRViJ9
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c react-app-rewired build
Directory: /Users/mhuggins/Development/nos/client
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/mhuggins/Development/nos/client/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c yarn run build && electron-builder
Directory: /Users/mhuggins/Development/nos/client
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/mhuggins/Development/nos/client/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Cannot new create accounts by using nOS GUI.
It should accept passphrase and we can register new wallet accounts
When trying to create new account using nOS GUI,
I cannot enter text, it seems text boxes disabled.
and cannot even click on Register button or Login.
May be some older and newer operating system related fixes and extensive testing required
Steps mentioned in below GIF file link:
https://drive.google.com/file/d/1N0numsArmVb1Bf4h_1G1SqSkQREZSAtV/view?usp=sharing
Working with multiple wallet account from my dApp and need to interact with smart contract from newly created accounts. So, my testing is not working properly.
Environment name and version (e.g. node.js 9.6.1, yarn 1.6.1, npm 5.6.0):
Nodejs version: 9.11.1
npm version: 5.6.0
yarn version: 1.6.0
Operating System and version (desktop or mobile): 14.04 (Desktop)
We're currently cleaning the "auth" data upon logout, but we should clean other data such as "balances" too.
Integrate the layout from the private dashboard repo into the client.
mini
menu: layouts_menu_side_mini.htmlWe currently have getBalance
in our API, which takes an asset ID or NEP5 script hash as an argument and retrieves the current account's balance for that asset/token.
I suggest we change this function to take two arguments, with the first argument being the address that we should fetch the balance for. This would make it more extensive in case another address balance is needed, and it could still work smoothly with the way our API works, e.g.:
nos.getAddress()
.then((address) => nos.getBalance(address, NEO))
.then((balance) => console.log(balance))
.catch((err) => console.log(err.message));
Getting a minifying error when compiling the source for a production build. This should be fixed in react-scripts 2.0
and already has preliminary work done in branch fix/buildingIssues
yarn dist
creates a production build.
yarn dist
fails (see screenshot)
Update the fix/buildingIssues
branch - rebase it to develop's HEAD - and fix whatever causes the tests to fail.
yarn
yarn dist
Creating a production build is critical for mass adoption.
node v8.11.0
, npm 5.6.0
, nvm 0.33.6
We don't want normal links to work. We should highjack navigation with electron to prevent it.
Note that webview does not support event.preventDefault()
on the will-navigate IPC event. Instead, we'll need to use preloadRenderer.js
to prevent navigation. An example of how to do this can be found here: electron/electron#4191 (comment).
# yarn start --debug
yarn start v0.27.5
$ concurrently -r "yarn run start-react" "wait-on http://localhost:3000/ && yarn run start-electron" --kill-others --success first
Starting the development server... /root/nos-client/node_modules/electron/dist/electron: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory error Command failed with exit code 127. error Command failed with exit code 1.
My Environment:
# uname -a
Linux nos-dapp 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Goal is to move the dapp.html
demo into a separate repo that we can share with users as a starting point for creating their own dApp implementations. Ideally, I'm thinking we should provide a simple webpack/React boilerplate that gives users a head start on creating a compilable webpack that works when they point nOS to localhost:<port>
.
The confirm
redux action needs a wrapper to support more complex form dialogs. It should support complex interactions (more than just a string for its children
) as well as being able to pass a result as arguments to onConfirm
.
The confirm
redux action accept children string/node and an onConfirm
callback that is not given any arguments.
๐ค
Requires all basic wallet functions:
We should let users attach assets to invocations so they can run VerificationTransaction methods in their smart contract (accept payments with invocations).
After logging in, clicking Logout returns the following error:
Stack trace:
TypeError: Cannot read property 'encryptedWIF' of null
mapPreviousAuthDataToProps
/src/components/Login/index.js:22
19 |
20 | const { LOADING } = progressValues;
21 |
> 22 | const mapPreviousAuthDataToProps = ({ encryptedWIF }) => ({ encryptedWIF });
23 |
24 | const mapAuthActionsToProps = (actions) => ({
25 | login: ({ wif, passphrase, encryptedWIF, publicKey }) => {
The user shouldn't see the address bar, sidebar, etc. before they've logged in. Refer to the dist/auth_login.html
and dist/auth_register.html
pages in the client-template repo for ideas of what this might look like.
At the hackathon some users were looking for the Settings button on the left menu. Since there are no page-specific settings right now, it makes sense to move it to the left menu.
Your issue may already be reported!
Please search on the issue track before creating one.
If the URL called is localhost
with any port, i.e. localhost:80
: don't call the name service smart contract, and load the URL directly from HTTP.
Not able to login using wallet file
I have selected the wallet option in the nOS client and imported the wallet file.It should recognized the account and authenticate
I have selected the wallet option in the nOS client and imported the wallet file.It has recognized my account but it doesn't authenticate me saying invalid private key
May be we should add functionality for recognizing the wallet private keys
1.Open nOS client
2.Select wallet option
3.Import wallet file
4.Select your account and try to login
https://drive.google.com/open?id=1RiqNOUeiC77x9xQlCi5oVwsLU2v39Wi4
Ideally login has to happen using wallet file also
I'm unable to drag the client, so moving it to other windows without using some osx shortcuts is impossible
When accessing an nos:
domain dapp, the user should have the opportunity to approve/reject XHR requests. To do this, we may need to override the default implementations of fetch
and XMLHttpRequest
within the webview.
Right now the client shows a white window while it loads. It should display a loading process splash for a more responsive user experience.
Cannot click on login button after clicking on create account
Clicking on login should redirect to login page
After clicking on register ,nOS client hangs and not allows the user to click/enter anything
May be extensive testing required on windows and support for latest versions is needed.
1.Open nOS client
2.Click on create account
3.Try to click on login
https://drive.google.com/open?id=1YlEqtyUNJ3NwDs5-pFNxpZMuV_FNGM45
This is a basic functionality,login functionality should work ideally
Client should continue to work if I enter wrong url or not
Client show error and doesn't work anymore
Allow users to select/configure the network they want to use.
Users can add a network from their Settings tab. Only a neoscan
API URL is required.
Default network: nOS Local Testnet
(nos-local
configuration, 127.0.0.7
+ default nos-local
API ports)
FUTURE: By default we want users to connect to the public nOS Testnet (TBA)
Your issue may already be reported!
Please search on the issue track before creating one.
When I run yarn start
I'm greeted with a string of errors (output below) as well as Chrome's inspector tools.
2018-04-25 01:50:47.450 Electron[23851:11781402] *** WARNING: Textured window <AtomNSWindow: 0x7fcca6c36470> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead.
[23851:0425/015049.698881:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015050.663237:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015051.663608:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015052.662728:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015053.663120:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015054.662509:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015055.663207:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015056.662678:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
[23851:0425/015057.662975:ERROR:CONSOLE(7323)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7323)
When I choose nOSLocal environment from the nOs client settings, it does not use my Neo local private environment but instead an unknown environment.
when I choose nOSLocal in the client settings combobox, it should connect to a started Neo local environment from my computer.
when I choose nOSLocal in the client settings combobox, it seems that the client is connected to an unknown server
edit may 13th 2018: add a workaround
The current Loading splash screen does not indicate responsiveness and feels clunky due to the size and window controls.
For example:
When providing an invalid scriptHash with testInvoke
(or any other API function)
There should be an error saying Invalid script hash: "${scriptHash}"
(Which is thrown in the makeTestInvokeActions
when validating the scriptHash)
This issue consists through every current action and should be fixed for every current action
When providing an invalid scriptHash with testInvoke
(or any other API function)
There is an error saying Invocation failed for operation "${props.operation}" on "${props.scriptHash}"
Catching the correct error thrown in the actions (in this case the makeTestInvokeActions
which should be caught with withRejectMessage
in components -> browser -> RequestProcessor -> TestInvoke index.js
--> err = Invocation failed for operation "${props.operation}" on "${props.scriptHash}"
err SHOULD be Invalid script hash: "${scriptHash}"
It's currently not clear WHY testInvoke
would fail because it gives a general error. With any error you get the same error message and developers won't know that their scriptHash is invalid
We want to trigger events to dApps via IPC when nOS becomes aware of certain things. The first event that we care about is when a new block becomes available.
on
/off
(or subscribe
/unsubscribe
) so that dapp's can listen for events that we trigger.Here's an example of how a dApp might expect to use this:
const api = window.NOS.V1;
api.on('newBlock', (event) => {
console.log('Block index: ' + event.index);
console.log('Block height: ' + event.hash);
});
Having the AuthenticatedLayout
component render the Breadcrumbs
component doesn't make sense because it's not aware of the current route. Instead, the current page's component should directly render Breadcrumbs
as its first child, with the rest of its child components/markup following.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.