Giter Club home page Giter Club logo

sol2proto's Introduction

sol2proto

License: LGPL v3 Go Report Card Contributions Welcome

The Ethereum ABI to gRPC protobuf transpiler

Installation

go get github.com/getamis/sol2proto

Usage

Usage of sol2proto:
      --abi stringArray   ABI files generated by solc
  -o, --output string     Output destination, could be 'stdout', 'stderr' or a directory (default "stdout")
      --pkg string        go package name for the generated proto (default "pb")

Output to stdout

sol2proto --pkg awesome --abi MyAwesomeContract.abi > my_awesome_contract.proto

Output to a directory

sol2proto --pkg awesome --abi MyAwesomeContract.abi -o .

License

sol2proto is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the LICENSE file.

sol2proto's People

Contributors

alanchchen avatar bailantaotao avatar markya0616 avatar quesalltime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sol2proto's Issues

Incorrect message name found when generate the messages.proto

While generate the messages.proto , the message name of the return value for smart contract's constant function is incorrect.

For example ,there is a smart contract contain a constant getName function which has no input parameter and return a string.
After convert the .sol file to the .proto files ,it will generate an unexpected GetNameReq message instead of generating GetNameResp message in the messages.proto.

# function in smart contract
function getName() public constant returns (string) {
      return name;
}
# After execute sol2proto , the expected message name in messages.proto
message GetNameResp { 
    string arg = 1;
}
# After execute sol2proto , the actual message name in messages.proto currently
message GetNameReq {
    string arg = 1;
}

After tracing the code , it seems to be a typo at line 59 in the grpc/method.go
I suppose the method.RequestName() should be replaced with method.ResponseName().

The corresponding PR is here #17

Is the --output flag required?

When i follow the Usage instruction in the README.md ,
the two of separating *.proto files never come out.

After tracing the source code in main.go ,
i guess the --output flag is required.

So i try the following cmd then it generate two proto files successfully.
sol2proto --pkg pb --abi NameService.abi --output .

Is it correct to ALWAYS specify the --output flag
if i want to get two separating *.proto files?

Thanks.

no resp in messages.proto

I ran the example in grpc-contract but somehow there aren't any resp messages produced by sol2proto, the messages.proto file only includes GetNameReq, OnNameSetReq and SetNameReq, I used the abi you have in the example.

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.