Git Product home page Git Product logo

protocol's Introduction

protocol Build Status

The protocol of Tron including api and message.

The protocol is an independent project. You can use it for building other application.

java-tron, wallet-cli and grpc-gateway

git subtree pull --prefix src/main/protos/ protocol master

Run the included *.sh files to initialize the dependencies

protocol's People

Contributors

317787106 avatar andelf avatar codeninjaevan avatar dorianrust avatar forfreeday avatar halibobo1205 avatar huzhenyuan avatar ithinker1991 avatar jiangyy0824 avatar llwslc avatar lvs007 avatar lxcmyf avatar nanfengpo avatar olenheim avatar renchenchang avatar sasaxie avatar sean-liu55 avatar sh11thead avatar shydesky avatar ss334452 avatar taihaofu avatar tjchern avatar tomatoishealthy avatar wubin12 avatar yanghang8612 avatar ybhgenius avatar yrp avatar zergweak avatar zhangwenhua-tron avatar zhaohong 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  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  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  avatar  avatar  avatar

protocol's Issues

`contractRet` field missing in transaction data

A transaction should have a contractRet field, so we can tell if the transaction is success.
But transaction da124c316ea64e5df700296376d0cf894215e241b50c6cf6c71ae0aa7021d815 do not have a contractRet field, the raw data from trongrid is below:

curl -X POST  https://api.trongrid.io/wallet/gettransactionbyid -d '{"value": "31743abbba46f4c458112ea4aa50dad42bba6cec0d73599cc22ad65aec8dc3aa"}'
{
	"ret": [{}],
	"signature": ["957c31368ceb44e274d4a563006bf34e7d121fb72f20c2bdb7648934177d5c9b5e247e0a9acaae64858fc3d6419354c5cc03c174a3e5a610b3f88f488b8eefc601"],
	"txID": "31743abbba46f4c458112ea4aa50dad42bba6cec0d73599cc22ad65aec8dc3aa",
	"raw_data": {
		"data": "2053656e742066726f6d2054726f6e57616c6c6574",
		"contract": [{
			"parameter": {
				"value": {
					"amount": 21750000,
					"owner_address": "41cc0af1db2de5687613e1086a1ab92eca29abba86",
					"to_address": "41f5cc3be990c3686c9a183766f78a1892a8650197"
				},
				"type_url": "type.googleapis.com/protocol.TransferContract"
			},
			"type": "TransferContract"
		}],
		"ref_block_bytes": "3ed9",
		"ref_block_hash": "7e6bf293e63e4dd1",
		"expiration": 1561507505743,
		"timestamp": 1561507206118
	},
	"raw_data_hex": "0a023ed922087e6bf293e63e4dd140cfcce688b92d52152053656e742066726f6d2054726f6e57616c6c65745a68080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412330a1541cc0af1db2de5687613e1086a1ab92eca29abba86121541f5cc3be990c3686c9a183766f78a1892a865019718f0c1af0a70e6a7d488b92d"
}

So the question is:

  1. Is contractRet exists in every TransferContract transaction?
  2. If not, how can we tell if a transaction is success?

TriggerConstantContract via gRPC not working.

I am trying to execute TriggerConstantContract via gRPC protocol and having returned this error:

"A���=contract validate error: No contract or not a smart contract

I am setting addresses like this:

$sc = new TriggerSmartContract();
$sc->setOwnerAddress('41977C20977F412C2A1AA4EF3D49FEE5EC4C31CDFB');
$sc->setContractAddress('419E62BE7F4F103C36507CB2A753418791B1CDC182'); // USDT contract.

gRPC client is PHP library generated from this repo, but I think that's irrelevant.
I am using the latest stable release.

I have TriggerConstantContract working via HTTP but can't make it working using gRPC.

updateBrokerage interface cannot use base58 encoded addresses

curl -X POST https://api.trongrid.io/wallet/updateBrokerage -d '{"owner_address":"TGj1Ej1qRzL9feLTLhjwgxXF4Ct6GTWg2U", "brokerage":20, "visible":true}'

The above command gives an error, owner_address is encoded in hex format, no error is reported.

./install-googleapis.sh is not valid

Content of file ./install-googleapis.sh seems to be outdated and I see two problems there:

cannot find package "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger"
(this package seems to be deprecated and replaced)

And

wget http://central.maven.org/maven2/com/google/api/grpc/googleapis-common-protos/0.0.3/googleapis-common-protos-0.0.3.jar

returns

--2020-12-24 19:02:17-- http://central.maven.org/maven2/com/google/api/grpc/googleapis-common-protos/0.0.3/googleapis-common-protos-0.0.3.jar
Resolving central.maven.org (central.maven.org)... failed: nodename nor servname provided, or not known.
wget: unable to resolve host address ‘central.maven.org

Can we have this fixed ?

C++ & C# API

Hi,

where are the C based language API's for the Tron protocol?

Import postman error

I am getting error on line with BELOW_THAN_ME = 0X24; (Tron.proto file):
Illegal id 0X24. Fixed just changing to 0x24, but i dont know what it can break

Safepal SIGEEROR

Здрастуйте. Подскажите на SefePal столкнулися с такой проблемой, при передаче или выводе USDT мне сразу выбивает SIGEEROR. Дело ещё такого рода что при покупке TRX деньги у меня с карты уходят но TRX не появляется.. Что может быть?

No id in ExchangeCreateContract

Whenever the contract is created these are the parameters it returns:
{
"ownerAddress": "TGAGGMBKK1fq2Ym3ZQDzTWa55R68UB5xWU",
"firstTokenId": "SEED",
"firstTokenBalance": 1500,
"secondTokenId": "_",
"secondTokenBalance": 7500000000,
"contractType": 41,
"hash": "54d41e4408e74de3ec9d8cf25362676f41e37a72d8dcb05b09ce10db603c5a6f",
"time": 1541743302279
}

...but it lacks the most important one which is the 'exchangeId'. with it we can get track the secondary token which is not in the ExchangeTransactionContract.

Suggestion:- Allow users to freeze TRX for longer periods in exchange for TRX dividends.

Tronscan team suggested I raise the suggestion / recommendation here.

Allow the community to support TRX buy holding on to their TRX for longer periods of time in exchange for agreed TRX dividends by percentage of TRX held.

For example if you have 1000 TRX and freeze for:-

6 months - 1% = 10 TRX dividends
12 months - 2.5% = 25 TRX dividends
24 months - 6% = 60 TRX

Rather than set a set % you could tie this into a percentage of how much TRX has gained in the period. If there is no gain then no dividends are awarded (given that long term investors want to support Tron they may not mind if nothing is distributed if within the frozen period the price drops. They could be given an additional % if they opt to freeze again and continue their support.

Generate python code missing files

When using grpcio_tools module to generate code, there are so many missing files using the following command:
python -m grpc_tools.protoc --proto_path=googleapis:. --python_out=apps/trx/protocol/ --grpc_python_out=apps/trx/protocol/ -I. api/api.proto --include_imports

Is there any proper method to get this work?

Suggestion for improvement "listwitnesses"

Is it possible to modify the existing query "/wallet/listwitnesses" and add values?

Many queries are necessary to keep your app in the Votes section up to date.

1x query "Listwitnesses" - ~220 entries
220x queries "GetAccount" - to get the name of each single candidate
220x queries "GetBrokerage" - to find out the current level of rewards.

These are 441 queries. If you could add the name and the brokerage info, it would only be 1 query.

Unable to compile protoc files for Golang

I am trying to get go version of protoc files but the following error is returned:

 tron_protocol protoc -I=. --go_out=go_data api/api.proto 
protoc-gen-go: unable to determine Go import path for "google/api/http.proto"

Please specify either:
        • a "go_package" option in the .proto source file, or
        • a "M" argument on the command line.

Any idea how to fix this? Earlier I was able to use them for nodejs, but with golang no luck so far.
I have executed install scripts and file google/api/http.proto exists in my local path

Protocol md files in root should use syntax-highlighting

(see title, and example follows.)

Protobuf protocol

The protocol of TRON is defined by Google Protobuf and contains a range of layers, from account, block to transfer.

There are 3 types of account—basic account, asset release account and contract account, and attributes included in each account are name, types, address, balance and related asset.

A basic account is able to apply to be a validation node, which has serval parameters, including extra attributes, public key, URL, voting statistics, history performance, etc.

      enum AccountType {
  
         Normal = 0;
  
         AssetIssue = 1;
  
         Contract = 2;
       
}

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.