Code Monkey home page Code Monkey logo

cosm's People

Contributors

fadeev avatar helder-moreira avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

okwme

cosm's Issues

Thoughts on `blogcli` and `cosm serve`

Verbosity

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.

Responsiveness

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"
 }

Issues found when running through instructions

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!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.