ethereum / clef-ui Goto Github PK
View Code? Open in Web Editor NEWUI Implementation for Clef, the geth-based signer
License: GNU General Public License v3.0
UI Implementation for Clef, the geth-based signer
License: GNU General Public License v3.0
Right now, we are only getting signed transaction response for OnApproveTx
Martin will be adding OnApproveSignData
.
Steps:
Force quit the UI to exit freezez for now
Currently we are not showing ORIGIN and USER AGENT from the rpc meta data.
ORIGIN shows where the domain that made the request come from
USER AGENT show the user agent of user
Neither will be present if request is made with IPC.
Additional Consideration:
Please refer to ApproveListing API
pkg/rpc/rpc.go
Approve
Data come from call_info:message
There is CRITICAL, WARNING and INFO.
CRITICAL: show warning and don't allow user to advance. An example message is "message":"Tx destination is the zero address!","type":"CRITICAL"
when to
address is all zeros
INFO give you a human-readable string of the ABI call.
WARNING give you an error message, that we should surface to the user. The longest error message will likely be "Tx contains data, but provided ABI signature could not be matched: WARNING: Supplied data is stuffed with extra data. \nWant 0100000000000000000000000000000000000000000000000000000000000012\nHave 0000000000000000000000000000000000000000000000000000000000000012\nfor method safeSend(address)"
According to specs, Clef UI MUST show the blocky-identicon for ethereum addresses.
This task is just the implement the QWidget for the blocky identicon. We should be able to call something like NewBlocky(address string) *QWidget
and get back a widget.
This task DOES NOT include adding blocky to other approval screens. But feel free to do so if it helps with development.
Currently we are using LOCAL ENDPOINT as a label for local. However, LOCAL ENDPOINT is not clear to the user what it actually means. We should find better names for these labels.
Repo:
(Just tried to repo, but these repo steps does that reproduce the bug 100% of the time)
Tried to make a dev environment on debian-9, but ran into some errors:
user@debian-work:~/go/src/github.com/kyokan/clef-ui$ make deps
go get -u github.com/ethereum/go-ethereum
go get -u github.com/therecipe/qt
go get -u github.com/sirupsen/logrus
go get -u github.com/dchest/siphash
go get -u github.com/powerman/rpc-codec/jsonrpc2
go get -u golang.org/x/tools/imports
go install github.com/ethereum/go-ethereum/cmd/clef
go install github.com/therecipe/qt
go install github.com/therecipe/qt/cmd/qtdeploy
go install github.com/therecipe/qt/cmd/qtsetup
make: dep: Command not found
Makefile:6: recipe for target 'deps' failed
make: *** [deps] Error 127
Most of it seemed to work, so I continued anyway
user@debian-work:~/go/src/github.com/kyokan/clef-ui$ make run
go build -o ./build/clefui ./cmd/clefui/main.go
# github.com/therecipe/qt/quickcontrols2
quickcontrols2.cpp:9:22: fatal error: QByteArray: No such file or directory
#include <QByteArray>
^
compilation terminated.
# github.com/therecipe/qt/core
core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory
#include <QAbstractAnimation>
^
compilation terminated.
Makefile:26: recipe for target 'build' failed
make: ***
Error 2
I did install Qt 5.11.1 according to the instructions, using the official package. I did not install 'system package managers version' -- I thought that should not be needed, since it said:
Your applications won't run on a different distro than the one you used to deploy your application, but this is currently the only option to make your application look native on your distro.
And we want cross-platform, right?
Need to update the following two views:
Clef UI API is changing
Pending PRs
ethereum/go-ethereum#17704
ethereum/go-ethereum#17554
MasterPassword
First of all OnMasterPassword(request *PasswordRequest) (PasswordResponse, error)
PasswordRequest struct {
Prompt string `json:"prompt"`
}
PasswordResponse struct {
Password string `json:"password"`
}
Secondly that OnAccounts or something like it
Thirdly, I'm leaning towards removing Import from the external API
Currently account listing only show addresses. We should show identicon next to address
Please refer to Show Error API
pkg/rpc/rpc.go
. You can declare an empty struct as the reply
parameters of the RPC handler, as this method does not expect a replypkg/rpc/rpc.go
Request Info
(refer to ApproveSignData), and Transaction Info
that includes all others requst params from the RPC request.According to specs, Clef UI SHOULD verify the permissions on the signer binary, and refuse to execute or warn if permissions allow non-user write.
For completion of this task, Clef UI should:
Please refer to #3 for maximum context.
Please refer to Show Info API
pkg/rpc/rpc.go
. You can declare an empty struct as the reply
parameters of the RPC handler, as this method does not expect a replyLogin UI should have the following state (sorry, no mocks):
READY TO START CLEF
In this case, GOPATH AND go-ethereum is found, and Clef is ready to be started. We should show the user the SHA256 or MD5 hash of the binary that is going to be executed. The user should be able to do the following actions:
CLEF NOT FOUND
In this case, we cannot find GOPATH or go-ethereum. We should show the user a message that says "We cannot locate your go-ethereum directory." The user should be able to perform the following actions:
According to specs, Clef UI MUST display approproate warning if the destination-account is formatted with invalid checksum.
This task should add a small (font-size 10px) warning message in color red below the destination address if the address has an invalid checksum. AFAIK, signTransaction
should be the only view that requires this change, as it is the only view with a destination address.
This task DOES NOT include added warning message to sending ERC20 for now. In the future, we should add checksum validation for ERC20 transactions as well (Created #4 to track).
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.