Skip to content

Commit

Permalink
Update REDME
Browse files Browse the repository at this point in the history
  • Loading branch information
fbsobreira committed May 3, 2020
1 parent a9cf260 commit 0062e84
Showing 1 changed file with 47 additions and 28 deletions.
75 changes: 47 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,63 @@
## gotron ![](https://img.shields.io/badge/progress-80%25-yellow.svg)
# TRON's go-sdk

GoSDK and TRON-CLI tool for TRON's blockchain via GRPC

Fork from [sasaxie/go-client-api](https://github.com/sasaxie/go-client-api)
# Build


## Requirements
```
$ git pull -r origin master
$ make
```

- Go 1.13 or higher
# Usage & Examples

## Installation
# bash completions

First you need to install ProtocolBuffers 3.0.0-beta-3 or later.
once built, add `tronctl` to your path and add to your `.bashrc`

```sh
mkdir tmp
cd tmp
git clone https://github.com/google/protobuf
cd protobuf
./autogen.sh
./configure
make
make check
sudo make install
```
. <(tronctl completion)
```

Then, `go get -u` as usual the following packages:

```sh
go get -u github.com/golang/protobuf/protoc-gen-go
## Transfer JSON file format
The JSON file will be a JSON array where each element has the following attributes:

| Key | Value-type | Value-description|
| :------------------:|:----------:| :----------------|
| `from` | string | [**Required**] Sender's one address, must have key in keystore. |
| `to` | string | [**Required**] The receivers one address. |
| `amount` | string | [**Required**] The amount to send in $ONE. |
| `passphrase-file` | string | [*Optional*] The file path to file containing the passphrase in plain text. If none is provided, check for passphrase string. |
| `passphrase-string` | string | [*Optional*] The passphrase as a string in plain text. If none is provided, passphrase is ''. |
| `stop-on-error` | boolean | [*Optional*] If true, stop sending transactions if an error occurred, default is false. |

Example of JSON file:

```json
[
{
"from": "TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH",
"to": "TKSXDA8HfE9E1y39RczVQ1ZascUEtaSToF",
"amount": "1",
"passphrase-string": "",
"stop-on-error": true
},
{
"from": "TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH",
"to": "TEvHMZWyfjCAdDJEKYxYVL8rRpigddLC1R",
"amount": "1",
"passphrase-file": "./pw.txt",
}
]
```

Update protocol:

```sh
git submodule update --remote
```
# Debugging

Example:
The gotron-sdk code respects `GOTRON_SDK_DEBUG` as debugging
based environment variables.

```sh
go get -u github.com/fbsobreira/gotron
go run program/getnowblock.go -grpcAddress grpc.trongrid.io:50051
```bash
GOTRON_SDK_DEBUG=true ./tronctl
```

0 comments on commit 0062e84

Please sign in to comment.