Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructTrc20ProposalDataHash(handler string, recipient []byte, amount *big.Int) [32]byte
- func GetBridgeChainId(client *tron.GrpcClient, brigeAddress string) (uint8, error)
- func IsTriggerSmartContract(tx api.TransactionExtention) bool
- func NewListener(conn Connection, chainDB *chains.ChainDB, cfg *Config, log log.Logger, ...) *listener
- func NewWriter(conn Connection, cfg *Config, log log.Logger, stop <-chan int, ...) *writer
- func ParseNumericProperty(data string) (*big.Int, error)
- func ParseStringProperty(data string) (string, error)
- func TriggerContract(client *tron.GrpcClient, from, contractAddress, method, jsonString string, ...) (*api.TransactionExtention, error)
- type Chain
- type Config
- type Connection
Constants ¶
View Source
const DefaultBlockConfirmations = 12
View Source
const DefaultGasLimit = 6721975
View Source
const DefaultGasPrice = 10000000000
View Source
const ExecuteBlockWatchLimit = 100
Number of blocks to wait for an finalization event
View Source
const TxRetryInterval = time.Second * 2
Time between retrying a failed tx
View Source
const TxRetryLimit = 10
Maximum number of tx retries before exiting
View Source
const UpdateEthGasPriceInterval = time.Minute * 5
Update eth gas price interval
Variables ¶
View Source
var ( BridgeOpt = "bridge" MaxGasPriceOpt = "maxGasPrice" GasLimitOpt = "gasLimit" StartBlockOpt = "startBlock" BlockConfirmationsOpt = "blockConfirmations" CommitVotesStartSeqOpt = "commitVotesStartSeq" )
Chain specific options
View Source
var BlockRetryInterval = time.Second * 10
View Source
var CancelledStatus uint8 = 4
View Source
var ErrFatalQuery = errors.New("query of chain state failed")
View Source
var ErrFatalTx = errors.New("submission of transaction failed")
View Source
var ErrNonceTooLow = errors.New("nonce too low")
View Source
var ErrTxUnderpriced = errors.New("replacement transaction underpriced")
View Source
var PassedStatus uint8 = 2
View Source
var TransferredStatus uint8 = 3
View Source
var WatchDuration = 60 * 30 // 30 Minute
Functions ¶
func GetBridgeChainId ¶
func GetBridgeChainId(client *tron.GrpcClient, brigeAddress string) (uint8, error)
func IsTriggerSmartContract ¶
func IsTriggerSmartContract(tx api.TransactionExtention) bool
func NewListener ¶
func NewListener(conn Connection, chainDB *chains.ChainDB, cfg *Config, log log.Logger, stop <-chan int, sysErr chan<- error, m *metrics.ChainMetrics) *listener
NewListener creates and returns a listener
func NewWriter ¶
func NewWriter(conn Connection, cfg *Config, log log.Logger, stop <-chan int, sysErr chan<- error, m *metrics.ChainMetrics) *writer
NewWriter creates and returns writer
func ParseStringProperty ¶
func TriggerContract ¶
func TriggerContract(client *tron.GrpcClient, from, contractAddress, method, jsonString string, feeLimit, tAmount int64, tTokenID string, tTokenAmount int64) (*api.TransactionExtention, error)
TriggerContract and return tx result
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func InitializeChain ¶
func InitializeChain(chainCfg *core.ChainConfig, chainDB *chains.ChainDB, logger log.Logger, sysErr chan<- error, m *metrics.ChainMetrics) (*Chain, core.ProposalState, error)
func (*Chain) LatestBlock ¶
func (c *Chain) LatestBlock() metrics.LatestBlock
Click to show internal directories.
Click to hide internal directories.