allinbits / cosm Goto Github PK
View Code? Open in Web Editor NEWA helper tool for developing Cosmos applications
A helper tool for developing Cosmos applications
Right now it's a little verbose to use the generated blogcli
tool to add a new transaction to the blockchain.
Here are the current examples:
blogcli tx blog create-post "My title" "This is a blog" --from=me.
blogcli q blog list-posts
Could blogcli
be wrapped by cosm instead, like this? The tx sender can default to the key created by cosm serve
. If the developer wants to send a blog by another account they can add the --from flag.
cosm create-post "My title" "This is a blog"
cosm create-post "Another title" "Another paragraph" --from=denis
cosm list-post
Of course there are scaling concerns with this approach because this shorthand only works if the developer sticks to using one module. Perhaps these command aliases default to the first module created, and later modules need to be specified like this:
cosm comment create-comment "0fbadc1a-a451-45bd-89d9-d09ea4a51271" "first comment lols"
Probably needs more clarity.
This is likely on the roadmap already, but I was thinking it could be nice, in the output of cosm serve
, to show something like (the following) after a new tx is validated:
A new post has been created on block #113.
{
"creator": "cosmos17lhtp6wmxgnfq2sj6meqavpxctv0efrdt6t36z",
"id": "0fbadc1a-a451-45bd-89d9-d09ea4a51271",
"title": "Blog title",
"body": "Blog body"
}
cosm start
doesn't seem to work. I get the following error:
> cosm start
Error: unknown command "start" for "cosmos"
Run 'cosmos --help' for usage.
unknown command "start" for "cosmos"
After running cosm app <repo>
I see the word "token" printed on the screen. Is this on purpose?
I tried following the type instructions by making a new type:
> cosm type foo bar
๐ Created a type `foo`.
It seemed to work correctly but when I tried to create a transaction with the new type following the example i got an account error:
> testcli tx test create-foo "foobar" --from=me
ERROR: unknown address: account cosmos1n0drc7wcq3xk5rjsp6dat99tl7jxfr2jlyntzn does not exist
(my project is called "test")
I started up the UI but I see an error in the console:
> npm run serve
> [email protected] preserve /Users/billy/GitHub.com/okwme/test/ui
> lcp --proxyUrl http://localhost:1317 &
> [email protected] serve /Users/billy/GitHub.com/okwme/test/ui
> parcel index.html
Proxy Active
Proxy Url: http://localhost:1317
Proxy Partial: proxy
PORT: 8010
Credentials: false
Origin: *
To start using the proxy simply replace the proxied part of your url with: http://localhost:8010/proxy
Server running at http://localhost:1234
โจ Built in 11.54s.
Request Proxied -> /test/foo
Request Proxied -> /faucet
internal/streams/legacy.js:61
throw er; // Unhandled stream error in pipe.
^
Error: socket hang up
at connResetException (internal/errors.js:608:14)
at Socket.socketOnEnd (_http_client.js:453:23)
at Socket.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET'
}
In the browser I see the interface show up and I seem to be able to generate new accounts but there's an error in the dev console and another one appear when i click faucet:
xhr.js:178 GET http://localhost:8010/proxy/test/foo net::ERR_CONNECTION_REFUSED
dispatchXhrRequest @ xhr.js:178
xhrAdapter @ xhr.js:12
dispatchRequest @ dispatchRequest.js:52
Promise.then (async)
request @ Axios.js:61
Axios.<computed> @ Axios.js:76
wrap @ bind.js:9
fetchList @ script.js:57
(anonymous) @ script.js:49
init @ script.js:46
parcelRequire.script.js.axios @ script.js:108
newRequire @ script.75da7f30.js:47
(anonymous) @ script.75da7f30.js:81
(anonymous) @ script.75da7f30.js:120
createError.js:16 Uncaught (in promise) Error: Network Error
at createError (createError.js:16)
at XMLHttpRequest.handleError (xhr.js:83)
createError @ createError.js:16
handleError @ xhr.js:83
Promise.then (async)
fetchList @ script.js:57
(anonymous) @ script.js:49
init @ script.js:46
parcelRequire.script.js.axios @ script.js:108
newRequire @ script.75da7f30.js:47
(anonymous) @ script.75da7f30.js:81
(anonymous) @ script.75da7f30.js:120
script.js:26 Uncaught TypeError: Cannot read property 'address' of undefined
at HTMLButtonElement.requestTokens (script.js:26)
requestTokens @ script.js:26
Not to say that this isn't AMAZING, these features are already so far beyond what is currently available with scaffolding a new application SO FREAKING COOL!!!
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.