add optimism support
This commit is contained in:
parent
6f170e07b0
commit
f0dd0e80b0
@ -232,6 +232,10 @@ type EthereumSpecific struct {
|
||||
GasLimit *big.Int `json:"gasLimit"`
|
||||
GasUsed *big.Int `json:"gasUsed,omitempty"`
|
||||
GasPrice *Amount `json:"gasPrice,omitempty"`
|
||||
L1Fee *big.Int `json:"l1Fee,omitempty"`
|
||||
L1FeeScalar string `json:"l1FeeScalar,omitempty"`
|
||||
L1GasPrice *Amount `json:"l1GasPrice,omitempty"`
|
||||
L1GasUsed *big.Int `json:"l1GasUsed,omitempty"`
|
||||
Data string `json:"data,omitempty"`
|
||||
ParsedData *bchain.EthereumParsedInputData `json:"parsedData,omitempty"`
|
||||
InternalTransfers []EthereumInternalTransfer `json:"internalTransfers,omitempty"`
|
||||
|
||||
@ -429,6 +429,9 @@ func (w *Worker) getTransactionFromBchainTx(bchainTx *bchain.Tx, height int, spe
|
||||
// mempool txs do not have fees yet
|
||||
if ethTxData.GasUsed != nil {
|
||||
feesSat.Mul(ethTxData.GasPrice, ethTxData.GasUsed)
|
||||
if ethTxData.L1Fee != nil {
|
||||
feesSat.Add(&feesSat, ethTxData.L1Fee)
|
||||
}
|
||||
}
|
||||
if len(bchainTx.Vout) > 0 {
|
||||
valOutSat = bchainTx.Vout[0].ValueSat
|
||||
@ -437,6 +440,10 @@ func (w *Worker) getTransactionFromBchainTx(bchainTx *bchain.Tx, height int, spe
|
||||
GasLimit: ethTxData.GasLimit,
|
||||
GasPrice: (*Amount)(ethTxData.GasPrice),
|
||||
GasUsed: ethTxData.GasUsed,
|
||||
L1Fee: ethTxData.L1Fee,
|
||||
L1FeeScalar: ethTxData.L1FeeScalar,
|
||||
L1GasPrice: (*Amount)(ethTxData.L1GasPrice),
|
||||
L1GasUsed: ethTxData.L1GasUsed,
|
||||
Nonce: ethTxData.Nonce,
|
||||
Status: ethTxData.Status,
|
||||
Data: ethTxData.Data,
|
||||
|
||||
@ -42,6 +42,7 @@ import (
|
||||
"github.com/trezor/blockbook/bchain/coins/namecoin"
|
||||
"github.com/trezor/blockbook/bchain/coins/nuls"
|
||||
"github.com/trezor/blockbook/bchain/coins/omotenashicoin"
|
||||
"github.com/trezor/blockbook/bchain/coins/optimism"
|
||||
"github.com/trezor/blockbook/bchain/coins/pivx"
|
||||
"github.com/trezor/blockbook/bchain/coins/polis"
|
||||
"github.com/trezor/blockbook/bchain/coins/polygon"
|
||||
@ -138,6 +139,8 @@ func init() {
|
||||
BlockChainFactories["BNB Smart Chain Archive"] = bsc.NewBNBSmartChainRPC
|
||||
BlockChainFactories["Polygon"] = polygon.NewPolygonRPC
|
||||
BlockChainFactories["Polygon Archive"] = polygon.NewPolygonRPC
|
||||
BlockChainFactories["Optimism"] = optimism.NewOptimismRPC
|
||||
BlockChainFactories["Optimism Archive"] = optimism.NewOptimismRPC
|
||||
}
|
||||
|
||||
// NewBlockChain creates bchain.BlockChain and bchain.Mempool for the coin passed by the parameter coin
|
||||
|
||||
@ -7,10 +7,10 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/juju/errors"
|
||||
"github.com/trezor/blockbook/bchain"
|
||||
"golang.org/x/crypto/sha3"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// EthereumTypeAddressDescriptorLen - the AddressDescriptor of EthereumType has fixed length
|
||||
@ -331,6 +331,24 @@ func (p *EthereumParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) (
|
||||
|
||||
}
|
||||
pt.Receipt.Log = ptLogs
|
||||
if r.Receipt.L1Fee != "" {
|
||||
if pt.Receipt.L1Fee, err = hexDecodeBig(r.Receipt.L1Fee); err != nil {
|
||||
return nil, errors.Annotatef(err, "L1Fee %v", r.Receipt.L1Fee)
|
||||
}
|
||||
}
|
||||
if r.Receipt.L1FeeScalar != "" {
|
||||
pt.Receipt.L1FeeScalar = []byte(r.Receipt.L1FeeScalar)
|
||||
}
|
||||
if r.Receipt.L1GasPrice != "" {
|
||||
if pt.Receipt.L1GasPrice, err = hexDecodeBig(r.Receipt.L1GasPrice); err != nil {
|
||||
return nil, errors.Annotatef(err, "L1GasPrice %v", r.Receipt.L1GasPrice)
|
||||
}
|
||||
}
|
||||
if r.Receipt.L1GasUsed != "" {
|
||||
if pt.Receipt.L1GasUsed, err = hexDecodeBig(r.Receipt.L1GasUsed); err != nil {
|
||||
return nil, errors.Annotatef(err, "L1GasUsed %v", r.Receipt.L1GasUsed)
|
||||
}
|
||||
}
|
||||
}
|
||||
return proto.Marshal(pt)
|
||||
}
|
||||
@ -359,27 +377,37 @@ func (p *EthereumParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) {
|
||||
}
|
||||
var rr *bchain.RpcReceipt
|
||||
if pt.Receipt != nil {
|
||||
logs := make([]*bchain.RpcLog, len(pt.Receipt.Log))
|
||||
rr = &bchain.RpcReceipt{
|
||||
GasUsed: hexEncodeBig(pt.Receipt.GasUsed),
|
||||
Status: "",
|
||||
Logs: make([]*bchain.RpcLog, len(pt.Receipt.Log)),
|
||||
}
|
||||
for i, l := range pt.Receipt.Log {
|
||||
topics := make([]string, len(l.Topics))
|
||||
for j, t := range l.Topics {
|
||||
topics[j] = hexutil.Encode(t)
|
||||
}
|
||||
logs[i] = &bchain.RpcLog{
|
||||
rr.Logs[i] = &bchain.RpcLog{
|
||||
Address: EIP55Address(l.Address),
|
||||
Data: hexutil.Encode(l.Data),
|
||||
Topics: topics,
|
||||
}
|
||||
}
|
||||
status := ""
|
||||
// handle a special value []byte{'U'} as unknown state
|
||||
if len(pt.Receipt.Status) != 1 || pt.Receipt.Status[0] != 'U' {
|
||||
status = hexEncodeBig(pt.Receipt.Status)
|
||||
rr.Status = hexEncodeBig(pt.Receipt.Status)
|
||||
}
|
||||
rr = &bchain.RpcReceipt{
|
||||
GasUsed: hexEncodeBig(pt.Receipt.GasUsed),
|
||||
Status: status,
|
||||
Logs: logs,
|
||||
if len(pt.Receipt.L1Fee) > 0 {
|
||||
rr.L1Fee = hexEncodeBig(pt.Receipt.L1Fee)
|
||||
}
|
||||
if len(pt.Receipt.L1FeeScalar) > 0 {
|
||||
rr.L1FeeScalar = string(pt.Receipt.L1FeeScalar)
|
||||
}
|
||||
if len(pt.Receipt.L1GasPrice) > 0 {
|
||||
rr.L1GasPrice = hexEncodeBig(pt.Receipt.L1GasPrice)
|
||||
}
|
||||
if len(pt.Receipt.L1GasUsed) > 0 {
|
||||
rr.L1GasUsed = hexEncodeBig(pt.Receipt.L1GasUsed)
|
||||
}
|
||||
}
|
||||
// TODO handle internal transactions
|
||||
@ -482,6 +510,10 @@ type EthereumTxData struct {
|
||||
GasLimit *big.Int `json:"gaslimit"`
|
||||
GasUsed *big.Int `json:"gasused"`
|
||||
GasPrice *big.Int `json:"gasprice"`
|
||||
L1Fee *big.Int `json:"l1Fee,omitempty"`
|
||||
L1FeeScalar string `json:"l1FeeScalar,omitempty"`
|
||||
L1GasPrice *big.Int `json:"l1GasPrice,omitempty"`
|
||||
L1GasUsed *big.Int `json:"L1GasUsed,omitempty"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
@ -511,6 +543,10 @@ func GetEthereumTxDataFromSpecificData(coinSpecificData interface{}) *EthereumTx
|
||||
etd.Status = TxStatusFailure
|
||||
}
|
||||
etd.GasUsed, _ = hexutil.DecodeBig(csd.Receipt.GasUsed)
|
||||
etd.L1Fee, _ = hexutil.DecodeBig(csd.Receipt.L1Fee)
|
||||
etd.L1GasPrice, _ = hexutil.DecodeBig(csd.Receipt.L1GasPrice)
|
||||
etd.L1GasUsed, _ = hexutil.DecodeBig(csd.Receipt.L1GasUsed)
|
||||
etd.L1FeeScalar = csd.Receipt.L1FeeScalar
|
||||
}
|
||||
}
|
||||
return &etd
|
||||
|
||||
@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"math/big"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@ -377,7 +377,7 @@ func (b *EthereumRPC) getConsensusVersion() string {
|
||||
glog.Error("getConsensusVersion ", err)
|
||||
return ""
|
||||
}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
glog.Error("getConsensusVersion ", err)
|
||||
return ""
|
||||
@ -623,6 +623,9 @@ func (b *EthereumRPC) getCreationContractInfo(contract string, height uint32) *b
|
||||
|
||||
func (b *EthereumRPC) processCallTrace(call *rpcCallTrace, d *bchain.EthereumInternalData, contracts []bchain.ContractInfo, blockHeight uint32) []bchain.ContractInfo {
|
||||
value, err := hexutil.DecodeBig(call.Value)
|
||||
if err != nil {
|
||||
value = new(big.Int)
|
||||
}
|
||||
if call.Type == "CREATE" || call.Type == "CREATE2" {
|
||||
d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{
|
||||
Type: bchain.CREATE,
|
||||
@ -834,12 +837,13 @@ func (b *EthereumRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error)
|
||||
func (b *EthereumRPC) GetTransaction(txid string) (*bchain.Tx, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), b.Timeout)
|
||||
defer cancel()
|
||||
var tx *bchain.RpcTransaction
|
||||
tx := &bchain.RpcTransaction{}
|
||||
hash := ethcommon.HexToHash(txid)
|
||||
err := b.RPC.CallContext(ctx, &tx, "eth_getTransactionByHash", hash)
|
||||
err := b.RPC.CallContext(ctx, tx, "eth_getTransactionByHash", hash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if tx == nil {
|
||||
}
|
||||
if *tx == (bchain.RpcTransaction{}) {
|
||||
if b.mempoolInitialized {
|
||||
b.Mempool.RemoveTransactionFromMempool(txid)
|
||||
}
|
||||
|
||||
@ -1,261 +1,530 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.12
|
||||
// source: bchain/coins/eth/ethtx.proto
|
||||
|
||||
/*
|
||||
Package eth is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
bchain/coins/eth/ethtx.proto
|
||||
|
||||
It has these top-level messages:
|
||||
ProtoCompleteTransaction
|
||||
*/
|
||||
package eth
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ProtoCompleteTransaction struct {
|
||||
BlockNumber uint32 `protobuf:"varint,1,opt,name=BlockNumber" json:"BlockNumber,omitempty"`
|
||||
BlockTime uint64 `protobuf:"varint,2,opt,name=BlockTime" json:"BlockTime,omitempty"`
|
||||
Tx *ProtoCompleteTransaction_TxType `protobuf:"bytes,3,opt,name=Tx" json:"Tx,omitempty"`
|
||||
Receipt *ProtoCompleteTransaction_ReceiptType `protobuf:"bytes,4,opt,name=Receipt" json:"Receipt,omitempty"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
BlockNumber uint32 `protobuf:"varint,1,opt,name=BlockNumber,proto3" json:"BlockNumber,omitempty"`
|
||||
BlockTime uint64 `protobuf:"varint,2,opt,name=BlockTime,proto3" json:"BlockTime,omitempty"`
|
||||
Tx *ProtoCompleteTransaction_TxType `protobuf:"bytes,3,opt,name=Tx,proto3" json:"Tx,omitempty"`
|
||||
Receipt *ProtoCompleteTransaction_ReceiptType `protobuf:"bytes,4,opt,name=Receipt,proto3" json:"Receipt,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction) Reset() {
|
||||
*x = ProtoCompleteTransaction{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction) Reset() { *m = ProtoCompleteTransaction{} }
|
||||
func (m *ProtoCompleteTransaction) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProtoCompleteTransaction) ProtoMessage() {}
|
||||
func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *ProtoCompleteTransaction) GetBlockNumber() uint32 {
|
||||
if m != nil {
|
||||
return m.BlockNumber
|
||||
func (x *ProtoCompleteTransaction) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProtoCompleteTransaction.ProtoReflect.Descriptor instead.
|
||||
func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) {
|
||||
return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction) GetBlockNumber() uint32 {
|
||||
if x != nil {
|
||||
return x.BlockNumber
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction) GetBlockTime() uint64 {
|
||||
if m != nil {
|
||||
return m.BlockTime
|
||||
func (x *ProtoCompleteTransaction) GetBlockTime() uint64 {
|
||||
if x != nil {
|
||||
return x.BlockTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType {
|
||||
if m != nil {
|
||||
return m.Tx
|
||||
func (x *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType {
|
||||
if x != nil {
|
||||
return x.Tx
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType {
|
||||
if m != nil {
|
||||
return m.Receipt
|
||||
func (x *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType {
|
||||
if x != nil {
|
||||
return x.Receipt
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProtoCompleteTransaction_TxType struct {
|
||||
AccountNonce uint64 `protobuf:"varint,1,opt,name=AccountNonce" json:"AccountNonce,omitempty"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
AccountNonce uint64 `protobuf:"varint,1,opt,name=AccountNonce,proto3" json:"AccountNonce,omitempty"`
|
||||
GasPrice []byte `protobuf:"bytes,2,opt,name=GasPrice,proto3" json:"GasPrice,omitempty"`
|
||||
GasLimit uint64 `protobuf:"varint,3,opt,name=GasLimit" json:"GasLimit,omitempty"`
|
||||
GasLimit uint64 `protobuf:"varint,3,opt,name=GasLimit,proto3" json:"GasLimit,omitempty"`
|
||||
Value []byte `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"`
|
||||
Payload []byte `protobuf:"bytes,5,opt,name=Payload,proto3" json:"Payload,omitempty"`
|
||||
Hash []byte `protobuf:"bytes,6,opt,name=Hash,proto3" json:"Hash,omitempty"`
|
||||
To []byte `protobuf:"bytes,7,opt,name=To,proto3" json:"To,omitempty"`
|
||||
From []byte `protobuf:"bytes,8,opt,name=From,proto3" json:"From,omitempty"`
|
||||
TransactionIndex uint32 `protobuf:"varint,9,opt,name=TransactionIndex" json:"TransactionIndex,omitempty"`
|
||||
TransactionIndex uint32 `protobuf:"varint,9,opt,name=TransactionIndex,proto3" json:"TransactionIndex,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_TxType) Reset() {
|
||||
*x = ProtoCompleteTransaction_TxType{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_TxType) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) Reset() { *m = ProtoCompleteTransaction_TxType{} }
|
||||
func (m *ProtoCompleteTransaction_TxType) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProtoCompleteTransaction_TxType) ProtoMessage() {}
|
||||
|
||||
func (x *ProtoCompleteTransaction_TxType) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProtoCompleteTransaction_TxType.ProtoReflect.Descriptor instead.
|
||||
func (*ProtoCompleteTransaction_TxType) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor0, []int{0, 0}
|
||||
return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 {
|
||||
if m != nil {
|
||||
return m.AccountNonce
|
||||
func (x *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 {
|
||||
if x != nil {
|
||||
return x.AccountNonce
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetGasPrice() []byte {
|
||||
if m != nil {
|
||||
return m.GasPrice
|
||||
func (x *ProtoCompleteTransaction_TxType) GetGasPrice() []byte {
|
||||
if x != nil {
|
||||
return x.GasPrice
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 {
|
||||
if m != nil {
|
||||
return m.GasLimit
|
||||
func (x *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 {
|
||||
if x != nil {
|
||||
return x.GasLimit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
func (x *ProtoCompleteTransaction_TxType) GetValue() []byte {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetPayload() []byte {
|
||||
if m != nil {
|
||||
return m.Payload
|
||||
func (x *ProtoCompleteTransaction_TxType) GetPayload() []byte {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetHash() []byte {
|
||||
if m != nil {
|
||||
return m.Hash
|
||||
func (x *ProtoCompleteTransaction_TxType) GetHash() []byte {
|
||||
if x != nil {
|
||||
return x.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetTo() []byte {
|
||||
if m != nil {
|
||||
return m.To
|
||||
func (x *ProtoCompleteTransaction_TxType) GetTo() []byte {
|
||||
if x != nil {
|
||||
return x.To
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetFrom() []byte {
|
||||
if m != nil {
|
||||
return m.From
|
||||
func (x *ProtoCompleteTransaction_TxType) GetFrom() []byte {
|
||||
if x != nil {
|
||||
return x.From
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 {
|
||||
if m != nil {
|
||||
return m.TransactionIndex
|
||||
func (x *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 {
|
||||
if x != nil {
|
||||
return x.TransactionIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ProtoCompleteTransaction_ReceiptType struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
GasUsed []byte `protobuf:"bytes,1,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"`
|
||||
Status []byte `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"`
|
||||
Log []*ProtoCompleteTransaction_ReceiptType_LogType `protobuf:"bytes,3,rep,name=Log" json:"Log,omitempty"`
|
||||
Log []*ProtoCompleteTransaction_ReceiptType_LogType `protobuf:"bytes,3,rep,name=Log,proto3" json:"Log,omitempty"`
|
||||
L1Fee []byte `protobuf:"bytes,4,opt,name=L1Fee,proto3,oneof" json:"L1Fee,omitempty"`
|
||||
L1FeeScalar []byte `protobuf:"bytes,5,opt,name=L1FeeScalar,proto3,oneof" json:"L1FeeScalar,omitempty"`
|
||||
L1GasPrice []byte `protobuf:"bytes,6,opt,name=L1GasPrice,proto3,oneof" json:"L1GasPrice,omitempty"`
|
||||
L1GasUsed []byte `protobuf:"bytes,7,opt,name=L1GasUsed,proto3,oneof" json:"L1GasUsed,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) Reset() {
|
||||
*x = ProtoCompleteTransaction_ReceiptType{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType) Reset() { *m = ProtoCompleteTransaction_ReceiptType{} }
|
||||
func (m *ProtoCompleteTransaction_ReceiptType) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProtoCompleteTransaction_ReceiptType) ProtoMessage() {}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProtoCompleteTransaction_ReceiptType.ProtoReflect.Descriptor instead.
|
||||
func (*ProtoCompleteTransaction_ReceiptType) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor0, []int{0, 1}
|
||||
return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 1}
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte {
|
||||
if m != nil {
|
||||
return m.GasUsed
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte {
|
||||
if x != nil {
|
||||
return x.GasUsed
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte {
|
||||
if m != nil {
|
||||
return m.Status
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType {
|
||||
if m != nil {
|
||||
return m.Log
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType {
|
||||
if x != nil {
|
||||
return x.Log
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetL1Fee() []byte {
|
||||
if x != nil {
|
||||
return x.L1Fee
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetL1FeeScalar() []byte {
|
||||
if x != nil {
|
||||
return x.L1FeeScalar
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetL1GasPrice() []byte {
|
||||
if x != nil {
|
||||
return x.L1GasPrice
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType) GetL1GasUsed() []byte {
|
||||
if x != nil {
|
||||
return x.L1GasUsed
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProtoCompleteTransaction_ReceiptType_LogType struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
|
||||
Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
|
||||
Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"Topics,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType_LogType) Reset() {
|
||||
*m = ProtoCompleteTransaction_ReceiptType_LogType{}
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) Reset() {
|
||||
*x = ProtoCompleteTransaction_ReceiptType_LogType{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
func (m *ProtoCompleteTransaction_ReceiptType_LogType) String() string {
|
||||
return proto.CompactTextString(m)
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ProtoCompleteTransaction_ReceiptType_LogType) ProtoMessage() {}
|
||||
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ProtoCompleteTransaction_ReceiptType_LogType.ProtoReflect.Descriptor instead.
|
||||
func (*ProtoCompleteTransaction_ReceiptType_LogType) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor0, []int{0, 1, 0}
|
||||
return file_bchain_coins_eth_ethtx_proto_rawDescGZIP(), []int{0, 1, 0}
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte {
|
||||
if m != nil {
|
||||
return m.Address
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte {
|
||||
if x != nil {
|
||||
return x.Address
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte {
|
||||
if m != nil {
|
||||
return m.Topics
|
||||
func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte {
|
||||
if x != nil {
|
||||
return x.Topics
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ProtoCompleteTransaction)(nil), "eth.ProtoCompleteTransaction")
|
||||
proto.RegisterType((*ProtoCompleteTransaction_TxType)(nil), "eth.ProtoCompleteTransaction.TxType")
|
||||
proto.RegisterType((*ProtoCompleteTransaction_ReceiptType)(nil), "eth.ProtoCompleteTransaction.ReceiptType")
|
||||
proto.RegisterType((*ProtoCompleteTransaction_ReceiptType_LogType)(nil), "eth.ProtoCompleteTransaction.ReceiptType.LogType")
|
||||
var File_bchain_coins_eth_ethtx_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_bchain_coins_eth_ethtx_proto_rawDesc = []byte{
|
||||
0x0a, 0x1c, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65,
|
||||
0x74, 0x68, 0x2f, 0x65, 0x74, 0x68, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd,
|
||||
0x06, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65,
|
||||
0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04,
|
||||
0x52, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x02, 0x54,
|
||||
0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43,
|
||||
0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x52, 0x02, 0x54, 0x78, 0x12, 0x3f, 0x0a,
|
||||
0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25,
|
||||
0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72,
|
||||
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70,
|
||||
0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x1a, 0xf8,
|
||||
0x01, 0x0a, 0x06, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x63, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||
0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
||||
0x08, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x61, 0x73,
|
||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x47, 0x61, 0x73,
|
||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50,
|
||||
0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x04, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x6f, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x72, 0x6f,
|
||||
0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x2a, 0x0a,
|
||||
0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65,
|
||||
0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x92, 0x03, 0x0a, 0x0b, 0x52, 0x65,
|
||||
0x63, 0x65, 0x69, 0x70, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x73,
|
||||
0x55, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x47, 0x61, 0x73, 0x55,
|
||||
0x73, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3f, 0x0a, 0x03, 0x4c,
|
||||
0x6f, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x54, 0x79, 0x70, 0x65, 0x2e,
|
||||
0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x0a, 0x05,
|
||||
0x4c, 0x31, 0x46, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x4c,
|
||||
0x31, 0x46, 0x65, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x4c, 0x31, 0x46, 0x65, 0x65,
|
||||
0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0b,
|
||||
0x4c, 0x31, 0x46, 0x65, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x23,
|
||||
0x0a, 0x0a, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x48, 0x02, 0x52, 0x0a, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65,
|
||||
0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x03, 0x52, 0x09, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55,
|
||||
0x73, 0x65, 0x64, 0x88, 0x01, 0x01, 0x1a, 0x4f, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70,
|
||||
0x65, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x44,
|
||||
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52,
|
||||
0x06, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x4c, 0x31, 0x46, 0x65,
|
||||
0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x4c, 0x31, 0x46, 0x65, 0x65, 0x53, 0x63, 0x61, 0x6c, 0x61,
|
||||
0x72, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65,
|
||||
0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x4c, 0x31, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x42, 0x12,
|
||||
0x5a, 0x10, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65,
|
||||
0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("bchain/coins/eth/ethtx.proto", fileDescriptor0) }
|
||||
var (
|
||||
file_bchain_coins_eth_ethtx_proto_rawDescOnce sync.Once
|
||||
file_bchain_coins_eth_ethtx_proto_rawDescData = file_bchain_coins_eth_ethtx_proto_rawDesc
|
||||
)
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 409 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xdf, 0x8a, 0xd4, 0x30,
|
||||
0x18, 0xc5, 0xe9, 0x9f, 0x99, 0xd9, 0xfd, 0xa6, 0x8a, 0x04, 0x91, 0x30, 0xec, 0x45, 0x59, 0xbc,
|
||||
0x18, 0xbd, 0xe8, 0xe2, 0xea, 0x0b, 0xac, 0x23, 0xae, 0xc2, 0xb0, 0x0e, 0x31, 0x7a, 0x9f, 0x49,
|
||||
0xc3, 0x36, 0x38, 0x6d, 0x4a, 0x93, 0x42, 0xf7, 0x8d, 0x7c, 0x21, 0xdf, 0xc5, 0x4b, 0xc9, 0xd7,
|
||||
0x74, 0x1d, 0x11, 0x65, 0x2f, 0x0a, 0xf9, 0x9d, 0x7e, 0xa7, 0x39, 0x27, 0x29, 0x9c, 0xed, 0x65,
|
||||
0x25, 0x74, 0x73, 0x21, 0x8d, 0x6e, 0xec, 0x85, 0x72, 0x95, 0x7f, 0xdc, 0x50, 0xb4, 0x9d, 0x71,
|
||||
0x86, 0x24, 0xca, 0x55, 0xe7, 0xdf, 0x67, 0x40, 0x77, 0x1e, 0x37, 0xa6, 0x6e, 0x0f, 0xca, 0x29,
|
||||
0xde, 0x89, 0xc6, 0x0a, 0xe9, 0xb4, 0x69, 0x48, 0x0e, 0xcb, 0xb7, 0x07, 0x23, 0xbf, 0xdd, 0xf4,
|
||||
0xf5, 0x5e, 0x75, 0x34, 0xca, 0xa3, 0xf5, 0x23, 0x76, 0x2c, 0x91, 0x33, 0x38, 0x45, 0xe4, 0xba,
|
||||
0x56, 0x34, 0xce, 0xa3, 0x75, 0xca, 0x7e, 0x0b, 0xe4, 0x0d, 0xc4, 0x7c, 0xa0, 0x49, 0x1e, 0xad,
|
||||
0x97, 0x97, 0xcf, 0x0b, 0xe5, 0xaa, 0xe2, 0x5f, 0x5b, 0x15, 0x7c, 0xe0, 0x77, 0xad, 0x62, 0x31,
|
||||
0x1f, 0xc8, 0x06, 0x16, 0x4c, 0x49, 0xa5, 0x5b, 0x47, 0x53, 0xb4, 0xbe, 0xf8, 0xbf, 0x35, 0x0c,
|
||||
0xa3, 0x7f, 0x72, 0xae, 0x7e, 0x46, 0x30, 0x1f, 0xbf, 0x49, 0xce, 0x21, 0xbb, 0x92, 0xd2, 0xf4,
|
||||
0x8d, 0xbb, 0x31, 0x8d, 0x54, 0x58, 0x23, 0x65, 0x7f, 0x68, 0x64, 0x05, 0x27, 0xd7, 0xc2, 0xee,
|
||||
0x3a, 0x2d, 0xc7, 0x1a, 0x19, 0xbb, 0xe7, 0xf0, 0x6e, 0xab, 0x6b, 0xed, 0xb0, 0x4b, 0xca, 0xee,
|
||||
0x99, 0x3c, 0x85, 0xd9, 0x57, 0x71, 0xe8, 0x15, 0x26, 0xcd, 0xd8, 0x08, 0x84, 0xc2, 0x62, 0x27,
|
||||
0xee, 0x0e, 0x46, 0x94, 0x74, 0x86, 0xfa, 0x84, 0x84, 0x40, 0xfa, 0x41, 0xd8, 0x8a, 0xce, 0x51,
|
||||
0xc6, 0x35, 0x79, 0x0c, 0x31, 0x37, 0x74, 0x81, 0x4a, 0xcc, 0x8d, 0x9f, 0x79, 0xdf, 0x99, 0x9a,
|
||||
0x9e, 0x8c, 0x33, 0x7e, 0x4d, 0x5e, 0xc2, 0x93, 0xa3, 0xca, 0x1f, 0x9b, 0x52, 0x0d, 0xf4, 0x14,
|
||||
0xaf, 0xe3, 0x2f, 0x7d, 0xf5, 0x23, 0x82, 0xe5, 0xd1, 0x99, 0xf8, 0x34, 0xd7, 0xc2, 0x7e, 0xb1,
|
||||
0xaa, 0xc4, 0xea, 0x19, 0x9b, 0x90, 0x3c, 0x83, 0xf9, 0x67, 0x27, 0x5c, 0x6f, 0x43, 0xe7, 0x40,
|
||||
0x64, 0x03, 0xc9, 0xd6, 0xdc, 0xd2, 0x24, 0x4f, 0xd6, 0xcb, 0xcb, 0x57, 0x0f, 0x3e, 0xfd, 0x62,
|
||||
0x6b, 0x6e, 0xf1, 0x16, 0xbc, 0x7b, 0xf5, 0x09, 0x16, 0x81, 0x7d, 0x82, 0xab, 0xb2, 0xec, 0x94,
|
||||
0xb5, 0x53, 0x82, 0x80, 0xbe, 0xeb, 0x3b, 0xe1, 0x44, 0xd8, 0x1f, 0xd7, 0x3e, 0x15, 0x37, 0xad,
|
||||
0x96, 0x16, 0x03, 0x64, 0x2c, 0xd0, 0x7e, 0x8e, 0xbf, 0xed, 0xeb, 0x5f, 0x01, 0x00, 0x00, 0xff,
|
||||
0xff, 0xc2, 0x69, 0x8d, 0xdf, 0xd6, 0x02, 0x00, 0x00,
|
||||
func file_bchain_coins_eth_ethtx_proto_rawDescGZIP() []byte {
|
||||
file_bchain_coins_eth_ethtx_proto_rawDescOnce.Do(func() {
|
||||
file_bchain_coins_eth_ethtx_proto_rawDescData = protoimpl.X.CompressGZIP(file_bchain_coins_eth_ethtx_proto_rawDescData)
|
||||
})
|
||||
return file_bchain_coins_eth_ethtx_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_bchain_coins_eth_ethtx_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_bchain_coins_eth_ethtx_proto_goTypes = []interface{}{
|
||||
(*ProtoCompleteTransaction)(nil), // 0: ProtoCompleteTransaction
|
||||
(*ProtoCompleteTransaction_TxType)(nil), // 1: ProtoCompleteTransaction.TxType
|
||||
(*ProtoCompleteTransaction_ReceiptType)(nil), // 2: ProtoCompleteTransaction.ReceiptType
|
||||
(*ProtoCompleteTransaction_ReceiptType_LogType)(nil), // 3: ProtoCompleteTransaction.ReceiptType.LogType
|
||||
}
|
||||
var file_bchain_coins_eth_ethtx_proto_depIdxs = []int32{
|
||||
1, // 0: ProtoCompleteTransaction.Tx:type_name -> ProtoCompleteTransaction.TxType
|
||||
2, // 1: ProtoCompleteTransaction.Receipt:type_name -> ProtoCompleteTransaction.ReceiptType
|
||||
3, // 2: ProtoCompleteTransaction.ReceiptType.Log:type_name -> ProtoCompleteTransaction.ReceiptType.LogType
|
||||
3, // [3:3] is the sub-list for method output_type
|
||||
3, // [3:3] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_bchain_coins_eth_ethtx_proto_init() }
|
||||
func file_bchain_coins_eth_ethtx_proto_init() {
|
||||
if File_bchain_coins_eth_ethtx_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_bchain_coins_eth_ethtx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProtoCompleteTransaction); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bchain_coins_eth_ethtx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProtoCompleteTransaction_TxType); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bchain_coins_eth_ethtx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProtoCompleteTransaction_ReceiptType); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_bchain_coins_eth_ethtx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ProtoCompleteTransaction_ReceiptType_LogType); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_bchain_coins_eth_ethtx_proto_msgTypes[2].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_bchain_coins_eth_ethtx_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_bchain_coins_eth_ethtx_proto_goTypes,
|
||||
DependencyIndexes: file_bchain_coins_eth_ethtx_proto_depIdxs,
|
||||
MessageInfos: file_bchain_coins_eth_ethtx_proto_msgTypes,
|
||||
}.Build()
|
||||
File_bchain_coins_eth_ethtx_proto = out.File
|
||||
file_bchain_coins_eth_ethtx_proto_rawDesc = nil
|
||||
file_bchain_coins_eth_ethtx_proto_goTypes = nil
|
||||
file_bchain_coins_eth_ethtx_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package eth;
|
||||
option go_package = "bchain/coins/eth";
|
||||
|
||||
message ProtoCompleteTransaction {
|
||||
message ProtoCompleteTransaction {
|
||||
message TxType {
|
||||
uint64 AccountNonce = 1;
|
||||
bytes GasPrice = 2;
|
||||
@ -22,9 +22,13 @@ syntax = "proto3";
|
||||
bytes GasUsed = 1;
|
||||
bytes Status = 2;
|
||||
repeated LogType Log = 3;
|
||||
optional bytes L1Fee = 4;
|
||||
optional bytes L1FeeScalar = 5;
|
||||
optional bytes L1GasPrice = 6;
|
||||
optional bytes L1GasUsed = 7;
|
||||
}
|
||||
uint32 BlockNumber = 1;
|
||||
uint64 BlockTime = 2;
|
||||
TxType Tx = 3;
|
||||
ReceiptType Receipt = 4;
|
||||
}
|
||||
}
|
||||
45
bchain/coins/optimism/evm.go
Normal file
45
bchain/coins/optimism/evm.go
Normal file
@ -0,0 +1,45 @@
|
||||
package optimism
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/trezor/blockbook/bchain"
|
||||
)
|
||||
|
||||
// OptimismRPCClient wraps an rpc client to implement the EVMRPCClient interface
|
||||
type OptimismRPCClient struct {
|
||||
*rpc.Client
|
||||
}
|
||||
|
||||
// EthSubscribe subscribes to events and returns a client subscription that implements the EVMClientSubscription interface
|
||||
func (c *OptimismRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (bchain.EVMClientSubscription, error) {
|
||||
sub, err := c.Client.EthSubscribe(ctx, channel, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &OptimismClientSubscription{ClientSubscription: sub}, nil
|
||||
}
|
||||
|
||||
// CallContext performs a JSON-RPC call with the given arguments
|
||||
func (c *OptimismRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error {
|
||||
if err := c.Client.CallContext(ctx, result, method, args...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// special case to handle empty gas price for a valid rpc transaction
|
||||
// (https://goerli-optimism.etherscan.io/tx/0x9b62094073147508471e3371920b68070979beea32100acdc49c721350b69cb9)
|
||||
if r, ok := result.(*bchain.RpcTransaction); ok {
|
||||
if *r != (bchain.RpcTransaction{}) && r.GasPrice == "" {
|
||||
r.GasPrice = "0x0"
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// OptimismClientSubscription wraps a client subcription to implement the EVMClientSubscription interface
|
||||
type OptimismClientSubscription struct {
|
||||
*rpc.ClientSubscription
|
||||
}
|
||||
83
bchain/coins/optimism/optimismrpc.go
Normal file
83
bchain/coins/optimism/optimismrpc.go
Normal file
@ -0,0 +1,83 @@
|
||||
package optimism
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/golang/glog"
|
||||
"github.com/juju/errors"
|
||||
"github.com/trezor/blockbook/bchain"
|
||||
"github.com/trezor/blockbook/bchain/coins/eth"
|
||||
)
|
||||
|
||||
const (
|
||||
// MainNet is production network
|
||||
MainNet eth.Network = 10
|
||||
)
|
||||
|
||||
// OptimismRPC is an interface to JSON-RPC optimism service.
|
||||
type OptimismRPC struct {
|
||||
*eth.EthereumRPC
|
||||
}
|
||||
|
||||
// NewOptimismRPC returns new OptimismRPC instance.
|
||||
func NewOptimismRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
|
||||
c, err := eth.NewEthereumRPC(config, pushHandler)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s := &OptimismRPC{
|
||||
EthereumRPC: c.(*eth.EthereumRPC),
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// Initialize bnb smart chain rpc interface
|
||||
func (b *OptimismRPC) Initialize() error {
|
||||
b.OpenRPC = func(url string) (bchain.EVMRPCClient, bchain.EVMClient, error) {
|
||||
r, err := rpc.Dial(url)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
rc := &OptimismRPCClient{Client: r}
|
||||
ec := ð.EthereumClient{Client: ethclient.NewClient(r)}
|
||||
return rc, ec, nil
|
||||
}
|
||||
|
||||
rc, ec, err := b.OpenRPC(b.ChainConfig.RPCURL)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// set chain specific
|
||||
b.Client = ec
|
||||
b.RPC = rc
|
||||
b.MainNetChainID = MainNet
|
||||
b.NewBlock = eth.NewEthereumNewBlock()
|
||||
b.NewTx = eth.NewEthereumNewTx()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), b.Timeout)
|
||||
defer cancel()
|
||||
|
||||
id, err := b.Client.NetworkID(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// parameters for getInfo request
|
||||
switch eth.Network(id.Uint64()) {
|
||||
case MainNet:
|
||||
b.Testnet = false
|
||||
b.Network = "livenet"
|
||||
default:
|
||||
return errors.Errorf("Unknown network id %v", id)
|
||||
}
|
||||
|
||||
glog.Info("rpc: block chain ", b.Network)
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -125,6 +125,10 @@ type RpcReceipt struct {
|
||||
GasUsed string `json:"gasUsed"`
|
||||
Status string `json:"status"`
|
||||
Logs []*RpcLog `json:"logs"`
|
||||
L1Fee string `json:"l1Fee,omitempty"`
|
||||
L1FeeScalar string `json:"l1FeeScalar,omitempty"`
|
||||
L1GasPrice string `json:"l1GasPrice,omitempty"`
|
||||
L1GasUsed string `json:"l1GasUsed,omitempty"`
|
||||
}
|
||||
|
||||
// EthereumSpecificData contains data specific to Ethereum transactions
|
||||
|
||||
@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y devscripts debhelper make dh-exec && \
|
||||
apt-get install -y devscripts debhelper make dh-exec zstd && \
|
||||
apt-get clean
|
||||
|
||||
ADD gpg-keys /tmp/gpg-keys
|
||||
|
||||
44
build/templates/backend/scripts/optimism.sh
Normal file
44
build/templates/backend/scripts/optimism.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
{{define "main" -}}
|
||||
|
||||
set -e
|
||||
|
||||
GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth
|
||||
DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
|
||||
|
||||
CHAINDATA_DIR=$DATA_DIR/geth/chaindata
|
||||
SNAPSHOT=https://r2-snapshots.fastnode.io/op/$(curl -s https://r2-snapshots.fastnode.io/op/latest-mainnet)
|
||||
|
||||
if [ ! -d "$CHAINDATA_DIR" ]; then
|
||||
wget -c $SNAPSHOT -O - | lz4 -cd | tar xf - -C $DATA_DIR
|
||||
fi
|
||||
|
||||
$GETH_BIN \
|
||||
--op-network op-mainnet \
|
||||
--datadir $DATA_DIR \
|
||||
--authrpc.jwtsecret $DATA_DIR/jwtsecret \
|
||||
--authrpc.addr 127.0.0.1 \
|
||||
--authrpc.port {{.Ports.BackendAuthRpc}} \
|
||||
--authrpc.vhosts "*" \
|
||||
--port {{.Ports.BackendP2P}} \
|
||||
--http \
|
||||
--http.port {{.Ports.BackendHttp}} \
|
||||
--http.addr 127.0.0.1 \
|
||||
--http.api eth,net,web3,debug,txpool,engine \
|
||||
--http.vhosts "*" \
|
||||
--http.corsdomain "*" \
|
||||
--ws \
|
||||
--ws.port {{.Ports.BackendRPC}} \
|
||||
--ws.addr 127.0.0.1 \
|
||||
--ws.api eth,net,web3,debug,txpool,engine \
|
||||
--ws.origins "*" \
|
||||
--rollup.disabletxpoolgossip=true \
|
||||
--rollup.sequencerhttp https://mainnet-sequencer.optimism.io \
|
||||
--txlookuplimit 0 \
|
||||
--cache 4096 \
|
||||
--syncmode full \
|
||||
--maxpeers 0 \
|
||||
--nodiscover
|
||||
|
||||
{{end}}
|
||||
48
build/templates/backend/scripts/optimism_archive.sh
Normal file
48
build/templates/backend/scripts/optimism_archive.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
{{define "main" -}}
|
||||
|
||||
set -e
|
||||
|
||||
GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth
|
||||
DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
|
||||
|
||||
CHAINDATA_DIR=$DATA_DIR/geth/chaindata
|
||||
SNAPSHOT=https://datadirs.optimism.io/latest
|
||||
|
||||
if [ ! -d "$CHAINDATA_DIR" ]; then
|
||||
wget -c $SNAPSHOT -O - | zstd -cd | tar xf - -C $DATA_DIR
|
||||
fi
|
||||
|
||||
$GETH_BIN \
|
||||
--op-network op-mainnet \
|
||||
--datadir $DATA_DIR \
|
||||
--authrpc.jwtsecret $DATA_DIR/jwtsecret \
|
||||
--authrpc.addr 127.0.0.1 \
|
||||
--authrpc.port {{.Ports.BackendAuthRpc}} \
|
||||
--authrpc.vhosts "*" \
|
||||
--port {{.Ports.BackendP2P}} \
|
||||
--http \
|
||||
--http.port {{.Ports.BackendHttp}} \
|
||||
--http.addr 127.0.0.1 \
|
||||
--http.api eth,net,web3,debug,txpool,engine \
|
||||
--http.vhosts "*" \
|
||||
--http.corsdomain "*" \
|
||||
--ws \
|
||||
--ws.port {{.Ports.BackendRPC}} \
|
||||
--ws.addr 127.0.0.1 \
|
||||
--ws.api eth,net,web3,debug,txpool,engine \
|
||||
--ws.origins "*" \
|
||||
--rollup.disabletxpoolgossip=true \
|
||||
--rollup.historicalrpc http://127.0.0.1:8304 \
|
||||
--rollup.sequencerhttp https://mainnet.sequencer.optimism.io \
|
||||
--cache 4096 \
|
||||
--cache.gc 0 \
|
||||
--cache.trie 30 \
|
||||
--cache.snapshot 20 \
|
||||
--syncmode full \
|
||||
--gcmode archive \
|
||||
--maxpeers 0 \
|
||||
--nodiscover
|
||||
|
||||
{{end}}
|
||||
@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
{{define "main" -}}
|
||||
|
||||
set -e
|
||||
|
||||
export USING_OVM=true
|
||||
export ETH1_SYNC_SERVICE_ENABLE=false
|
||||
|
||||
GETH_BIN={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth
|
||||
DATA_DIR={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
|
||||
|
||||
CHAINDATA_DIR=$DATA_DIR/geth/chaindata
|
||||
SNAPSHOT=https://datadirs.optimism.io/mainnet-legacy-archival.tar.zst
|
||||
|
||||
if [ ! -d "$CHAINDATA_DIR" ]; then
|
||||
wget -c $SNAPSHOT -O - | zstd -cd | tar xf - -C $DATA_DIR
|
||||
fi
|
||||
|
||||
$GETH_BIN \
|
||||
--networkid 10 \
|
||||
--datadir $DATA_DIR \
|
||||
--port {{.Ports.BackendP2P}} \
|
||||
--rpc \
|
||||
--rpcport {{.Ports.BackendHttp}} \
|
||||
--rpcaddr 127.0.0.1 \
|
||||
--rpcapi eth,rollup,net,web3,debug \
|
||||
--rpcvhosts "*" \
|
||||
--rpccorsdomain "*" \
|
||||
--ws \
|
||||
--wsport {{.Ports.BackendRPC}} \
|
||||
--wsaddr 0.0.0.0 \
|
||||
--wsapi eth,rollup,net,web3,debug \
|
||||
--wsorigins "*" \
|
||||
--nousb \
|
||||
--ipcdisable \
|
||||
--nat=none \
|
||||
--nodiscover
|
||||
|
||||
{{end}}
|
||||
66
configs/coins/optimism.json
Normal file
66
configs/coins/optimism.json
Normal file
@ -0,0 +1,66 @@
|
||||
{
|
||||
"coin": {
|
||||
"name": "Optimism",
|
||||
"shortcut": "ETH",
|
||||
"label": "Optimism",
|
||||
"alias": "optimism"
|
||||
},
|
||||
"ports": {
|
||||
"backend_rpc": 8200,
|
||||
"backend_p2p": 38400,
|
||||
"backend_http": 8300,
|
||||
"backend_authrpc": 8400,
|
||||
"blockbook_internal": 9200,
|
||||
"blockbook_public": 9300
|
||||
},
|
||||
"ipc": {
|
||||
"rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}",
|
||||
"rpc_timeout": 25
|
||||
},
|
||||
"backend": {
|
||||
"package_name": "backend-optimism",
|
||||
"package_revision": "satoshilabs-1",
|
||||
"system_user": "optimism",
|
||||
"version": "1.101315.1",
|
||||
"binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz",
|
||||
"verification_type": "sha256",
|
||||
"verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f",
|
||||
"extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf",
|
||||
"exclude_files": [],
|
||||
"exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
|
||||
"exec_script": "optimism.sh",
|
||||
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
|
||||
"postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret",
|
||||
"service_type": "simple",
|
||||
"service_additional_params_template": "",
|
||||
"protect_memory": true,
|
||||
"mainnet": true,
|
||||
"server_config_file": "",
|
||||
"client_config_file": ""
|
||||
},
|
||||
"blockbook": {
|
||||
"package_name": "blockbook-optimism",
|
||||
"system_user": "blockbook-optimism",
|
||||
"internal_binding_template": ":{{.Ports.BlockbookInternal}}",
|
||||
"public_binding_template": ":{{.Ports.BlockbookPublic}}",
|
||||
"explorer_url": "",
|
||||
"additional_params": "",
|
||||
"block_chain": {
|
||||
"parse": true,
|
||||
"mempool_workers": 8,
|
||||
"mempool_sub_workers": 2,
|
||||
"block_addresses_to_keep": 300,
|
||||
"additional_params": {
|
||||
"mempoolTxTimeoutHours": 48,
|
||||
"queryBackendOnMempoolResync": false,
|
||||
"fiat_rates": "coingecko",
|
||||
"fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH",
|
||||
"fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"package_maintainer": "IT",
|
||||
"package_maintainer_email": "it@satoshilabs.com"
|
||||
}
|
||||
}
|
||||
69
configs/coins/optimism_archive.json
Normal file
69
configs/coins/optimism_archive.json
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"coin": {
|
||||
"name": "Optimism Archive",
|
||||
"shortcut": "ETH",
|
||||
"label": "Optimism",
|
||||
"alias": "optimism_archive"
|
||||
},
|
||||
"ports": {
|
||||
"backend_rpc": 8202,
|
||||
"backend_p2p": 38402,
|
||||
"backend_http": 8302,
|
||||
"backend_authrpc": 8402,
|
||||
"blockbook_internal": 9202,
|
||||
"blockbook_public": 9302
|
||||
},
|
||||
"ipc": {
|
||||
"rpc_url_template": "ws://127.0.0.1:{{.Ports.BackendRPC}}",
|
||||
"rpc_timeout": 25
|
||||
},
|
||||
"backend": {
|
||||
"package_name": "backend-optimism-archive",
|
||||
"package_revision": "satoshilabs-1",
|
||||
"system_user": "optimism",
|
||||
"version": "1.101315.1",
|
||||
"binary_url": "https://github.com/ethereum-optimism/op-geth/archive/refs/tags/v1.101315.1.tar.gz",
|
||||
"verification_type": "sha256",
|
||||
"verification_source": "f0f31ef2982f87f9e3eb90f2b603f5fcd9d680e487d35f5bdcf5aeba290b153f",
|
||||
"extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf",
|
||||
"exclude_files": [],
|
||||
"exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
|
||||
"exec_script": "optimism_archive.sh",
|
||||
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
|
||||
"postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source && openssl rand -hex 32 > {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/jwtsecret",
|
||||
"service_type": "simple",
|
||||
"service_additional_params_template": "",
|
||||
"protect_memory": true,
|
||||
"mainnet": true,
|
||||
"server_config_file": "",
|
||||
"client_config_file": ""
|
||||
},
|
||||
"blockbook": {
|
||||
"package_name": "blockbook-optimism-archive",
|
||||
"system_user": "blockbook-optimism",
|
||||
"internal_binding_template": ":{{.Ports.BlockbookInternal}}",
|
||||
"public_binding_template": ":{{.Ports.BlockbookPublic}}",
|
||||
"explorer_url": "",
|
||||
"additional_params": "-workers=16",
|
||||
"block_chain": {
|
||||
"parse": true,
|
||||
"mempool_workers": 8,
|
||||
"mempool_sub_workers": 2,
|
||||
"block_addresses_to_keep": 600,
|
||||
"additional_params": {
|
||||
"address_aliases": true,
|
||||
"mempoolTxTimeoutHours": 48,
|
||||
"processInternalTransactions": true,
|
||||
"queryBackendOnMempoolResync": false,
|
||||
"fiat_rates": "coingecko",
|
||||
"fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH",
|
||||
"fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}",
|
||||
"fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"package_maintainer": "IT",
|
||||
"package_maintainer_email": "it@satoshilabs.com"
|
||||
}
|
||||
}
|
||||
40
configs/coins/optimism_archive_legacy_geth.json
Normal file
40
configs/coins/optimism_archive_legacy_geth.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"coin": {
|
||||
"name": "Optimism Archive Legacy Geth",
|
||||
"shortcut": "ETH",
|
||||
"label": "Optimism",
|
||||
"alias": "optimism_archive_legacy_geth"
|
||||
},
|
||||
"ports": {
|
||||
"backend_rpc": 8204,
|
||||
"backend_http": 8304,
|
||||
"backend_p2p": 38404,
|
||||
"blockbook_internal": 9204,
|
||||
"blockbook_public": 9304
|
||||
},
|
||||
"backend": {
|
||||
"package_name": "backend-optimism-archive-legacy-geth",
|
||||
"package_revision": "satoshilabs-1",
|
||||
"system_user": "optimism",
|
||||
"version": "0.5.31",
|
||||
"binary_url": "https://github.com/ethereum-optimism/optimism-legacy/archive/refs/heads/develop.zip",
|
||||
"verification_type": "sha256",
|
||||
"verification_source": "367b32b3f4c1450a57fa57650a0abdfb74ae58c09123d94b161aaec90fd6b883",
|
||||
"extract_command": "mkdir backend/source && unzip -d backend/source",
|
||||
"exclude_files": [],
|
||||
"exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/optimism_archive_legacy_geth_exec.sh 2>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
|
||||
"exec_script": "optimism_archive_legacy_geth.sh",
|
||||
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
|
||||
"postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/optimism-legacy-devlop/l2geth && make geth && mv build/bin/geth {{.Env.BackendInstallPath}}/{{.Coin.Alias}} && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source",
|
||||
"service_type": "simple",
|
||||
"service_additional_params_template": "",
|
||||
"protect_memory": true,
|
||||
"mainnet": true,
|
||||
"server_config_file": "",
|
||||
"client_config_file": ""
|
||||
},
|
||||
"meta": {
|
||||
"package_maintainer": "IT",
|
||||
"package_maintainer_email": "it@satoshilabs.com"
|
||||
}
|
||||
}
|
||||
37
configs/coins/optimism_archive_op_node.json
Normal file
37
configs/coins/optimism_archive_op_node.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"coin": {
|
||||
"name": "Optimism Archive Op-Node",
|
||||
"shortcut": "ETH",
|
||||
"label": "Optimism",
|
||||
"alias": "optimism_archive_op_node"
|
||||
},
|
||||
"ports": {
|
||||
"backend_rpc": 8203,
|
||||
"blockbook_internal": 9203,
|
||||
"blockbook_public": 9303
|
||||
},
|
||||
"backend": {
|
||||
"package_name": "backend-optimism-archive-op-node",
|
||||
"package_revision": "satoshilabs-1",
|
||||
"system_user": "optimism",
|
||||
"version": "1.7.6",
|
||||
"binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz",
|
||||
"verification_type": "sha256",
|
||||
"verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab",
|
||||
"extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf",
|
||||
"exclude_files": [],
|
||||
"exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network mainnet --l1 http://127.0.0.1:8116 --l1.beacon http://127.0.0.1:7516 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8402 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism_archive/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
|
||||
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
|
||||
"postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source",
|
||||
"service_type": "simple",
|
||||
"service_additional_params_template": "",
|
||||
"protect_memory": true,
|
||||
"mainnet": true,
|
||||
"server_config_file": "",
|
||||
"client_config_file": ""
|
||||
},
|
||||
"meta": {
|
||||
"package_maintainer": "IT",
|
||||
"package_maintainer_email": "it@satoshilabs.com"
|
||||
}
|
||||
}
|
||||
37
configs/coins/optimism_op_node.json
Normal file
37
configs/coins/optimism_op_node.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"coin": {
|
||||
"name": "Optimism Op-Node",
|
||||
"shortcut": "ETH",
|
||||
"label": "Optimism",
|
||||
"alias": "optimism_op_node"
|
||||
},
|
||||
"ports": {
|
||||
"backend_rpc": 8201,
|
||||
"blockbook_internal": 9201,
|
||||
"blockbook_public": 9301
|
||||
},
|
||||
"backend": {
|
||||
"package_name": "backend-optimism-op-node",
|
||||
"package_revision": "satoshilabs-1",
|
||||
"system_user": "optimism",
|
||||
"version": "1.7.6",
|
||||
"binary_url": "https://github.com/ethereum-optimism/optimism/archive/refs/tags/op-node/v1.7.6.tar.gz",
|
||||
"verification_type": "sha256",
|
||||
"verification_source": "91384e4834f0d0776d1c3e19613b5c50a904f6e5814349e444d42d9e8be5a7ab",
|
||||
"extract_command": "mkdir backend/source && tar -C backend/source --strip 1 -xf",
|
||||
"exclude_files": [],
|
||||
"exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node --network op-mainnet --l1 http://127.0.0.1:8136 --l1.beacon http://127.0.0.1:7536 --l1.trustrpc --l1.rpckind=debug_geth --l2 http://127.0.0.1:8400 --rpc.addr 127.0.0.1 --rpc.port {{.Ports.BackendRPC}} --l2.jwt-secret {{.Env.BackendDataPath}}/optimism/backend/jwtsecret 2>&1>> {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'",
|
||||
"logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log",
|
||||
"postinst_script_template": "cd {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source/op-node && go build -o {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/op-node ./cmd && rm -rf {{.Env.BackendInstallPath}}/{{.Coin.Alias}}/source",
|
||||
"service_type": "simple",
|
||||
"service_additional_params_template": "",
|
||||
"protect_memory": true,
|
||||
"mainnet": true,
|
||||
"server_config_file": "",
|
||||
"client_config_file": ""
|
||||
},
|
||||
"meta": {
|
||||
"package_maintainer": "IT",
|
||||
"package_maintainer_email": "it@satoshilabs.com"
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
# Registry of ports
|
||||
|
||||
| coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) |
|
||||
|----------------------------------|------------------|--------------------|-------------|--------------------------------------|
|
||||
|----------------------------------|------------------|--------------------|-------------|-----------------------------------------------------|
|
||||
| Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc |
|
||||
| Bitcoin | 9130 | 9030 | 8030 | 38330 |
|
||||
| Bitcoin Cash | 9131 | 9031 | 8031 | 38331 |
|
||||
@ -53,6 +53,8 @@
|
||||
| eCash | 9197 | 9097 | 8097 | 38397 |
|
||||
| Avalanche | 9198 | 9098 | 8098 | 38398 p2p |
|
||||
| Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p |
|
||||
| Optimism | 9300 | 9200 | 8200 | 38400 p2p, 8300 http, 8400 authrpc |
|
||||
| Optimism Archive | 9302 | 9202 | 8202 | 38402 p2p, 8302 http, 8402 authrpc |
|
||||
| Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p |
|
||||
| Bitcoin Signet | 19120 | 19020 | 18020 | 48320 |
|
||||
| Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 |
|
||||
@ -62,7 +64,7 @@
|
||||
| Dash Testnet | 19133 | 19033 | 18033 | 48333 |
|
||||
| Litecoin Testnet | 19134 | 19034 | 18034 | 48334 |
|
||||
| Bitcoin Gold Testnet | 19135 | 19035 | 18035 | 48335 |
|
||||
| Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18536 authrpc, 48336 p2p |
|
||||
| Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18136 torrent, 18536 authrpc, 48336 p2p |
|
||||
| Dogecoin Testnet | 19138 | 19038 | 18038 | 48338 |
|
||||
| Vertcoin Testnet | 19140 | 19040 | 18040 | 48340 |
|
||||
| Monacoin Testnet | 19141 | 19041 | 18041 | 48341 |
|
||||
@ -75,7 +77,7 @@
|
||||
| Decred Testnet | 19161 | 19061 | 18061 | 48361 |
|
||||
| Flo Testnet | 19166 | 19066 | 18066 | 48366 |
|
||||
| Ethereum Testnet Sepolia | 19176 | 19076 | 18076 | 18176 http, 18576 authrpc, 48376 p2p |
|
||||
| Ethereum Testnet Sepolia Archive | 19186 | 19086 | 18086 | 18186 http, 18586 authrpc, 48386 p2p |
|
||||
| Ethereum Testnet Sepolia Archive | 19186 | 19086 | 18086 | 18186 http, 18186 torrent, 18586 authrpc, 48386 p2p |
|
||||
| Qtum Testnet | 19188 | 19088 | 18088 | 48388 |
|
||||
| Omotenashicoin Testnet | 19189 | 19089 | 18089 | 48389 |
|
||||
|
||||
|
||||
@ -51,6 +51,24 @@
|
||||
<td>Gas Price</td>
|
||||
<td>{{amountSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} <span class="fw-normal ps-3">({{amountSatsSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} Gwei)</span></td>
|
||||
</tr>
|
||||
{{if $tx.EthereumSpecific.L1GasUsed}}
|
||||
<tr>
|
||||
<td>L1 Gas Used</td>
|
||||
<td>{{formatBigInt $tx.EthereumSpecific.L1GasUsed}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{if $tx.EthereumSpecific.L1GasPrice}}
|
||||
<tr>
|
||||
<td>L1 Gas Price</td>
|
||||
<td>{{amountSpan $tx.EthereumSpecific.L1GasPrice $data "copyable"}} <span class="fw-normal ps-3">({{amountSatsSpan $tx.EthereumSpecific.L1GasPrice $data "copyable"}} Gwei)</span></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{if $tx.EthereumSpecific.L1FeeScalar}}
|
||||
<tr>
|
||||
<td>L1 Fee Scalar</td>
|
||||
<td>{{$tx.EthereumSpecific.L1FeeScalar}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<tr>
|
||||
<td>Total Input</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user