add optimism support

This commit is contained in:
kaladinlight 2023-03-22 15:15:56 -06:00 committed by Martin
parent 6f170e07b0
commit f0dd0e80b0
21 changed files with 1138 additions and 278 deletions

View File

@ -232,6 +232,10 @@ type EthereumSpecific struct {
GasLimit *big.Int `json:"gasLimit"` GasLimit *big.Int `json:"gasLimit"`
GasUsed *big.Int `json:"gasUsed,omitempty"` GasUsed *big.Int `json:"gasUsed,omitempty"`
GasPrice *Amount `json:"gasPrice,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"` Data string `json:"data,omitempty"`
ParsedData *bchain.EthereumParsedInputData `json:"parsedData,omitempty"` ParsedData *bchain.EthereumParsedInputData `json:"parsedData,omitempty"`
InternalTransfers []EthereumInternalTransfer `json:"internalTransfers,omitempty"` InternalTransfers []EthereumInternalTransfer `json:"internalTransfers,omitempty"`

View File

@ -429,18 +429,25 @@ func (w *Worker) getTransactionFromBchainTx(bchainTx *bchain.Tx, height int, spe
// mempool txs do not have fees yet // mempool txs do not have fees yet
if ethTxData.GasUsed != nil { if ethTxData.GasUsed != nil {
feesSat.Mul(ethTxData.GasPrice, ethTxData.GasUsed) feesSat.Mul(ethTxData.GasPrice, ethTxData.GasUsed)
if ethTxData.L1Fee != nil {
feesSat.Add(&feesSat, ethTxData.L1Fee)
}
} }
if len(bchainTx.Vout) > 0 { if len(bchainTx.Vout) > 0 {
valOutSat = bchainTx.Vout[0].ValueSat valOutSat = bchainTx.Vout[0].ValueSat
} }
ethSpecific = &EthereumSpecific{ ethSpecific = &EthereumSpecific{
GasLimit: ethTxData.GasLimit, GasLimit: ethTxData.GasLimit,
GasPrice: (*Amount)(ethTxData.GasPrice), GasPrice: (*Amount)(ethTxData.GasPrice),
GasUsed: ethTxData.GasUsed, GasUsed: ethTxData.GasUsed,
Nonce: ethTxData.Nonce, L1Fee: ethTxData.L1Fee,
Status: ethTxData.Status, L1FeeScalar: ethTxData.L1FeeScalar,
Data: ethTxData.Data, L1GasPrice: (*Amount)(ethTxData.L1GasPrice),
ParsedData: parsedInputData, L1GasUsed: ethTxData.L1GasUsed,
Nonce: ethTxData.Nonce,
Status: ethTxData.Status,
Data: ethTxData.Data,
ParsedData: parsedInputData,
} }
if internalData != nil { if internalData != nil {
ethSpecific.Type = internalData.Type ethSpecific.Type = internalData.Type

View File

@ -42,6 +42,7 @@ import (
"github.com/trezor/blockbook/bchain/coins/namecoin" "github.com/trezor/blockbook/bchain/coins/namecoin"
"github.com/trezor/blockbook/bchain/coins/nuls" "github.com/trezor/blockbook/bchain/coins/nuls"
"github.com/trezor/blockbook/bchain/coins/omotenashicoin" "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/pivx"
"github.com/trezor/blockbook/bchain/coins/polis" "github.com/trezor/blockbook/bchain/coins/polis"
"github.com/trezor/blockbook/bchain/coins/polygon" "github.com/trezor/blockbook/bchain/coins/polygon"
@ -138,6 +139,8 @@ func init() {
BlockChainFactories["BNB Smart Chain Archive"] = bsc.NewBNBSmartChainRPC BlockChainFactories["BNB Smart Chain Archive"] = bsc.NewBNBSmartChainRPC
BlockChainFactories["Polygon"] = polygon.NewPolygonRPC BlockChainFactories["Polygon"] = polygon.NewPolygonRPC
BlockChainFactories["Polygon Archive"] = 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 // NewBlockChain creates bchain.BlockChain and bchain.Mempool for the coin passed by the parameter coin

View File

@ -7,10 +7,10 @@ import (
"strings" "strings"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/golang/protobuf/proto"
"github.com/juju/errors" "github.com/juju/errors"
"github.com/trezor/blockbook/bchain" "github.com/trezor/blockbook/bchain"
"golang.org/x/crypto/sha3" "golang.org/x/crypto/sha3"
"google.golang.org/protobuf/proto"
) )
// EthereumTypeAddressDescriptorLen - the AddressDescriptor of EthereumType has fixed length // 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 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) return proto.Marshal(pt)
} }
@ -359,27 +377,37 @@ func (p *EthereumParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) {
} }
var rr *bchain.RpcReceipt var rr *bchain.RpcReceipt
if pt.Receipt != nil { 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 { for i, l := range pt.Receipt.Log {
topics := make([]string, len(l.Topics)) topics := make([]string, len(l.Topics))
for j, t := range l.Topics { for j, t := range l.Topics {
topics[j] = hexutil.Encode(t) topics[j] = hexutil.Encode(t)
} }
logs[i] = &bchain.RpcLog{ rr.Logs[i] = &bchain.RpcLog{
Address: EIP55Address(l.Address), Address: EIP55Address(l.Address),
Data: hexutil.Encode(l.Data), Data: hexutil.Encode(l.Data),
Topics: topics, Topics: topics,
} }
} }
status := ""
// handle a special value []byte{'U'} as unknown state // handle a special value []byte{'U'} as unknown state
if len(pt.Receipt.Status) != 1 || pt.Receipt.Status[0] != 'U' { 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{ if len(pt.Receipt.L1Fee) > 0 {
GasUsed: hexEncodeBig(pt.Receipt.GasUsed), rr.L1Fee = hexEncodeBig(pt.Receipt.L1Fee)
Status: status, }
Logs: logs, 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 // TODO handle internal transactions
@ -477,12 +505,16 @@ const (
// EthereumTxData contains ethereum specific transaction data // EthereumTxData contains ethereum specific transaction data
type EthereumTxData struct { type EthereumTxData struct {
Status TxStatus `json:"status"` // 1 OK, 0 Fail, -1 pending, -2 unknown Status TxStatus `json:"status"` // 1 OK, 0 Fail, -1 pending, -2 unknown
Nonce uint64 `json:"nonce"` Nonce uint64 `json:"nonce"`
GasLimit *big.Int `json:"gaslimit"` GasLimit *big.Int `json:"gaslimit"`
GasUsed *big.Int `json:"gasused"` GasUsed *big.Int `json:"gasused"`
GasPrice *big.Int `json:"gasprice"` GasPrice *big.Int `json:"gasprice"`
Data string `json:"data"` 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"`
} }
// GetEthereumTxData returns EthereumTxData from bchain.Tx // GetEthereumTxData returns EthereumTxData from bchain.Tx
@ -511,6 +543,10 @@ func GetEthereumTxDataFromSpecificData(coinSpecificData interface{}) *EthereumTx
etd.Status = TxStatusFailure etd.Status = TxStatusFailure
} }
etd.GasUsed, _ = hexutil.DecodeBig(csd.Receipt.GasUsed) 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 return &etd

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io"
"math/big" "math/big"
"net/http" "net/http"
"strconv" "strconv"
@ -377,7 +377,7 @@ func (b *EthereumRPC) getConsensusVersion() string {
glog.Error("getConsensusVersion ", err) glog.Error("getConsensusVersion ", err)
return "" return ""
} }
body, err := ioutil.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
if err != nil { if err != nil {
glog.Error("getConsensusVersion ", err) glog.Error("getConsensusVersion ", err)
return "" 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 { func (b *EthereumRPC) processCallTrace(call *rpcCallTrace, d *bchain.EthereumInternalData, contracts []bchain.ContractInfo, blockHeight uint32) []bchain.ContractInfo {
value, err := hexutil.DecodeBig(call.Value) value, err := hexutil.DecodeBig(call.Value)
if err != nil {
value = new(big.Int)
}
if call.Type == "CREATE" || call.Type == "CREATE2" { if call.Type == "CREATE" || call.Type == "CREATE2" {
d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{ d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{
Type: bchain.CREATE, 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) { func (b *EthereumRPC) GetTransaction(txid string) (*bchain.Tx, error) {
ctx, cancel := context.WithTimeout(context.Background(), b.Timeout) ctx, cancel := context.WithTimeout(context.Background(), b.Timeout)
defer cancel() defer cancel()
var tx *bchain.RpcTransaction tx := &bchain.RpcTransaction{}
hash := ethcommon.HexToHash(txid) 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 { if err != nil {
return nil, err return nil, err
} else if tx == nil { }
if *tx == (bchain.RpcTransaction{}) {
if b.mempoolInitialized { if b.mempoolInitialized {
b.Mempool.RemoveTransactionFromMempool(txid) b.Mempool.RemoveTransactionFromMempool(txid)
} }

View File

@ -1,261 +1,530 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // 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 // 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 package eth
import proto "github.com/golang/protobuf/proto" import (
import fmt "fmt" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
import math "math" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
// Reference imports to suppress errors if they are not otherwise used. const (
var _ = proto.Marshal // Verify that this generated code is sufficiently up-to-date.
var _ = fmt.Errorf _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
var _ = math.Inf // Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
// 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
type ProtoCompleteTransaction struct { type ProtoCompleteTransaction struct {
BlockNumber uint32 `protobuf:"varint,1,opt,name=BlockNumber" json:"BlockNumber,omitempty"` state protoimpl.MessageState
BlockTime uint64 `protobuf:"varint,2,opt,name=BlockTime" json:"BlockTime,omitempty"` sizeCache protoimpl.SizeCache
Tx *ProtoCompleteTransaction_TxType `protobuf:"bytes,3,opt,name=Tx" json:"Tx,omitempty"` unknownFields protoimpl.UnknownFields
Receipt *ProtoCompleteTransaction_ReceiptType `protobuf:"bytes,4,opt,name=Receipt" json:"Receipt,omitempty"`
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 (m *ProtoCompleteTransaction) Reset() { *m = ProtoCompleteTransaction{} } func (x *ProtoCompleteTransaction) Reset() {
func (m *ProtoCompleteTransaction) String() string { return proto.CompactTextString(m) } *x = ProtoCompleteTransaction{}
func (*ProtoCompleteTransaction) ProtoMessage() {} if protoimpl.UnsafeEnabled {
func (*ProtoCompleteTransaction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } mi := &file_bchain_coins_eth_ethtx_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (m *ProtoCompleteTransaction) GetBlockNumber() uint32 { func (x *ProtoCompleteTransaction) String() string {
if m != nil { return protoimpl.X.MessageStringOf(x)
return m.BlockNumber }
func (*ProtoCompleteTransaction) ProtoMessage() {}
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 return 0
} }
func (m *ProtoCompleteTransaction) GetBlockTime() uint64 { func (x *ProtoCompleteTransaction) GetBlockTime() uint64 {
if m != nil { if x != nil {
return m.BlockTime return x.BlockTime
} }
return 0 return 0
} }
func (m *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType { func (x *ProtoCompleteTransaction) GetTx() *ProtoCompleteTransaction_TxType {
if m != nil { if x != nil {
return m.Tx return x.Tx
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType { func (x *ProtoCompleteTransaction) GetReceipt() *ProtoCompleteTransaction_ReceiptType {
if m != nil { if x != nil {
return m.Receipt return x.Receipt
} }
return nil return nil
} }
type ProtoCompleteTransaction_TxType struct { 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"` 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"` Value []byte `protobuf:"bytes,4,opt,name=Value,proto3" json:"Value,omitempty"`
Payload []byte `protobuf:"bytes,5,opt,name=Payload,proto3" json:"Payload,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"` Hash []byte `protobuf:"bytes,6,opt,name=Hash,proto3" json:"Hash,omitempty"`
To []byte `protobuf:"bytes,7,opt,name=To,proto3" json:"To,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"` 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 (m *ProtoCompleteTransaction_TxType) Reset() { *m = ProtoCompleteTransaction_TxType{} } func (x *ProtoCompleteTransaction_TxType) Reset() {
func (m *ProtoCompleteTransaction_TxType) String() string { return proto.CompactTextString(m) } *x = ProtoCompleteTransaction_TxType{}
func (*ProtoCompleteTransaction_TxType) ProtoMessage() {} 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 (*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) { 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 { func (x *ProtoCompleteTransaction_TxType) GetAccountNonce() uint64 {
if m != nil { if x != nil {
return m.AccountNonce return x.AccountNonce
} }
return 0 return 0
} }
func (m *ProtoCompleteTransaction_TxType) GetGasPrice() []byte { func (x *ProtoCompleteTransaction_TxType) GetGasPrice() []byte {
if m != nil { if x != nil {
return m.GasPrice return x.GasPrice
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 { func (x *ProtoCompleteTransaction_TxType) GetGasLimit() uint64 {
if m != nil { if x != nil {
return m.GasLimit return x.GasLimit
} }
return 0 return 0
} }
func (m *ProtoCompleteTransaction_TxType) GetValue() []byte { func (x *ProtoCompleteTransaction_TxType) GetValue() []byte {
if m != nil { if x != nil {
return m.Value return x.Value
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetPayload() []byte { func (x *ProtoCompleteTransaction_TxType) GetPayload() []byte {
if m != nil { if x != nil {
return m.Payload return x.Payload
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetHash() []byte { func (x *ProtoCompleteTransaction_TxType) GetHash() []byte {
if m != nil { if x != nil {
return m.Hash return x.Hash
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetTo() []byte { func (x *ProtoCompleteTransaction_TxType) GetTo() []byte {
if m != nil { if x != nil {
return m.To return x.To
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetFrom() []byte { func (x *ProtoCompleteTransaction_TxType) GetFrom() []byte {
if m != nil { if x != nil {
return m.From return x.From
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 { func (x *ProtoCompleteTransaction_TxType) GetTransactionIndex() uint32 {
if m != nil { if x != nil {
return m.TransactionIndex return x.TransactionIndex
} }
return 0 return 0
} }
type ProtoCompleteTransaction_ReceiptType struct { type ProtoCompleteTransaction_ReceiptType struct {
GasUsed []byte `protobuf:"bytes,1,opt,name=GasUsed,proto3" json:"GasUsed,omitempty"` state protoimpl.MessageState
Status []byte `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"` sizeCache protoimpl.SizeCache
Log []*ProtoCompleteTransaction_ReceiptType_LogType `protobuf:"bytes,3,rep,name=Log" json:"Log,omitempty"` 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,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 (m *ProtoCompleteTransaction_ReceiptType) Reset() { *m = ProtoCompleteTransaction_ReceiptType{} } func (x *ProtoCompleteTransaction_ReceiptType) Reset() {
func (m *ProtoCompleteTransaction_ReceiptType) String() string { return proto.CompactTextString(m) } *x = ProtoCompleteTransaction_ReceiptType{}
func (*ProtoCompleteTransaction_ReceiptType) ProtoMessage() {} 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 (*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) { 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 { func (x *ProtoCompleteTransaction_ReceiptType) GetGasUsed() []byte {
if m != nil { if x != nil {
return m.GasUsed return x.GasUsed
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte { func (x *ProtoCompleteTransaction_ReceiptType) GetStatus() []byte {
if m != nil { if x != nil {
return m.Status return x.Status
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType { func (x *ProtoCompleteTransaction_ReceiptType) GetLog() []*ProtoCompleteTransaction_ReceiptType_LogType {
if m != nil { if x != nil {
return m.Log 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 return nil
} }
type ProtoCompleteTransaction_ReceiptType_LogType struct { 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"` Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,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"` Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"Topics,omitempty"`
} }
func (m *ProtoCompleteTransaction_ReceiptType_LogType) Reset() { func (x *ProtoCompleteTransaction_ReceiptType_LogType) Reset() {
*m = ProtoCompleteTransaction_ReceiptType_LogType{} *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 (*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) { 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 { func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetAddress() []byte {
if m != nil { if x != nil {
return m.Address return x.Address
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte { func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetData() []byte {
if m != nil { if x != nil {
return m.Data return x.Data
} }
return nil return nil
} }
func (m *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte { func (x *ProtoCompleteTransaction_ReceiptType_LogType) GetTopics() [][]byte {
if m != nil { if x != nil {
return m.Topics return x.Topics
} }
return nil return nil
} }
func init() { var File_bchain_coins_eth_ethtx_proto protoreflect.FileDescriptor
proto.RegisterType((*ProtoCompleteTransaction)(nil), "eth.ProtoCompleteTransaction")
proto.RegisterType((*ProtoCompleteTransaction_TxType)(nil), "eth.ProtoCompleteTransaction.TxType") var file_bchain_coins_eth_ethtx_proto_rawDesc = []byte{
proto.RegisterType((*ProtoCompleteTransaction_ReceiptType)(nil), "eth.ProtoCompleteTransaction.ReceiptType") 0x0a, 0x1c, 0x62, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x2f, 0x65,
proto.RegisterType((*ProtoCompleteTransaction_ReceiptType_LogType)(nil), "eth.ProtoCompleteTransaction.ReceiptType.LogType") 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{ func file_bchain_coins_eth_ethtx_proto_rawDescGZIP() []byte {
// 409 bytes of a gzipped FileDescriptorProto file_bchain_coins_eth_ethtx_proto_rawDescOnce.Do(func() {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xdf, 0x8a, 0xd4, 0x30, file_bchain_coins_eth_ethtx_proto_rawDescData = protoimpl.X.CompressGZIP(file_bchain_coins_eth_ethtx_proto_rawDescData)
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, return file_bchain_coins_eth_ethtx_proto_rawDescData
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, var file_bchain_coins_eth_ethtx_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
0x86, 0x24, 0xca, 0x55, 0xe7, 0xdf, 0x67, 0x40, 0x77, 0x1e, 0x37, 0xa6, 0x6e, 0x0f, 0xca, 0x29, var file_bchain_coins_eth_ethtx_proto_goTypes = []interface{}{
0xde, 0x89, 0xc6, 0x0a, 0xe9, 0xb4, 0x69, 0x48, 0x0e, 0xcb, 0xb7, 0x07, 0x23, 0xbf, 0xdd, 0xf4, (*ProtoCompleteTransaction)(nil), // 0: ProtoCompleteTransaction
0xf5, 0x5e, 0x75, 0x34, 0xca, 0xa3, 0xf5, 0x23, 0x76, 0x2c, 0x91, 0x33, 0x38, 0x45, 0xe4, 0xba, (*ProtoCompleteTransaction_TxType)(nil), // 1: ProtoCompleteTransaction.TxType
0x56, 0x34, 0xce, 0xa3, 0x75, 0xca, 0x7e, 0x0b, 0xe4, 0x0d, 0xc4, 0x7c, 0xa0, 0x49, 0x1e, 0xad, (*ProtoCompleteTransaction_ReceiptType)(nil), // 2: ProtoCompleteTransaction.ReceiptType
0x97, 0x97, 0xcf, 0x0b, 0xe5, 0xaa, 0xe2, 0x5f, 0x5b, 0x15, 0x7c, 0xe0, 0x77, 0xad, 0x62, 0x31, (*ProtoCompleteTransaction_ReceiptType_LogType)(nil), // 3: ProtoCompleteTransaction.ReceiptType.LogType
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, var file_bchain_coins_eth_ethtx_proto_depIdxs = []int32{
0x8d, 0xbb, 0x31, 0x8d, 0x54, 0x58, 0x23, 0x65, 0x7f, 0x68, 0x64, 0x05, 0x27, 0xd7, 0xc2, 0xee, 1, // 0: ProtoCompleteTransaction.Tx:type_name -> ProtoCompleteTransaction.TxType
0x3a, 0x2d, 0xc7, 0x1a, 0x19, 0xbb, 0xe7, 0xf0, 0x6e, 0xab, 0x6b, 0xed, 0xb0, 0x4b, 0xca, 0xee, 2, // 1: ProtoCompleteTransaction.Receipt:type_name -> ProtoCompleteTransaction.ReceiptType
0x99, 0x3c, 0x85, 0xd9, 0x57, 0x71, 0xe8, 0x15, 0x26, 0xcd, 0xd8, 0x08, 0x84, 0xc2, 0x62, 0x27, 3, // 2: ProtoCompleteTransaction.ReceiptType.Log:type_name -> ProtoCompleteTransaction.ReceiptType.LogType
0xee, 0x0e, 0x46, 0x94, 0x74, 0x86, 0xfa, 0x84, 0x84, 0x40, 0xfa, 0x41, 0xd8, 0x8a, 0xce, 0x51, 3, // [3:3] is the sub-list for method output_type
0xc6, 0x35, 0x79, 0x0c, 0x31, 0x37, 0x74, 0x81, 0x4a, 0xcc, 0x8d, 0x9f, 0x79, 0xdf, 0x99, 0x9a, 3, // [3:3] is the sub-list for method input_type
0x9e, 0x8c, 0x33, 0x7e, 0x4d, 0x5e, 0xc2, 0x93, 0xa3, 0xca, 0x1f, 0x9b, 0x52, 0x0d, 0xf4, 0x14, 3, // [3:3] is the sub-list for extension type_name
0xaf, 0xe3, 0x2f, 0x7d, 0xf5, 0x23, 0x82, 0xe5, 0xd1, 0x99, 0xf8, 0x34, 0xd7, 0xc2, 0x7e, 0xb1, 3, // [3:3] is the sub-list for extension extendee
0xaa, 0xc4, 0xea, 0x19, 0x9b, 0x90, 0x3c, 0x83, 0xf9, 0x67, 0x27, 0x5c, 0x6f, 0x43, 0xe7, 0x40, 0, // [0:3] is the sub-list for field type_name
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, func init() { file_bchain_coins_eth_ethtx_proto_init() }
0x96, 0x16, 0x03, 0x64, 0x2c, 0xd0, 0x7e, 0x8e, 0xbf, 0xed, 0xeb, 0x5f, 0x01, 0x00, 0x00, 0xff, func file_bchain_coins_eth_ethtx_proto_init() {
0xff, 0xc2, 0x69, 0x8d, 0xdf, 0xd6, 0x02, 0x00, 0x00, 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
} }

View File

@ -1,30 +1,34 @@
syntax = "proto3"; syntax = "proto3";
package eth; option go_package = "bchain/coins/eth";
message ProtoCompleteTransaction { message ProtoCompleteTransaction {
message TxType { message TxType {
uint64 AccountNonce = 1; uint64 AccountNonce = 1;
bytes GasPrice = 2; bytes GasPrice = 2;
uint64 GasLimit = 3; uint64 GasLimit = 3;
bytes Value = 4; bytes Value = 4;
bytes Payload = 5; bytes Payload = 5;
bytes Hash = 6; bytes Hash = 6;
bytes To = 7; bytes To = 7;
bytes From = 8; bytes From = 8;
uint32 TransactionIndex = 9; uint32 TransactionIndex = 9;
} }
message ReceiptType { message ReceiptType {
message LogType { message LogType {
bytes Address = 1; bytes Address = 1;
bytes Data = 2; bytes Data = 2;
repeated bytes Topics = 3; repeated bytes Topics = 3;
} }
bytes GasUsed = 1; bytes GasUsed = 1;
bytes Status = 2; bytes Status = 2;
repeated LogType Log = 3; repeated LogType Log = 3;
} optional bytes L1Fee = 4;
uint32 BlockNumber = 1; optional bytes L1FeeScalar = 5;
uint64 BlockTime = 2; optional bytes L1GasPrice = 6;
TxType Tx = 3; optional bytes L1GasUsed = 7;
ReceiptType Receipt = 4; }
} uint32 BlockNumber = 1;
uint64 BlockTime = 2;
TxType Tx = 3;
ReceiptType Receipt = 4;
}

View 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
}

View 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 := &eth.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
}

View File

@ -122,9 +122,13 @@ type RpcLog struct {
// RpcLog is returned by eth_getTransactionReceipt // RpcLog is returned by eth_getTransactionReceipt
type RpcReceipt struct { type RpcReceipt struct {
GasUsed string `json:"gasUsed"` GasUsed string `json:"gasUsed"`
Status string `json:"status"` Status string `json:"status"`
Logs []*RpcLog `json:"logs"` 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 // EthereumSpecificData contains data specific to Ethereum transactions

View File

@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \ RUN apt-get update && \
apt-get upgrade -y && \ 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 apt-get clean
ADD gpg-keys /tmp/gpg-keys ADD gpg-keys /tmp/gpg-keys

View 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}}

View 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}}

View File

@ -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}}

View 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"
}
}

View 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"
}
}

View 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"
}
}

View 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"
}
}

View 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"
}
}

View File

@ -1,82 +1,84 @@
# Registry of ports # Registry of ports
| coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) | | coin | blockbook public | blockbook internal | backend rpc | backend service ports (zmq) |
|----------------------------------|------------------|--------------------|-------------|--------------------------------------| |----------------------------------|------------------|--------------------|-------------|-----------------------------------------------------|
| Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc | | Ethereum Archive | 9116 | 9016 | 8016 | 38316 p2p, 8116 http, 8516 authrpc |
| Bitcoin | 9130 | 9030 | 8030 | 38330 | | Bitcoin | 9130 | 9030 | 8030 | 38330 |
| Bitcoin Cash | 9131 | 9031 | 8031 | 38331 | | Bitcoin Cash | 9131 | 9031 | 8031 | 38331 |
| Zcash | 9132 | 9032 | 8032 | 38332 | | Zcash | 9132 | 9032 | 8032 | 38332 |
| Dash | 9133 | 9033 | 8033 | 38333 | | Dash | 9133 | 9033 | 8033 | 38333 |
| Litecoin | 9134 | 9034 | 8034 | 38334 | | Litecoin | 9134 | 9034 | 8034 | 38334 |
| Bitcoin Gold | 9135 | 9035 | 8035 | 38335 | | Bitcoin Gold | 9135 | 9035 | 8035 | 38335 |
| Ethereum | 9136 | 9036 | 8036 | 38336 p2p, 8136 http, 8536 authrpc | | Ethereum | 9136 | 9036 | 8036 | 38336 p2p, 8136 http, 8536 authrpc |
| Ethereum Classic | 9137 | 9037 | 8037 | 38337 p2p, 8137 http | | Ethereum Classic | 9137 | 9037 | 8037 | 38337 p2p, 8137 http |
| Dogecoin | 9138 | 9038 | 8038 | 38338 | | Dogecoin | 9138 | 9038 | 8038 | 38338 |
| Namecoin | 9139 | 9039 | 8039 | 38339 | | Namecoin | 9139 | 9039 | 8039 | 38339 |
| Vertcoin | 9140 | 9040 | 8040 | 38340 | | Vertcoin | 9140 | 9040 | 8040 | 38340 |
| Monacoin | 9141 | 9041 | 8041 | 38341 | | Monacoin | 9141 | 9041 | 8041 | 38341 |
| DigiByte | 9142 | 9042 | 8042 | 38342 | | DigiByte | 9142 | 9042 | 8042 | 38342 |
| Myriad | 9143 | 9043 | 8043 | 38343 | | Myriad | 9143 | 9043 | 8043 | 38343 |
| GameCredits | 9144 | 9044 | 8044 | 38344 | | GameCredits | 9144 | 9044 | 8044 | 38344 |
| Groestlcoin | 9145 | 9045 | 8045 | 38345 | | Groestlcoin | 9145 | 9045 | 8045 | 38345 |
| Bitcoin Cash SV | 9146 | 9046 | 8046 | 38346 | | Bitcoin Cash SV | 9146 | 9046 | 8046 | 38346 |
| Liquid | 9147 | 9047 | 8047 | 38347 | | Liquid | 9147 | 9047 | 8047 | 38347 |
| Fujicoin | 9148 | 9048 | 8048 | 38348 | | Fujicoin | 9148 | 9048 | 8048 | 38348 |
| PIVX | 9149 | 9049 | 8049 | 38349 | | PIVX | 9149 | 9049 | 8049 | 38349 |
| Firo | 9150 | 9050 | 8050 | 38350 | | Firo | 9150 | 9050 | 8050 | 38350 |
| Koto | 9151 | 9051 | 8051 | 38351 | | Koto | 9151 | 9051 | 8051 | 38351 |
| Bellcoin | 9152 | 9052 | 8052 | 38352 | | Bellcoin | 9152 | 9052 | 8052 | 38352 |
| NULS | 9153 | 9053 | 8053 | 38353 | | NULS | 9153 | 9053 | 8053 | 38353 |
| Bitcore | 9154 | 9054 | 8054 | 38354 | | Bitcore | 9154 | 9054 | 8054 | 38354 |
| Viacoin | 9155 | 9055 | 8055 | 38355 | | Viacoin | 9155 | 9055 | 8055 | 38355 |
| VIPSTARCOIN | 9156 | 9056 | 8056 | 38356 | | VIPSTARCOIN | 9156 | 9056 | 8056 | 38356 |
| MonetaryUnit | 9157 | 9057 | 8057 | 38357 | | MonetaryUnit | 9157 | 9057 | 8057 | 38357 |
| Flux | 9158 | 9058 | 8058 | 38358 | | Flux | 9158 | 9058 | 8058 | 38358 |
| Ravencoin | 9159 | 9059 | 8059 | 38359 | | Ravencoin | 9159 | 9059 | 8059 | 38359 |
| Ritocoin | 9160 | 9060 | 8060 | 38360 | | Ritocoin | 9160 | 9060 | 8060 | 38360 |
| Decred | 9161 | 9061 | 8061 | 38361 | | Decred | 9161 | 9061 | 8061 | 38361 |
| SnowGem | 9162 | 9062 | 8062 | 38362 | | SnowGem | 9162 | 9062 | 8062 | 38362 |
| BNB Smart Chain | 9164 | 9064 | 8064 | 38364 p2p, 8164 http | | BNB Smart Chain | 9164 | 9064 | 8064 | 38364 p2p, 8164 http |
| BNB Smart Chain Archive | 9165 | 9065 | 8065 | 38365 p2p, 8165 http | | BNB Smart Chain Archive | 9165 | 9065 | 8065 | 38365 p2p, 8165 http |
| Flo | 9166 | 9066 | 8066 | 38366 | | Flo | 9166 | 9066 | 8066 | 38366 |
| Polis | 9167 | 9067 | 8067 | 38367 | | Polis | 9167 | 9067 | 8067 | 38367 |
| Polygon | 9170 | 9070 | 8070 | 38370 p2p, 8170 http | | Polygon | 9170 | 9070 | 8070 | 38370 p2p, 8170 http |
| Polygon Archive | 9172 | 9072 | 8072 | 38372 p2p, 8172 http | | Polygon Archive | 9172 | 9072 | 8072 | 38372 p2p, 8172 http |
| Qtum | 9188 | 9088 | 8088 | 38388 | | Qtum | 9188 | 9088 | 8088 | 38388 |
| Divi Project | 9189 | 9089 | 8089 | 38389 | | Divi Project | 9189 | 9089 | 8089 | 38389 |
| CPUchain | 9190 | 9090 | 8090 | 38390 | | CPUchain | 9190 | 9090 | 8090 | 38390 |
| DeepOnion | 9191 | 9091 | 8091 | 38391 | | DeepOnion | 9191 | 9091 | 8091 | 38391 |
| Unobtanium | 9192 | 9092 | 65535 | 38392 | | Unobtanium | 9192 | 9092 | 65535 | 38392 |
| Omotenashicoin | 9194 | 9094 | 8094 | 38394 | | Omotenashicoin | 9194 | 9094 | 8094 | 38394 |
| BitZeny | 9195 | 9095 | 8095 | 38395 | | BitZeny | 9195 | 9095 | 8095 | 38395 |
| Trezarcoin | 9196 | 9096 | 8096 | 38396 | | Trezarcoin | 9196 | 9096 | 8096 | 38396 |
| eCash | 9197 | 9097 | 8097 | 38397 | | eCash | 9197 | 9097 | 8097 | 38397 |
| Avalanche | 9198 | 9098 | 8098 | 38398 p2p | | Avalanche | 9198 | 9098 | 8098 | 38398 p2p |
| Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p | | Avalanche Archive | 9199 | 9099 | 8099 | 38399 p2p |
| Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p | | Optimism | 9300 | 9200 | 8200 | 38400 p2p, 8300 http, 8400 authrpc |
| Bitcoin Signet | 19120 | 19020 | 18020 | 48320 | | Optimism Archive | 9302 | 9202 | 8202 | 38402 p2p, 8302 http, 8402 authrpc |
| Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 | | Ethereum Testnet Holesky | 19116 | 19016 | 18016 | 18116 http, 18516 authrpc, 48316 p2p |
| Bitcoin Testnet | 19130 | 19030 | 18030 | 48330 | | Bitcoin Signet | 19120 | 19020 | 18020 | 48320 |
| Bitcoin Cash Testnet | 19131 | 19031 | 18031 | 48331 | | Bitcoin Regtest | 19121 | 19021 | 18021 | 48321 |
| Zcash Testnet | 19132 | 19032 | 18032 | 48332 | | Bitcoin Testnet | 19130 | 19030 | 18030 | 48330 |
| Dash Testnet | 19133 | 19033 | 18033 | 48333 | | Bitcoin Cash Testnet | 19131 | 19031 | 18031 | 48331 |
| Litecoin Testnet | 19134 | 19034 | 18034 | 48334 | | Zcash Testnet | 19132 | 19032 | 18032 | 48332 |
| Bitcoin Gold Testnet | 19135 | 19035 | 18035 | 48335 | | Dash Testnet | 19133 | 19033 | 18033 | 48333 |
| Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18536 authrpc, 48336 p2p | | Litecoin Testnet | 19134 | 19034 | 18034 | 48334 |
| Dogecoin Testnet | 19138 | 19038 | 18038 | 48338 | | Bitcoin Gold Testnet | 19135 | 19035 | 18035 | 48335 |
| Vertcoin Testnet | 19140 | 19040 | 18040 | 48340 | | Ethereum Testnet Holesky Archive | 19136 | 19036 | 18036 | 18136 http, 18136 torrent, 18536 authrpc, 48336 p2p |
| Monacoin Testnet | 19141 | 19041 | 18041 | 48341 | | Dogecoin Testnet | 19138 | 19038 | 18038 | 48338 |
| DigiByte Testnet | 19142 | 19042 | 18042 | 48342 | | Vertcoin Testnet | 19140 | 19040 | 18040 | 48340 |
| Groestlcoin Testnet | 19145 | 19045 | 18045 | 48345 | | Monacoin Testnet | 19141 | 19041 | 18041 | 48341 |
| Groestlcoin Regtest | 19146 | 19046 | 18046 | 48346 | | DigiByte Testnet | 19142 | 19042 | 18042 | 48342 |
| Groestlcoin Signet | 19147 | 19047 | 18047 | 48347 | | Groestlcoin Testnet | 19145 | 19045 | 18045 | 48345 |
| PIVX Testnet | 19149 | 19049 | 18049 | 48349 | | Groestlcoin Regtest | 19146 | 19046 | 18046 | 48346 |
| Koto Testnet | 19151 | 19051 | 18051 | 48351 | | Groestlcoin Signet | 19147 | 19047 | 18047 | 48347 |
| Decred Testnet | 19161 | 19061 | 18061 | 48361 | | PIVX Testnet | 19149 | 19049 | 18049 | 48349 |
| Flo Testnet | 19166 | 19066 | 18066 | 48366 | | Koto Testnet | 19151 | 19051 | 18051 | 48351 |
| Ethereum Testnet Sepolia | 19176 | 19076 | 18076 | 18176 http, 18576 authrpc, 48376 p2p | | Decred Testnet | 19161 | 19061 | 18061 | 48361 |
| Ethereum Testnet Sepolia Archive | 19186 | 19086 | 18086 | 18186 http, 18586 authrpc, 48386 p2p | | Flo Testnet | 19166 | 19066 | 18066 | 48366 |
| Qtum Testnet | 19188 | 19088 | 18088 | 48388 | | Ethereum Testnet Sepolia | 19176 | 19076 | 18076 | 18176 http, 18576 authrpc, 48376 p2p |
| Omotenashicoin Testnet | 19189 | 19089 | 18089 | 48389 | | 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 |
> NOTE: This document is generated from coin definitions in `configs/coins` using command `go run contrib/scripts/check-and-generate-port-registry.go -w`. > NOTE: This document is generated from coin definitions in `configs/coins` using command `go run contrib/scripts/check-and-generate-port-registry.go -w`.

View File

@ -51,6 +51,24 @@
<td>Gas Price</td> <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> <td>{{amountSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} <span class="fw-normal ps-3">({{amountSatsSpan $tx.EthereumSpecific.GasPrice $data "copyable"}} Gwei)</span></td>
</tr> </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}} {{else}}
<tr> <tr>
<td>Total Input</td> <td>Total Input</td>