Giter Club home page Giter Club logo

gear-program's People

Contributors

breathx avatar clearloop avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

gear-program's Issues

Docs coverage for crates.io

Problem to Solve

complete the docs for crates.io

Possible Solution

  • write more docs
  • inject README.md into lib.rs automatically

Notes

No response

support usage gear program from different processes

Problem to Solve

When I try to run gear program from different process for a same node and in the same time, then I often get this error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SubxtBasic(Rpc(Call(Custom(ErrorObject { code: ServerError(1014), message: "Priority is too low: (242 vs 242)", data: Some(RawValue("The transaction has too low priority to replace another transaction already in the pool.")) }))))',

Possible Solution

_

Notes

No response

Add examples folder to show the usages

Problem to Solve

It is really hard to write examples for each command in README, we can show them in the examples folder

Possible Solution

The integraion tests for commands under tests/cmd/*.rs already can treat as examples, what we need to do is copying the main logic to examples/*.rs

Notes

No response

Test the compatibility with gear node

but some functions/events only work on the matched spec_version, if we align to the lastest version of gear-node, this program may not work for the gear testnet

We are to keep the API/runtime part up to date and detect incompatibility with the node at early stages (another task to CI I guess, maybe some nighly job that compares actual API with the generated.rs).

Ideally, every new feature should be accompanied by the corresponding test/example.

Originally posted by @shamilsan in #6 (comment)

Perfect error outputs

Problem to Solve

the logs of gear-program are all raw stdout for now

Possible Solution

mb we need to use log or color-eyre, log for custom logs, color-eyre for error outputs

  • replace the events' outputs
  • replace the cmmand outputs
  • replace the tx status' outputs

Notes

No response

Add extrinsic parameters validation on `gear-program` side

Problem to Solve

We have several restrictions on our extrinsics: for example, we deny ability to send more gas than maximal block gas limit, we deny ability to deploy different programs under the same program/actor id. Some things can be caught for free locally, avoiding wasting money and time for extrinsic fail.

Possible Solution

  • Validate salt on program upload
  • Validate binary code on upload
  • Validate destination ID on send
  • Validate value
  • Validate gas limit
  • Validate mailbox on reply/claim

Refactor build.rs as shell script

File Location(s)

No response

Proposal

We can not build docs on docs.rs with the current build script since it requires write access to the file system

Program doesn't exit on error

Problem

gear will not exit when error occurs since there is another process waiting for events, and the two process are combined with one join!

Steps

Possible Solution

exit on errors

Notes

No response

Relevant Log Output

Click to expand/collapse

<Paste your log here>

Completing the missing integration tests

Problem to Solve

Most of the commands were written before the implementation of the integration tests utils, now we need to complete them

Possible Solution

Add integration tests for the commands below

  • claim
  • reply
  • send
  • submit
  • transfer

Notes

No response

Add development docs

Problem to Solve

Need to add docs for how to use the scirpts in developing, for example update the api

Possible Solution

add a new chapter dev in README

Notes

No response

Split builder out of the main crate

Problem to Solve

The code under the builder should not be embedded inside the main crate since user will never use it

Possible Solution

Create a new crate for it

Notes

No response

Rename commands after gear-tech/gear#1205

What about submit_program?

I'm okay with both, one concern is each of the commands is a single word for now. ( deploy for submit_program, submit for submit_code )

I've already offered renaming: submit_code -> upload_code, submit_program -> create_program, so it will be single-word some time soon

I'd add only submit program at the moment

Originally posted by @breathx in #13 (comment)

Transfer balance

Problem to Solve

Allow users transfering balance via binary gear

Possible Solution

add command transfer

Notes

No response

login doesn't work if `.gear` doesn't exist

Problem

can not login if there is no .gear

Steps

Possible Solution

recheck the mkdir code for this

Notes

No response

Relevant Log Output

Click to expand/collapse

<Paste your log here>

Read mailbox with cli

Problem to Solve

Add command printing the mailbox's content of address

Possible Solution

we already have

/// Get mailbox of address
pub async fn mailbox(
, just need to create a new command using it

Notes

No response

Wait for MessageDispatched after sendMessage

Problem to Solve

here we need to exit the process after MessageDispatched, show the succeed or the failure log

Possible Solution

send / reply message and listen to the event, exit process after MessageDispatched

Notes

No response

Refactor template app registry

Problem to Solve

needs to refactor the template apps registry since we don't maintain gear-tech/apps anymore

Possible Solution

write each of the git repo of gear program templates into static array and just clone them.

Notes

No response

Derive rust types from metadata

It is really overhead to decode non-exists structure from bytes and output them in rust, as a solution for reading state, I'll just create a new wasm project with the type registry providing functions like encode_input and decode_output

Originally posted by @clearloop in #32 (comment)

Once we decoded the PortableRegistry from meta_registry, we can generate rust types from it into a new wasm project, which provides

extern "C" fn encode_$type() {
   hex::encode(...)
}

extern "C" fn encode_$type() {
   serde_json::from_str(...)
}

to do the encoding/decoding stuffs

The best solution I can figure out is do it in wasm, which can solve this problem dynamically, we also need to cache "*.meta.wasm" and the generated wasm project uner ~/.gear for re-using purposes.

Introduce command `keys`

Problem to Solve

instroduce sign && verify ability in gear-program

Possible Solution

The command would be like

gear key

sign <pk> <msg> —scheme <SCHEME>
verify <msg> <pk> —scheme <SCHEME>
/// list all avaible keys
list <keystore-path>
/// inspect from private key bytes, only get public from it momentary
inspect <pk-bytes> —scheme <SCHEME>

Notes

@EugenWay, @shamilsan feel free to comment on this

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.