From 0fe32e45028d11cf11e8288955d4413e3ecb02ff Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 11 Nov 2024 21:25:18 +0200 Subject: [PATCH 1/5] Add game7 client. --- blockchain/game7/game7.go | 1247 +++++++++++++++++ .../game7/game7_testnet_index_types.pb.go | 954 +++++++++++++ .../game7/game7_testnet_index_types.proto | 83 ++ blockchain/handlers.go | 4 + blockchain/settings.go | 7 + crawler/settings.go | 7 + prepare_blockchains.sh | 2 + sample.env | 1 + 8 files changed, 2305 insertions(+) create mode 100644 blockchain/game7/game7.go create mode 100644 blockchain/game7/game7_testnet_index_types.pb.go create mode 100644 blockchain/game7/game7_testnet_index_types.proto diff --git a/blockchain/game7/game7.go b/blockchain/game7/game7.go new file mode 100644 index 0000000..394512c --- /dev/null +++ b/blockchain/game7/game7.go @@ -0,0 +1,1247 @@ +package game7 + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/hex" + "encoding/json" + "fmt" + "log" + "math/big" + "strconv" + "strings" + "sync" + "time" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" + "google.golang.org/protobuf/proto" + + seer_common "github.com/G7DAO/seer/blockchain/common" + "github.com/G7DAO/seer/indexer" + "github.com/G7DAO/seer/version" +) + +func NewClient(url string, timeout int) (*Client, error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second) + defer cancel() + + rpcClient, err := rpc.DialContext(ctx, url) + if err != nil { + return nil, err + } + return &Client{rpcClient: rpcClient, timeout: time.Duration(timeout) * time.Second}, nil +} + +// Client is a wrapper around the Ethereum JSON-RPC client. + +type Client struct { + rpcClient *rpc.Client + timeout time.Duration +} + +// Client common + +// ChainType returns the chain type. +func (c *Client) ChainType() string { + return "game7" +} + +// Close closes the underlying RPC client. +func (c *Client) Close() { + c.rpcClient.Close() +} + +// GetLatestBlockNumber returns the latest block number. +func (c *Client) GetLatestBlockNumber() (*big.Int, error) { + var result string + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + if err := c.rpcClient.CallContext(ctxWithTimeout, &result, "eth_blockNumber"); err != nil { + return nil, err + } + + // Convert the hex string to a big.Int + blockNumber, ok := new(big.Int).SetString(result, 0) // The 0 base lets the function infer the base from the string prefix. + if !ok { + return nil, fmt.Errorf("invalid block number format: %s", result) + } + + return blockNumber, nil +} + +// GetBlockByNumber returns the block with the given number. +func (c *Client) GetBlockByNumber(ctx context.Context, number *big.Int, withTransactions bool) (*seer_common.BlockJson, error) { + var block *seer_common.BlockJson + err := c.rpcClient.CallContext(ctx, &block, "eth_getBlockByNumber", fmt.Sprintf("0x%x", number), withTransactions) + if err != nil { + fmt.Println("Error calling eth_getBlockByNumber:", err) + return nil, err + } + + return block, nil +} + +// BlockByHash returns the block with the given hash. +func (c *Client) BlockByHash(ctx context.Context, hash common.Hash) (*seer_common.BlockJson, error) { + var block *seer_common.BlockJson + err := c.rpcClient.CallContext(ctx, &block, "eth_getBlockByHash", hash, true) // true to include transactions + return block, err +} + +// TransactionReceipt returns the receipt of a transaction by transaction hash. +func (c *Client) TransactionReceipt(ctx context.Context, hash common.Hash) (*types.Receipt, error) { + var receipt *types.Receipt + err := c.rpcClient.CallContext(ctx, &receipt, "eth_getTransactionReceipt", hash) + return receipt, err +} + +// Get bytecode of a contract by address. +func (c *Client) GetCode(ctx context.Context, address common.Address, blockNumber uint64) ([]byte, error) { + var code hexutil.Bytes + if blockNumber == 0 { + latestBlockNumber, err := c.GetLatestBlockNumber() + if err != nil { + return nil, err + } + blockNumber = latestBlockNumber.Uint64() + } + err := c.rpcClient.CallContext(ctx, &code, "eth_getCode", address, "0x"+fmt.Sprintf("%x", blockNumber)) + if err != nil { + log.Printf("Failed to get code for address %s at block %d: %v", address.Hex(), blockNumber, err) + return nil, err + } + + if len(code) == 0 { + return nil, nil + } + return code, nil +} +func (c *Client) ClientFilterLogs(ctx context.Context, q ethereum.FilterQuery, debug bool) ([]*seer_common.EventJson, error) { + var logs []*seer_common.EventJson + fromBlock := q.FromBlock + toBlock := q.ToBlock + batchStep := new(big.Int).Sub(toBlock, fromBlock) // Calculate initial batch step + + for { + // Calculate the next "lastBlock" within the batch step or adjust to "toBlock" if exceeding + nextBlock := new(big.Int).Add(fromBlock, batchStep) + if nextBlock.Cmp(toBlock) > 0 { + nextBlock = new(big.Int).Set(toBlock) + } + + var result []*seer_common.EventJson + err := c.rpcClient.CallContext(ctx, &result, "eth_getLogs", struct { + FromBlock string `json:"fromBlock"` + ToBlock string `json:"toBlock"` + Addresses []common.Address `json:"addresses"` + Topics [][]common.Hash `json:"topics"` + }{ + FromBlock: toHex(fromBlock), + ToBlock: toHex(nextBlock), + Addresses: q.Addresses, + Topics: q.Topics, + }) + + if err != nil { + if strings.Contains(err.Error(), "query returned more than 10000 results") { + // Halve the batch step if too many results and retry + batchStep.Div(batchStep, big.NewInt(2)) + if batchStep.Cmp(big.NewInt(1)) < 0 { + // If the batch step is too small we will skip that block + fromBlock = new(big.Int).Add(nextBlock, big.NewInt(1)) + if fromBlock.Cmp(toBlock) > 0 { + break + } + continue + } + continue + } else { + // For any other error, return immediately + return nil, err + } + } + + // Append the results and adjust "fromBlock" for the next batch + logs = append(logs, result...) + fromBlock = new(big.Int).Add(nextBlock, big.NewInt(1)) + + if debug { + log.Printf("Fetched logs: %d", len(result)) + } + + // Break the loop if we've reached or exceeded "toBlock" + if fromBlock.Cmp(toBlock) > 0 { + break + } + } + + return logs, nil +} + +// Utility function to convert big.Int to its hexadecimal representation. +func toHex(number *big.Int) string { + return fmt.Sprintf("0x%x", number) +} + +func fromHex(hex string) *big.Int { + number := new(big.Int) + number.SetString(hex, 0) + return number +} + +// FetchBlocksInRange fetches blocks within a specified range. +// This could be useful for batch processing or analysis. +func (c *Client) FetchBlocksInRange(from, to *big.Int, debug bool) ([]*seer_common.BlockJson, error) { + var blocks []*seer_common.BlockJson + ctx := context.Background() // For simplicity, using a background context; consider timeouts for production. + + for i := new(big.Int).Set(from); i.Cmp(to) <= 0; i.Add(i, big.NewInt(1)) { + + ctxWithTimeout, cancel := context.WithTimeout(ctx, c.timeout) + defer cancel() + + block, err := c.GetBlockByNumber(ctxWithTimeout, i, true) + if err != nil { + return nil, err + } + + blocks = append(blocks, block) + if debug { + log.Printf("Fetched block number: %d", i) + } + } + + return blocks, nil +} + +// FetchBlocksInRangeAsync fetches blocks within a specified range concurrently. +func (c *Client) FetchBlocksInRangeAsync(from, to *big.Int, debug bool, maxRequests int) ([]*seer_common.BlockJson, error) { + var ( + blocks []*seer_common.BlockJson + + mu sync.Mutex + wg sync.WaitGroup + ctx = context.Background() + ) + + var blockNumbersRange []*big.Int + for i := new(big.Int).Set(from); i.Cmp(to) <= 0; i.Add(i, big.NewInt(1)) { + blockNumbersRange = append(blockNumbersRange, new(big.Int).Set(i)) + } + + sem := make(chan struct{}, maxRequests) // Semaphore to control concurrency + errChan := make(chan error, 1) + + for _, b := range blockNumbersRange { + wg.Add(1) + go func(b *big.Int) { + defer wg.Done() + + sem <- struct{}{} // Acquire semaphore + + ctxWithTimeout, cancel := context.WithTimeout(ctx, c.timeout) + + defer cancel() + + block, getErr := c.GetBlockByNumber(ctxWithTimeout, b, true) + if getErr != nil { + log.Printf("Failed to fetch block number: %d, error: %v", b, getErr) + errChan <- getErr + return + } + + mu.Lock() + blocks = append(blocks, block) + mu.Unlock() + + if debug { + log.Printf("Fetched block number: %d", b) + } + + <-sem + }(b) + } + + wg.Wait() + close(sem) + close(errChan) + + if err := <-errChan; err != nil { + return nil, err + } + + return blocks, nil +} + +// ParseBlocksWithTransactions parses blocks and their transactions into custom data structure. +// This method showcases how to handle and transform detailed block and transaction data. +func (c *Client) ParseBlocksWithTransactions(from, to *big.Int, debug bool, maxRequests int) ([]*Game7Block, error) { + var blocksWithTxsJson []*seer_common.BlockJson + var fetchErr error + if maxRequests > 1 { + blocksWithTxsJson, fetchErr = c.FetchBlocksInRangeAsync(from, to, debug, maxRequests) + } else { + blocksWithTxsJson, fetchErr = c.FetchBlocksInRange(from, to, debug) + } + if fetchErr != nil { + return nil, fetchErr + } + + var parsedBlocks []*Game7Block + for _, blockAndTxsJson := range blocksWithTxsJson { + // Convert BlockJson to Block and Transactions as required. + parsedBlock := ToProtoSingleBlock(blockAndTxsJson) + + for _, txJson := range blockAndTxsJson.Transactions { + txJson.BlockTimestamp = blockAndTxsJson.Timestamp + + parsedTransaction := ToProtoSingleTransaction(&txJson) + parsedBlock.Transactions = append(parsedBlock.Transactions, parsedTransaction) + } + + parsedBlocks = append(parsedBlocks, parsedBlock) + } + + return parsedBlocks, nil +} + +func (c *Client) ParseEvents(from, to *big.Int, blocksCache map[uint64]indexer.BlockCache, debug bool) ([]*Game7EventLog, error) { + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + logs, err := c.ClientFilterLogs(ctxWithTimeout, ethereum.FilterQuery{ + FromBlock: from, + ToBlock: to, + }, debug) + + if err != nil { + fmt.Println("Error fetching logs: ", err) + return nil, err + } + + var parsedEvents []*Game7EventLog + + for _, log := range logs { + parsedEvent := ToProtoSingleEventLog(log) + parsedEvents = append(parsedEvents, parsedEvent) + + } + + return parsedEvents, nil +} + +func (c *Client) FetchAsProtoBlocksWithEvents(from, to *big.Int, debug bool, maxRequests int) ([]proto.Message, []indexer.BlockIndex, uint64, error) { + blocks, err := c.ParseBlocksWithTransactions(from, to, debug, maxRequests) + if err != nil { + return nil, nil, 0, err + } + + var blocksSize uint64 + + blocksCache := make(map[uint64]indexer.BlockCache) + + for _, block := range blocks { + blocksCache[block.BlockNumber] = indexer.BlockCache{ + BlockNumber: block.BlockNumber, + BlockHash: block.Hash, + BlockTimestamp: block.Timestamp, + } // Assuming block.BlockNumber is int64 and block.Hash is string + } + + events, err := c.ParseEvents(from, to, blocksCache, debug) + if err != nil { + return nil, nil, 0, err + } + + var blocksProto []proto.Message + var blocksIndex []indexer.BlockIndex + + for bI, block := range blocks { + for _, tx := range block.Transactions { + for _, event := range events { + if tx.Hash == event.TransactionHash { + tx.Logs = append(tx.Logs, event) + } + } + } + + // Prepare blocks to index + blocksIndex = append(blocksIndex, indexer.NewBlockIndex("game7", + block.BlockNumber, + block.Hash, + block.Timestamp, + block.ParentHash, + uint64(bI), + "", + block.L1BlockNumber, + )) + + blocksSize += uint64(proto.Size(block)) + blocksProto = append(blocksProto, block) // Assuming block is already a proto.Message + } + + return blocksProto, blocksIndex, blocksSize, nil +} + +func (c *Client) ProcessBlocksToBatch(msgs []proto.Message) (proto.Message, error) { + var blocks []*Game7Block + for _, msg := range msgs { + block, ok := msg.(*Game7Block) + if !ok { + return nil, fmt.Errorf("failed to type assert proto.Message to *Game7Block") + } + blocks = append(blocks, block) + } + + return &Game7BlocksBatch{ + Blocks: blocks, + SeerVersion: version.SeerVersion, + }, nil +} + +func ToEntireBlocksBatchFromLogProto(obj *Game7BlocksBatch) *seer_common.BlocksBatchJson { + blocksBatchJson := seer_common.BlocksBatchJson{ + Blocks: []seer_common.BlockJson{}, + SeerVersion: obj.SeerVersion, + } + + for _, b := range obj.Blocks { + var txs []seer_common.TransactionJson + for _, tx := range b.Transactions { + var accessList []seer_common.AccessList + for _, al := range tx.AccessList { + accessList = append(accessList, seer_common.AccessList{ + Address: al.Address, + StorageKeys: al.StorageKeys, + }) + } + var events []seer_common.EventJson + for _, e := range tx.Logs { + events = append(events, seer_common.EventJson{ + Address: e.Address, + Topics: e.Topics, + Data: e.Data, + BlockNumber: fmt.Sprintf("%d", e.BlockNumber), + TransactionHash: e.TransactionHash, + BlockHash: e.BlockHash, + Removed: e.Removed, + LogIndex: fmt.Sprintf("%d", e.LogIndex), + TransactionIndex: fmt.Sprintf("%d", e.TransactionIndex), + }) + } + txs = append(txs, seer_common.TransactionJson{ + BlockHash: tx.BlockHash, + BlockNumber: fmt.Sprintf("%d", tx.BlockNumber), + ChainId: tx.ChainId, + FromAddress: tx.FromAddress, + Gas: tx.Gas, + GasPrice: tx.GasPrice, + Hash: tx.Hash, + Input: tx.Input, + MaxFeePerGas: tx.MaxFeePerGas, + MaxPriorityFeePerGas: tx.MaxPriorityFeePerGas, + Nonce: tx.Nonce, + V: tx.V, + R: tx.R, + S: tx.S, + ToAddress: tx.ToAddress, + TransactionIndex: fmt.Sprintf("%d", tx.TransactionIndex), + TransactionType: fmt.Sprintf("%d", tx.TransactionType), + Value: tx.Value, + IndexedAt: fmt.Sprintf("%d", tx.IndexedAt), + BlockTimestamp: fmt.Sprintf("%d", tx.BlockTimestamp), + AccessList: accessList, + YParity: tx.YParity, + + Events: events, + }) + } + + blocksBatchJson.Blocks = append(blocksBatchJson.Blocks, seer_common.BlockJson{ + Difficulty: fmt.Sprintf("%d", b.Difficulty), + ExtraData: b.ExtraData, + GasLimit: fmt.Sprintf("%d", b.GasLimit), + GasUsed: fmt.Sprintf("%d", b.GasUsed), + Hash: b.Hash, + LogsBloom: b.LogsBloom, + Miner: b.Miner, + Nonce: b.Nonce, + BlockNumber: fmt.Sprintf("%d", b.BlockNumber), + ParentHash: b.ParentHash, + ReceiptsRoot: b.ReceiptsRoot, + Sha3Uncles: b.Sha3Uncles, + StateRoot: b.StateRoot, + Timestamp: fmt.Sprintf("%d", b.Timestamp), + TotalDifficulty: b.TotalDifficulty, + TransactionsRoot: b.TransactionsRoot, + Size: fmt.Sprintf("%d", b.Size), + BaseFeePerGas: b.BaseFeePerGas, + IndexedAt: fmt.Sprintf("%d", b.IndexedAt), + + MixHash: b.MixHash, + SendCount: b.SendCount, + SendRoot: b.SendRoot, + L1BlockNumber: fmt.Sprintf("%d", b.L1BlockNumber), + + Transactions: txs, + }) + } + + return &blocksBatchJson +} + +func ToProtoSingleBlock(obj *seer_common.BlockJson) *Game7Block { + return &Game7Block{ + BlockNumber: fromHex(obj.BlockNumber).Uint64(), + Difficulty: fromHex(obj.Difficulty).Uint64(), + ExtraData: obj.ExtraData, + GasLimit: fromHex(obj.GasLimit).Uint64(), + GasUsed: fromHex(obj.GasUsed).Uint64(), + BaseFeePerGas: obj.BaseFeePerGas, + Hash: obj.Hash, + LogsBloom: obj.LogsBloom, + Miner: obj.Miner, + Nonce: obj.Nonce, + ParentHash: obj.ParentHash, + ReceiptsRoot: obj.ReceiptsRoot, + Sha3Uncles: obj.Sha3Uncles, + Size: fromHex(obj.Size).Uint64(), + StateRoot: obj.StateRoot, + Timestamp: fromHex(obj.Timestamp).Uint64(), + TotalDifficulty: obj.TotalDifficulty, + TransactionsRoot: obj.TransactionsRoot, + IndexedAt: fromHex(obj.IndexedAt).Uint64(), + + MixHash: obj.MixHash, + SendCount: obj.SendCount, + SendRoot: obj.SendRoot, + L1BlockNumber: fromHex(obj.L1BlockNumber).Uint64(), + } +} + +func ToProtoSingleTransaction(obj *seer_common.TransactionJson) *Game7Transaction { + var accessList []*Game7TransactionAccessList + for _, al := range obj.AccessList { + accessList = append(accessList, &Game7TransactionAccessList{ + Address: al.Address, + StorageKeys: al.StorageKeys, + }) + } + + return &Game7Transaction{ + Hash: obj.Hash, + BlockNumber: fromHex(obj.BlockNumber).Uint64(), + BlockHash: obj.BlockHash, + FromAddress: obj.FromAddress, + ToAddress: obj.ToAddress, + Gas: obj.Gas, + GasPrice: obj.GasPrice, + MaxFeePerGas: obj.MaxFeePerGas, + MaxPriorityFeePerGas: obj.MaxPriorityFeePerGas, + Input: obj.Input, + Nonce: obj.Nonce, + TransactionIndex: fromHex(obj.TransactionIndex).Uint64(), + TransactionType: fromHex(obj.TransactionType).Uint64(), + Value: obj.Value, + IndexedAt: fromHex(obj.IndexedAt).Uint64(), + BlockTimestamp: fromHex(obj.BlockTimestamp).Uint64(), + + ChainId: obj.ChainId, + V: obj.V, + R: obj.R, + S: obj.S, + + AccessList: accessList, + YParity: obj.YParity, + } +} + +func ToEvenFromLogProto(obj *Game7EventLog) *seer_common.EventJson { + return &seer_common.EventJson{ + Address: obj.Address, + Topics: obj.Topics, + Data: obj.Data, + BlockNumber: fmt.Sprintf("%d", obj.BlockNumber), + TransactionHash: obj.TransactionHash, + LogIndex: fmt.Sprintf("%d", obj.LogIndex), + BlockHash: obj.BlockHash, + Removed: obj.Removed, + } +} + +func ToProtoSingleEventLog(obj *seer_common.EventJson) *Game7EventLog { + return &Game7EventLog{ + Address: obj.Address, + Topics: obj.Topics, + Data: obj.Data, + BlockNumber: fromHex(obj.BlockNumber).Uint64(), + TransactionHash: obj.TransactionHash, + LogIndex: fromHex(obj.LogIndex).Uint64(), + BlockHash: obj.BlockHash, + Removed: obj.Removed, + } +} + +func (c *Client) DecodeProtoEventLogs(data []string) ([]*Game7EventLog, error) { + var events []*Game7EventLog + for _, d := range data { + var event Game7EventLog + base64Decoded, err := base64.StdEncoding.DecodeString(d) + if err != nil { + return nil, err + } + if err := proto.Unmarshal(base64Decoded, &event); err != nil { + return nil, err + } + events = append(events, &event) + } + return events, nil +} + +func (c *Client) DecodeProtoTransactions(data []string) ([]*Game7Transaction, error) { + var transactions []*Game7Transaction + for _, d := range data { + var transaction Game7Transaction + base64Decoded, err := base64.StdEncoding.DecodeString(d) + if err != nil { + return nil, err + } + if err := proto.Unmarshal(base64Decoded, &transaction); err != nil { + return nil, err + } + transactions = append(transactions, &transaction) + } + return transactions, nil +} + +func (c *Client) DecodeProtoBlocks(data []string) ([]*Game7Block, error) { + var blocks []*Game7Block + for _, d := range data { + var block Game7Block + base64Decoded, err := base64.StdEncoding.DecodeString(d) + if err != nil { + return nil, err + } + if err := proto.Unmarshal(base64Decoded, &block); err != nil { + return nil, err + } + blocks = append(blocks, &block) + } + return blocks, nil +} + +func (c *Client) DecodeProtoEntireBlockToJson(rawData *bytes.Buffer) (*seer_common.BlocksBatchJson, error) { + var protoBlocksBatch Game7BlocksBatch + + dataBytes := rawData.Bytes() + + err := proto.Unmarshal(dataBytes, &protoBlocksBatch) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal data: %v", err) + } + + blocksBatchJson := ToEntireBlocksBatchFromLogProto(&protoBlocksBatch) + + return blocksBatchJson, nil +} + +func (c *Client) DecodeProtoEntireBlockToLabels(rawData *bytes.Buffer, abiMap map[string]map[string]*indexer.AbiEntry, threads int) ([]indexer.EventLabel, []indexer.TransactionLabel, error) { + var protoBlocksBatch Game7BlocksBatch + + dataBytes := rawData.Bytes() + + err := proto.Unmarshal(dataBytes, &protoBlocksBatch) + if err != nil { + return nil, nil, fmt.Errorf("failed to unmarshal data: %v", err) + } + + // Shared slices to collect labels + var labels []indexer.EventLabel + var txLabels []indexer.TransactionLabel + var labelsMutex sync.Mutex + + var decodeErr error + + var wg sync.WaitGroup + + // Concurrency limit (e.g., 10 goroutines at a time) + concurrencyLimit := threads + semaphoreChan := make(chan struct{}, concurrencyLimit) + + // Channel to collect errors from goroutines + errorChan := make(chan error, len(protoBlocksBatch.Blocks)) + + // Iterate over blocks and launch goroutines + for _, b := range protoBlocksBatch.Blocks { + wg.Add(1) + semaphoreChan <- struct{}{} + go func(b *Game7Block) { + defer wg.Done() + defer func() { <-semaphoreChan }() + + // Local slices to collect labels for this block + var localEventLabels []indexer.EventLabel + var localTxLabels []indexer.TransactionLabel + + for _, tx := range b.Transactions { + var decodedArgsTx map[string]interface{} + + label := indexer.SeerCrawlerLabel + + if len(tx.Input) < 10 { // If input is less than 3 characters then it direct transfer + continue + } + + // Process transaction labels + selector := tx.Input[:10] + + if abiMap[tx.ToAddress] != nil && abiMap[tx.ToAddress][selector] != nil { + + txAbiEntry := abiMap[tx.ToAddress][selector] + + var initErr error + txAbiEntry.Once.Do(func() { + txAbiEntry.Abi, initErr = seer_common.GetABI(txAbiEntry.AbiJSON) + }) + + // Check if an error occurred during ABI parsing + if initErr != nil || txAbiEntry.Abi == nil { + errorChan <- fmt.Errorf("error getting ABI for address %s: %v", tx.ToAddress, initErr) + continue + } + + inputData, err := hex.DecodeString(tx.Input[2:]) + if err != nil { + errorChan <- fmt.Errorf("error decoding input data for tx %s: %v", tx.Hash, err) + continue + } + decodedArgsTx, decodeErr = seer_common.DecodeTransactionInputDataToInterface(txAbiEntry.Abi, inputData) + if decodeErr != nil { + fmt.Println("Error decoding transaction not decoded data: ", tx.Hash, decodeErr) + decodedArgsTx = map[string]interface{}{ + "input_raw": tx, + "abi": txAbiEntry.AbiJSON, + "selector": selector, + "error": decodeErr, + } + label = indexer.SeerCrawlerRawLabel + } + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + receipt, err := c.TransactionReceipt(ctxWithTimeout, common.HexToHash(tx.Hash)) + if err != nil { + errorChan <- fmt.Errorf("error getting transaction receipt for tx %s: %v", tx.Hash, err) + continue + } + + // check if the transaction was successful + if receipt.Status == 1 { + decodedArgsTx["status"] = 1 + } else { + decodedArgsTx["status"] = 0 + } + + txLabelDataBytes, err := json.Marshal(decodedArgsTx) + if err != nil { + errorChan <- fmt.Errorf("error converting decodedArgsTx to JSON for tx %s: %v", tx.Hash, err) + continue + } + + // Convert transaction to label + transactionLabel := indexer.TransactionLabel{ + Address: tx.ToAddress, + BlockNumber: tx.BlockNumber, + BlockHash: tx.BlockHash, + CallerAddress: tx.FromAddress, + LabelName: txAbiEntry.AbiName, + LabelType: "tx_call", + OriginAddress: tx.FromAddress, + Label: label, + TransactionHash: tx.Hash, + LabelData: string(txLabelDataBytes), // Convert JSON byte slice to string + BlockTimestamp: b.Timestamp, + } + + localTxLabels = append(localTxLabels, transactionLabel) + } + + // Process events + for _, e := range tx.Logs { + var decodedArgsLogs map[string]interface{} + label = indexer.SeerCrawlerLabel + + var topicSelector string + + if len(e.Topics) > 0 { + topicSelector = e.Topics[0] + } else { + // 0x0 is the default topic selector + topicSelector = "0x0" + } + + if abiMap[e.Address] == nil || abiMap[e.Address][topicSelector] == nil { + continue + } + + abiEntryLog := abiMap[e.Address][topicSelector] + + var initErr error + abiEntryLog.Once.Do(func() { + abiEntryLog.Abi, initErr = seer_common.GetABI(abiEntryLog.AbiJSON) + }) + + // Check if an error occurred during ABI parsing + if initErr != nil || abiEntryLog.Abi == nil { + errorChan <- fmt.Errorf("error getting ABI for log address %s: %v", e.Address, initErr) + continue + } + + // Decode the event data + decodedArgsLogs, decodeErr = seer_common.DecodeLogArgsToLabelData(abiEntryLog.Abi, e.Topics, e.Data) + if decodeErr != nil { + fmt.Println("Error decoding event not decoded data: ", e.TransactionHash, decodeErr) + decodedArgsLogs = map[string]interface{}{ + "input_raw": e, + "abi": abiEntryLog.AbiJSON, + "selector": topicSelector, + "error": decodeErr, + } + label = indexer.SeerCrawlerRawLabel + } + + // Convert decodedArgsLogs map to JSON + labelDataBytes, err := json.Marshal(decodedArgsLogs) + if err != nil { + errorChan <- fmt.Errorf("error converting decodedArgsLogs to JSON for tx %s: %v", e.TransactionHash, err) + continue + } + // Convert event to label + eventLabel := indexer.EventLabel{ + Label: label, + LabelName: abiEntryLog.AbiName, + LabelType: "event", + BlockNumber: e.BlockNumber, + BlockHash: e.BlockHash, + Address: e.Address, + OriginAddress: tx.FromAddress, + TransactionHash: e.TransactionHash, + LabelData: string(labelDataBytes), // Convert JSON byte slice to string + BlockTimestamp: b.Timestamp, + LogIndex: e.LogIndex, + } + + localEventLabels = append(localEventLabels, eventLabel) + } + } + + // Append local labels to shared slices under mutex + labelsMutex.Lock() + labels = append(labels, localEventLabels...) + txLabels = append(txLabels, localTxLabels...) + labelsMutex.Unlock() + }(b) + } + // Wait for all block processing goroutines to finish + wg.Wait() + close(errorChan) + + // Collect all errors + var errorMessages []string + for err := range errorChan { + errorMessages = append(errorMessages, err.Error()) + } + + // If any errors occurred, return them + if len(errorMessages) > 0 { + return nil, nil, fmt.Errorf("errors occurred during processing:\n%s", strings.Join(errorMessages, "\n")) + } + + return labels, txLabels, nil +} + +func (c *Client) DecodeProtoTransactionsToLabels(transactions []string, blocksCache map[uint64]uint64, abiMap map[string]map[string]*indexer.AbiEntry) ([]indexer.TransactionLabel, error) { + + decodedTransactions, err := c.DecodeProtoTransactions(transactions) + + if err != nil { + return nil, err + } + + var labels []indexer.TransactionLabel + var decodedArgs map[string]interface{} + var decodeErr error + + for _, transaction := range decodedTransactions { + + label := indexer.SeerCrawlerLabel + + selector := transaction.Input[:10] + + if abiMap[transaction.ToAddress][selector].Abi == nil { + abiMap[transaction.ToAddress][selector].Abi, err = seer_common.GetABI(abiMap[transaction.ToAddress][selector].AbiJSON) + if err != nil { + fmt.Println("Error getting ABI: ", err) + return nil, err + } + } + + inputData, err := hex.DecodeString(transaction.Input[2:]) + if err != nil { + fmt.Println("Error decoding input data: ", err) + return nil, err + } + + decodedArgs, decodeErr = seer_common.DecodeTransactionInputDataToInterface(abiMap[transaction.ToAddress][selector].Abi, inputData) + + if decodeErr != nil { + fmt.Println("Error decoding transaction not decoded data: ", transaction.Hash, decodeErr) + decodedArgs = map[string]interface{}{ + "input_raw": transaction, + "abi": abiMap[transaction.ToAddress][selector].AbiJSON, + "selector": selector, + "error": decodeErr, + } + label = indexer.SeerCrawlerRawLabel + } + + labelDataBytes, err := json.Marshal(decodedArgs) + if err != nil { + fmt.Println("Error converting decodedArgs to JSON: ", err) + return nil, err + } + + // Convert JSON byte slice to string + labelDataString := string(labelDataBytes) + + // Convert transaction to label + transactionLabel := indexer.TransactionLabel{ + Address: transaction.ToAddress, + BlockNumber: transaction.BlockNumber, + BlockHash: transaction.BlockHash, + CallerAddress: transaction.FromAddress, + LabelName: abiMap[transaction.ToAddress][selector].AbiName, + LabelType: "tx_call", + OriginAddress: transaction.FromAddress, + Label: label, + TransactionHash: transaction.Hash, + LabelData: labelDataString, + BlockTimestamp: blocksCache[transaction.BlockNumber], + } + + labels = append(labels, transactionLabel) + + } + + return labels, nil +} + +func (c *Client) GetTransactionByHash(ctx context.Context, hash string) (*seer_common.TransactionJson, error) { + var tx *seer_common.TransactionJson + err := c.rpcClient.CallContext(ctx, &tx, "eth_getTransactionByHash", hash) + return tx, err +} + +func (c *Client) GetTransactionsLabels(startBlock uint64, endBlock uint64, abiMap map[string]map[string]*indexer.AbiEntry, threads int) ([]indexer.TransactionLabel, map[uint64]seer_common.BlockWithTransactions, error) { + var transactionsLabels []indexer.TransactionLabel + + var blocksCache map[uint64]seer_common.BlockWithTransactions + + // Get blocks in range + blocks, err := c.FetchBlocksInRangeAsync(big.NewInt(int64(startBlock)), big.NewInt(int64(endBlock)), false, threads) + + if err != nil { + return nil, nil, err + } + + // Get transactions in range + + for _, block := range blocks { + + blockNumber, err := strconv.ParseUint(block.BlockNumber, 0, 64) + if err != nil { + log.Fatalf("Failed to convert BlockNumber to uint64: %v", err) + } + + blockTimestamp, err := strconv.ParseUint(block.Timestamp, 0, 64) + + if err != nil { + log.Fatalf("Failed to convert BlockTimestamp to uint64: %v", err) + } + + if blocksCache == nil { + blocksCache = make(map[uint64]seer_common.BlockWithTransactions) + } + + blocksCache[blockNumber] = seer_common.BlockWithTransactions{ + BlockNumber: blockNumber, + BlockHash: block.Hash, + BlockTimestamp: blockTimestamp, + Transactions: make(map[string]seer_common.TransactionJson), + } + + for _, tx := range block.Transactions { + + label := indexer.SeerCrawlerLabel + + if len(tx.Input) < 10 { // If input is less than 3 characters then it direct transfer + continue + } + // Fill blocks cache + blocksCache[blockNumber].Transactions[tx.Hash] = tx + + // Process transaction labels + + selector := tx.Input[:10] + + if abiMap[tx.ToAddress] != nil && abiMap[tx.ToAddress][selector] != nil { + + abiEntryTx := abiMap[tx.ToAddress][selector] + + var err error + abiEntryTx.Once.Do(func() { + abiEntryTx.Abi, err = seer_common.GetABI(abiEntryTx.AbiJSON) + if err != nil { + fmt.Println("Error getting ABI: ", err) + return + } + }) + + // Check if an error occurred during ABI parsing + if abiEntryTx.Abi == nil { + fmt.Println("Error getting ABI: ", err) + return nil, nil, err + } + + inputData, err := hex.DecodeString(tx.Input[2:]) + if err != nil { + fmt.Println("Error decoding input data: ", err) + return nil, nil, err + } + + decodedArgsTx, decodeErr := seer_common.DecodeTransactionInputDataToInterface(abiEntryTx.Abi, inputData) + if decodeErr != nil { + fmt.Println("Error decoding transaction not decoded data: ", tx.Hash, decodeErr) + decodedArgsTx = map[string]interface{}{ + "input_raw": tx, + "abi": abiEntryTx.AbiJSON, + "selector": selector, + "error": decodeErr, + } + label = indexer.SeerCrawlerRawLabel + } + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + receipt, err := c.TransactionReceipt(ctxWithTimeout, common.HexToHash(tx.Hash)) + + if err != nil { + fmt.Println("Error fetching transaction receipt: ", err) + return nil, nil, err + } + + // check if the transaction was successful + if receipt.Status == 1 { + decodedArgsTx["status"] = 1 + } else { + decodedArgsTx["status"] = 0 + } + + txLabelDataBytes, err := json.Marshal(decodedArgsTx) + if err != nil { + fmt.Println("Error converting decodedArgsTx to JSON: ", err) + return nil, nil, err + } + + // Convert transaction to label + transactionLabel := indexer.TransactionLabel{ + Address: tx.ToAddress, + BlockNumber: blockNumber, + BlockHash: tx.BlockHash, + CallerAddress: tx.FromAddress, + LabelName: abiEntryTx.AbiName, + LabelType: "tx_call", + OriginAddress: tx.FromAddress, + Label: label, + TransactionHash: tx.Hash, + LabelData: string(txLabelDataBytes), // Convert JSON byte slice to string + BlockTimestamp: blockTimestamp, + } + + transactionsLabels = append(transactionsLabels, transactionLabel) + } + + } + + } + + return transactionsLabels, blocksCache, nil + +} + +func (c *Client) GetEventsLabels(startBlock uint64, endBlock uint64, abiMap map[string]map[string]*indexer.AbiEntry, blocksCache map[uint64]seer_common.BlockWithTransactions) ([]indexer.EventLabel, error) { + var eventsLabels []indexer.EventLabel + + if blocksCache == nil { + blocksCache = make(map[uint64]seer_common.BlockWithTransactions) + } + + // Get events in range + + var addresses []common.Address + var topics []common.Hash + + for address, selectorMap := range abiMap { + for selector, _ := range selectorMap { + topics = append(topics, common.HexToHash(selector)) + } + + addresses = append(addresses, common.HexToAddress(address)) + } + + // query filter from abiMap + filter := ethereum.FilterQuery{ + FromBlock: big.NewInt(int64(startBlock)), + ToBlock: big.NewInt(int64(endBlock)), + Addresses: addresses, + Topics: [][]common.Hash{topics}, + } + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + logs, err := c.ClientFilterLogs(ctxWithTimeout, filter, false) + + if err != nil { + return nil, err + } + + for _, log := range logs { + var decodedArgsLogs map[string]interface{} + label := indexer.SeerCrawlerLabel + + var topicSelector string + + if len(log.Topics) > 0 { + topicSelector = log.Topics[0] + } else { + // 0x0 is the default topic selector + topicSelector = "0x0" + } + + if abiMap[log.Address] == nil || abiMap[log.Address][topicSelector] == nil { + continue + } + + abiEntryLog := abiMap[log.Address][topicSelector] + + var initErr error + abiEntryLog.Once.Do(func() { + abiEntryLog.Abi, initErr = seer_common.GetABI(abiEntryLog.AbiJSON) + }) + + // Check if an error occurred during ABI parsing + if initErr != nil || abiEntryLog.Abi == nil { + fmt.Println("Error getting ABI: ", initErr) + return nil, initErr + } + + // Decode the event data + decodedArgsLogs, decodeErr := seer_common.DecodeLogArgsToLabelData(abiEntryLog.Abi, log.Topics, log.Data) + if decodeErr != nil { + fmt.Println("Error decoding event not decoded data: ", log.TransactionHash, decodeErr) + decodedArgsLogs = map[string]interface{}{ + "input_raw": log, + "abi": abiEntryLog.AbiJSON, + "selector": topicSelector, + "error": decodeErr, + } + label = indexer.SeerCrawlerRawLabel + } + + // Convert decodedArgsLogs map to JSON + labelDataBytes, err := json.Marshal(decodedArgsLogs) + if err != nil { + fmt.Println("Error converting decodedArgsLogs to JSON: ", err) + return nil, err + } + + blockNumber, err := strconv.ParseUint(log.BlockNumber, 0, 64) + if err != nil { + return nil, err + } + + if _, ok := blocksCache[blockNumber]; !ok { + + ctxWithTimeout, cancel := context.WithTimeout(context.Background(), c.timeout) + + defer cancel() + + // get block from rpc + block, err := c.GetBlockByNumber(ctxWithTimeout, big.NewInt(int64(blockNumber)), true) + if err != nil { + return nil, err + } + + blockTimestamp, err := strconv.ParseUint(block.Timestamp, 0, 64) + if err != nil { + return nil, err + } + + blocksCache[blockNumber] = seer_common.BlockWithTransactions{ + BlockNumber: blockNumber, + BlockHash: block.Hash, + BlockTimestamp: blockTimestamp, + Transactions: make(map[string]seer_common.TransactionJson), + } + + for _, tx := range block.Transactions { + blocksCache[blockNumber].Transactions[tx.Hash] = tx + } + + } + + transaction := blocksCache[blockNumber].Transactions[log.TransactionHash] + + logIndex, err := strconv.ParseUint(log.LogIndex, 0, 64) + if err != nil { + return nil, err + } + + // Convert event to label + eventLabel := indexer.EventLabel{ + Label: label, + LabelName: abiEntryLog.AbiName, + LabelType: "event", + BlockNumber: blockNumber, + BlockHash: log.BlockHash, + Address: log.Address, + OriginAddress: transaction.FromAddress, + TransactionHash: log.TransactionHash, + LabelData: string(labelDataBytes), // Convert JSON byte slice to string + BlockTimestamp: blocksCache[blockNumber].BlockTimestamp, + LogIndex: logIndex, + } + + eventsLabels = append(eventsLabels, eventLabel) + + } + + return eventsLabels, nil + +} diff --git a/blockchain/game7/game7_testnet_index_types.pb.go b/blockchain/game7/game7_testnet_index_types.pb.go new file mode 100644 index 0000000..032c7ab --- /dev/null +++ b/blockchain/game7/game7_testnet_index_types.pb.go @@ -0,0 +1,954 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v3.6.1 +// source: blockchain/game7/game7_testnet_index_types.proto + +package game7 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 Game7TransactionAccessList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + StorageKeys []string `protobuf:"bytes,2,rep,name=storage_keys,json=storageKeys,proto3" json:"storage_keys,omitempty"` +} + +func (x *Game7TransactionAccessList) Reset() { + *x = Game7TransactionAccessList{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Game7TransactionAccessList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Game7TransactionAccessList) ProtoMessage() {} + +func (x *Game7TransactionAccessList) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_game7_game7_testnet_index_types_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 Game7TransactionAccessList.ProtoReflect.Descriptor instead. +func (*Game7TransactionAccessList) Descriptor() ([]byte, []int) { + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Game7TransactionAccessList) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Game7TransactionAccessList) GetStorageKeys() []string { + if x != nil { + return x.StorageKeys + } + return nil +} + +// Represents a single transaction within a block +type Game7Transaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // The hash of the transaction + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` // The block number the transaction is in + FromAddress string `protobuf:"bytes,3,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` // The address the transaction is sent from + ToAddress string `protobuf:"bytes,4,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` // The address the transaction is sent to + Gas string `protobuf:"bytes,5,opt,name=gas,proto3" json:"gas,omitempty"` // The gas limit of the transaction + GasPrice string `protobuf:"bytes,6,opt,name=gas_price,json=gasPrice,proto3" json:"gas_price,omitempty"` // The gas price of the transaction + MaxFeePerGas string `protobuf:"bytes,7,opt,name=max_fee_per_gas,json=maxFeePerGas,proto3" json:"max_fee_per_gas,omitempty"` // Used as a field to match potential EIP-1559 transaction types + MaxPriorityFeePerGas string `protobuf:"bytes,8,opt,name=max_priority_fee_per_gas,json=maxPriorityFeePerGas,proto3" json:"max_priority_fee_per_gas,omitempty"` // Used as a field to match potential EIP-1559 transaction types + Input string `protobuf:"bytes,9,opt,name=input,proto3" json:"input,omitempty"` // The input data of the transaction + Nonce string `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"` // The nonce of the transaction + TransactionIndex uint64 `protobuf:"varint,11,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"` // The index of the transaction in the block + TransactionType uint64 `protobuf:"varint,12,opt,name=transaction_type,json=transactionType,proto3" json:"transaction_type,omitempty"` // Field to match potential EIP-1559 transaction types + Value string `protobuf:"bytes,13,opt,name=value,proto3" json:"value,omitempty"` // The value of the transaction + IndexedAt uint64 `protobuf:"varint,14,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"` // When the transaction was indexed by crawler + BlockTimestamp uint64 `protobuf:"varint,15,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"` // The timestamp of this block + BlockHash string `protobuf:"bytes,16,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // The hash of the block the transaction is in + ChainId string `protobuf:"bytes,17,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // Used as a field to match potential EIP-1559 transaction types + V string `protobuf:"bytes,18,opt,name=v,proto3" json:"v,omitempty"` // Used as a field to match potential EIP-1559 transaction types + R string `protobuf:"bytes,19,opt,name=r,proto3" json:"r,omitempty"` // Used as a field to match potential EIP-1559 transaction types + S string `protobuf:"bytes,20,opt,name=s,proto3" json:"s,omitempty"` // Used as a field to match potential EIP-1559 transaction types + AccessList []*Game7TransactionAccessList `protobuf:"bytes,21,rep,name=access_list,json=accessList,proto3" json:"access_list,omitempty"` + YParity string `protobuf:"bytes,22,opt,name=y_parity,json=yParity,proto3" json:"y_parity,omitempty"` // Used as a field to match potential EIP-1559 transaction types + Logs []*Game7EventLog `protobuf:"bytes,23,rep,name=logs,proto3" json:"logs,omitempty"` // The logs generated by this transaction +} + +func (x *Game7Transaction) Reset() { + *x = Game7Transaction{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Game7Transaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Game7Transaction) ProtoMessage() {} + +func (x *Game7Transaction) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_game7_game7_testnet_index_types_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 Game7Transaction.ProtoReflect.Descriptor instead. +func (*Game7Transaction) Descriptor() ([]byte, []int) { + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Game7Transaction) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *Game7Transaction) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *Game7Transaction) GetFromAddress() string { + if x != nil { + return x.FromAddress + } + return "" +} + +func (x *Game7Transaction) GetToAddress() string { + if x != nil { + return x.ToAddress + } + return "" +} + +func (x *Game7Transaction) GetGas() string { + if x != nil { + return x.Gas + } + return "" +} + +func (x *Game7Transaction) GetGasPrice() string { + if x != nil { + return x.GasPrice + } + return "" +} + +func (x *Game7Transaction) GetMaxFeePerGas() string { + if x != nil { + return x.MaxFeePerGas + } + return "" +} + +func (x *Game7Transaction) GetMaxPriorityFeePerGas() string { + if x != nil { + return x.MaxPriorityFeePerGas + } + return "" +} + +func (x *Game7Transaction) GetInput() string { + if x != nil { + return x.Input + } + return "" +} + +func (x *Game7Transaction) GetNonce() string { + if x != nil { + return x.Nonce + } + return "" +} + +func (x *Game7Transaction) GetTransactionIndex() uint64 { + if x != nil { + return x.TransactionIndex + } + return 0 +} + +func (x *Game7Transaction) GetTransactionType() uint64 { + if x != nil { + return x.TransactionType + } + return 0 +} + +func (x *Game7Transaction) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *Game7Transaction) GetIndexedAt() uint64 { + if x != nil { + return x.IndexedAt + } + return 0 +} + +func (x *Game7Transaction) GetBlockTimestamp() uint64 { + if x != nil { + return x.BlockTimestamp + } + return 0 +} + +func (x *Game7Transaction) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *Game7Transaction) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *Game7Transaction) GetV() string { + if x != nil { + return x.V + } + return "" +} + +func (x *Game7Transaction) GetR() string { + if x != nil { + return x.R + } + return "" +} + +func (x *Game7Transaction) GetS() string { + if x != nil { + return x.S + } + return "" +} + +func (x *Game7Transaction) GetAccessList() []*Game7TransactionAccessList { + if x != nil { + return x.AccessList + } + return nil +} + +func (x *Game7Transaction) GetYParity() string { + if x != nil { + return x.YParity + } + return "" +} + +func (x *Game7Transaction) GetLogs() []*Game7EventLog { + if x != nil { + return x.Logs + } + return nil +} + +// Represents a block in the blockchain +type Game7Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` // The block number + Difficulty uint64 `protobuf:"varint,2,opt,name=difficulty,proto3" json:"difficulty,omitempty"` // The difficulty of this block + ExtraData string `protobuf:"bytes,3,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` // Extra data included in the block + GasLimit uint64 `protobuf:"varint,4,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` // The gas limit for this block + GasUsed uint64 `protobuf:"varint,5,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` // The total gas used by all transactions in this block + BaseFeePerGas string `protobuf:"bytes,6,opt,name=base_fee_per_gas,json=baseFeePerGas,proto3" json:"base_fee_per_gas,omitempty"` // The base fee per gas for this block + Hash string `protobuf:"bytes,7,opt,name=hash,proto3" json:"hash,omitempty"` // The hash of this block + LogsBloom string `protobuf:"bytes,8,opt,name=logs_bloom,json=logsBloom,proto3" json:"logs_bloom,omitempty"` // The logs bloom filter for this block + Miner string `protobuf:"bytes,9,opt,name=miner,proto3" json:"miner,omitempty"` // The address of the miner who mined this block + Nonce string `protobuf:"bytes,10,opt,name=nonce,proto3" json:"nonce,omitempty"` // The nonce of this block + ParentHash string `protobuf:"bytes,11,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` // The hash of the parent block + ReceiptsRoot string `protobuf:"bytes,12,opt,name=receipts_root,json=receiptsRoot,proto3" json:"receipts_root,omitempty"` // The root hash of the receipts trie + Sha3Uncles string `protobuf:"bytes,13,opt,name=sha3_uncles,json=sha3Uncles,proto3" json:"sha3_uncles,omitempty"` // The SHA3 hash of the uncles data in this block + Size uint64 `protobuf:"varint,14,opt,name=size,proto3" json:"size,omitempty"` // The size of this block + StateRoot string `protobuf:"bytes,15,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` // The root hash of the state trie + Timestamp uint64 `protobuf:"varint,16,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + TotalDifficulty string `protobuf:"bytes,17,opt,name=total_difficulty,json=totalDifficulty,proto3" json:"total_difficulty,omitempty"` // The total difficulty of the chain until this block + TransactionsRoot string `protobuf:"bytes,18,opt,name=transactions_root,json=transactionsRoot,proto3" json:"transactions_root,omitempty"` // The root hash of the transactions trie + IndexedAt uint64 `protobuf:"varint,19,opt,name=indexed_at,json=indexedAt,proto3" json:"indexed_at,omitempty"` // When the block was indexed by crawler + Transactions []*Game7Transaction `protobuf:"bytes,20,rep,name=transactions,proto3" json:"transactions,omitempty"` // The transactions included in this block + MixHash string `protobuf:"bytes,21,opt,name=mix_hash,json=mixHash,proto3" json:"mix_hash,omitempty"` // The timestamp of this block + SendCount string `protobuf:"bytes,22,opt,name=send_count,json=sendCount,proto3" json:"send_count,omitempty"` // The number of sends in this block + SendRoot string `protobuf:"bytes,23,opt,name=send_root,json=sendRoot,proto3" json:"send_root,omitempty"` // The root hash of the sends trie + L1BlockNumber uint64 `protobuf:"varint,24,opt,name=l1_block_number,json=l1BlockNumber,proto3" json:"l1_block_number,omitempty"` // The block number of the corresponding L1 block +} + +func (x *Game7Block) Reset() { + *x = Game7Block{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Game7Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Game7Block) ProtoMessage() {} + +func (x *Game7Block) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_game7_game7_testnet_index_types_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 Game7Block.ProtoReflect.Descriptor instead. +func (*Game7Block) Descriptor() ([]byte, []int) { + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Game7Block) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *Game7Block) GetDifficulty() uint64 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *Game7Block) GetExtraData() string { + if x != nil { + return x.ExtraData + } + return "" +} + +func (x *Game7Block) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit + } + return 0 +} + +func (x *Game7Block) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed + } + return 0 +} + +func (x *Game7Block) GetBaseFeePerGas() string { + if x != nil { + return x.BaseFeePerGas + } + return "" +} + +func (x *Game7Block) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *Game7Block) GetLogsBloom() string { + if x != nil { + return x.LogsBloom + } + return "" +} + +func (x *Game7Block) GetMiner() string { + if x != nil { + return x.Miner + } + return "" +} + +func (x *Game7Block) GetNonce() string { + if x != nil { + return x.Nonce + } + return "" +} + +func (x *Game7Block) GetParentHash() string { + if x != nil { + return x.ParentHash + } + return "" +} + +func (x *Game7Block) GetReceiptsRoot() string { + if x != nil { + return x.ReceiptsRoot + } + return "" +} + +func (x *Game7Block) GetSha3Uncles() string { + if x != nil { + return x.Sha3Uncles + } + return "" +} + +func (x *Game7Block) GetSize() uint64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *Game7Block) GetStateRoot() string { + if x != nil { + return x.StateRoot + } + return "" +} + +func (x *Game7Block) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *Game7Block) GetTotalDifficulty() string { + if x != nil { + return x.TotalDifficulty + } + return "" +} + +func (x *Game7Block) GetTransactionsRoot() string { + if x != nil { + return x.TransactionsRoot + } + return "" +} + +func (x *Game7Block) GetIndexedAt() uint64 { + if x != nil { + return x.IndexedAt + } + return 0 +} + +func (x *Game7Block) GetTransactions() []*Game7Transaction { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *Game7Block) GetMixHash() string { + if x != nil { + return x.MixHash + } + return "" +} + +func (x *Game7Block) GetSendCount() string { + if x != nil { + return x.SendCount + } + return "" +} + +func (x *Game7Block) GetSendRoot() string { + if x != nil { + return x.SendRoot + } + return "" +} + +func (x *Game7Block) GetL1BlockNumber() uint64 { + if x != nil { + return x.L1BlockNumber + } + return 0 +} + +type Game7EventLog struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The address of the contract that generated the log + Topics []string `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"` // Topics are indexed parameters during log generation + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // The data field from the log + BlockNumber uint64 `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` // The block number where this log was in + TransactionHash string `protobuf:"bytes,5,opt,name=transaction_hash,json=transactionHash,proto3" json:"transaction_hash,omitempty"` // The hash of the transaction that generated this log + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // The hash of the block where this log was in + Removed bool `protobuf:"varint,7,opt,name=removed,proto3" json:"removed,omitempty"` // True if the log was reverted due to a chain reorganization + LogIndex uint64 `protobuf:"varint,8,opt,name=log_index,json=logIndex,proto3" json:"log_index,omitempty"` // The index of the log in the block + TransactionIndex uint64 `protobuf:"varint,9,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"` // The index of the transaction in the block +} + +func (x *Game7EventLog) Reset() { + *x = Game7EventLog{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Game7EventLog) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Game7EventLog) ProtoMessage() {} + +func (x *Game7EventLog) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_game7_game7_testnet_index_types_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 Game7EventLog.ProtoReflect.Descriptor instead. +func (*Game7EventLog) Descriptor() ([]byte, []int) { + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP(), []int{3} +} + +func (x *Game7EventLog) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Game7EventLog) GetTopics() []string { + if x != nil { + return x.Topics + } + return nil +} + +func (x *Game7EventLog) GetData() string { + if x != nil { + return x.Data + } + return "" +} + +func (x *Game7EventLog) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *Game7EventLog) GetTransactionHash() string { + if x != nil { + return x.TransactionHash + } + return "" +} + +func (x *Game7EventLog) GetBlockHash() string { + if x != nil { + return x.BlockHash + } + return "" +} + +func (x *Game7EventLog) GetRemoved() bool { + if x != nil { + return x.Removed + } + return false +} + +func (x *Game7EventLog) GetLogIndex() uint64 { + if x != nil { + return x.LogIndex + } + return 0 +} + +func (x *Game7EventLog) GetTransactionIndex() uint64 { + if x != nil { + return x.TransactionIndex + } + return 0 +} + +type Game7BlocksBatch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*Game7Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` + SeerVersion string `protobuf:"bytes,2,opt,name=seer_version,json=seerVersion,proto3" json:"seer_version,omitempty"` +} + +func (x *Game7BlocksBatch) Reset() { + *x = Game7BlocksBatch{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Game7BlocksBatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Game7BlocksBatch) ProtoMessage() {} + +func (x *Game7BlocksBatch) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[4] + 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 Game7BlocksBatch.ProtoReflect.Descriptor instead. +func (*Game7BlocksBatch) Descriptor() ([]byte, []int) { + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP(), []int{4} +} + +func (x *Game7BlocksBatch) GetBlocks() []*Game7Block { + if x != nil { + return x.Blocks + } + return nil +} + +func (x *Game7BlocksBatch) GetSeerVersion() string { + if x != nil { + return x.SeerVersion + } + return "" +} + +var File_blockchain_game7_game7_testnet_index_types_proto protoreflect.FileDescriptor + +var file_blockchain_game7_game7_testnet_index_types_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x67, 0x61, 0x6d, + 0x65, 0x37, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x37, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x6e, 0x65, 0x74, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x1a, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x22, 0xdc, 0x05, + 0x0a, 0x10, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x72, 0x6f, + 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x67, + 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0f, 0x6d, 0x61, + 0x78, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, + 0x73, 0x12, 0x36, 0x0a, 0x18, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x14, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x01, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, + 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, + 0x3c, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x15, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x69, 0x74, 0x79, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x79, 0x50, 0x61, 0x72, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, + 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x93, 0x06, 0x0a, + 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1e, + 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, + 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, + 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, + 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x23, + 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x33, 0x5f, 0x75, 0x6e, 0x63, 0x6c, + 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x61, 0x33, 0x55, 0x6e, + 0x63, 0x6c, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, + 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x0c, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x14, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x69, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x31, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6c, 0x31, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x22, 0xa6, 0x02, 0x0a, 0x0d, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x29, 0x0a, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2b, + 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x5a, 0x0a, 0x10, 0x47, + 0x61, 0x6d, 0x65, 0x37, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, + 0x23, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x47, 0x61, 0x6d, 0x65, 0x37, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x65, 0x72, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x37, 0x44, 0x41, 0x4f, 0x2f, 0x73, 0x65, 0x65, 0x72, + 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x67, 0x61, 0x6d, 0x65, + 0x37, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_blockchain_game7_game7_testnet_index_types_proto_rawDescOnce sync.Once + file_blockchain_game7_game7_testnet_index_types_proto_rawDescData = file_blockchain_game7_game7_testnet_index_types_proto_rawDesc +) + +func file_blockchain_game7_game7_testnet_index_types_proto_rawDescGZIP() []byte { + file_blockchain_game7_game7_testnet_index_types_proto_rawDescOnce.Do(func() { + file_blockchain_game7_game7_testnet_index_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_blockchain_game7_game7_testnet_index_types_proto_rawDescData) + }) + return file_blockchain_game7_game7_testnet_index_types_proto_rawDescData +} + +var file_blockchain_game7_game7_testnet_index_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_blockchain_game7_game7_testnet_index_types_proto_goTypes = []any{ + (*Game7TransactionAccessList)(nil), // 0: Game7TransactionAccessList + (*Game7Transaction)(nil), // 1: Game7Transaction + (*Game7Block)(nil), // 2: Game7Block + (*Game7EventLog)(nil), // 3: Game7EventLog + (*Game7BlocksBatch)(nil), // 4: Game7BlocksBatch +} +var file_blockchain_game7_game7_testnet_index_types_proto_depIdxs = []int32{ + 0, // 0: Game7Transaction.access_list:type_name -> Game7TransactionAccessList + 3, // 1: Game7Transaction.logs:type_name -> Game7EventLog + 1, // 2: Game7Block.transactions:type_name -> Game7Transaction + 2, // 3: Game7BlocksBatch.blocks:type_name -> Game7Block + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_blockchain_game7_game7_testnet_index_types_proto_init() } +func file_blockchain_game7_game7_testnet_index_types_proto_init() { + if File_blockchain_game7_game7_testnet_index_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Game7TransactionAccessList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Game7Transaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*Game7Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*Game7EventLog); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_game7_game7_testnet_index_types_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*Game7BlocksBatch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_blockchain_game7_game7_testnet_index_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_blockchain_game7_game7_testnet_index_types_proto_goTypes, + DependencyIndexes: file_blockchain_game7_game7_testnet_index_types_proto_depIdxs, + MessageInfos: file_blockchain_game7_game7_testnet_index_types_proto_msgTypes, + }.Build() + File_blockchain_game7_game7_testnet_index_types_proto = out.File + file_blockchain_game7_game7_testnet_index_types_proto_rawDesc = nil + file_blockchain_game7_game7_testnet_index_types_proto_goTypes = nil + file_blockchain_game7_game7_testnet_index_types_proto_depIdxs = nil +} diff --git a/blockchain/game7/game7_testnet_index_types.proto b/blockchain/game7/game7_testnet_index_types.proto new file mode 100644 index 0000000..59ae690 --- /dev/null +++ b/blockchain/game7/game7_testnet_index_types.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +option go_package = "github.com/G7DAO/seer/blockchain/game7" ; + + +message Game7TransactionAccessList { + string address = 1; + repeated string storage_keys = 2; +} + +// Represents a single transaction within a block +message Game7Transaction { + string hash = 1; // The hash of the transaction + uint64 block_number = 2; // The block number the transaction is in + string from_address = 3; // The address the transaction is sent from + string to_address = 4; // The address the transaction is sent to + string gas = 5; // The gas limit of the transaction + string gas_price = 6; // The gas price of the transaction + string max_fee_per_gas = 7; // Used as a field to match potential EIP-1559 transaction types + string max_priority_fee_per_gas = 8; // Used as a field to match potential EIP-1559 transaction types + string input = 9; // The input data of the transaction + string nonce = 10; // The nonce of the transaction + uint64 transaction_index = 11; // The index of the transaction in the block + uint64 transaction_type = 12; // Field to match potential EIP-1559 transaction types + string value = 13; // The value of the transaction + uint64 indexed_at = 14; // When the transaction was indexed by crawler + uint64 block_timestamp = 15; // The timestamp of this block + string block_hash = 16; // The hash of the block the transaction is in + string chain_id = 17; // Used as a field to match potential EIP-1559 transaction types + string v = 18; // Used as a field to match potential EIP-1559 transaction types + string r = 19; // Used as a field to match potential EIP-1559 transaction types + string s = 20; // Used as a field to match potential EIP-1559 transaction types + repeated Game7TransactionAccessList access_list = 21; + string y_parity = 22; // Used as a field to match potential EIP-1559 transaction types + repeated Game7EventLog logs = 23; // The logs generated by this transaction +} + +// Represents a block in the blockchain +message Game7Block { + uint64 block_number = 1; // The block number + uint64 difficulty = 2; // The difficulty of this block + string extra_data = 3; // Extra data included in the block + uint64 gas_limit = 4; // The gas limit for this block + uint64 gas_used = 5; // The total gas used by all transactions in this block + string base_fee_per_gas = 6; // The base fee per gas for this block + string hash = 7; // The hash of this block + string logs_bloom = 8; // The logs bloom filter for this block + string miner = 9; // The address of the miner who mined this block + string nonce = 10; // The nonce of this block + string parent_hash = 11; // The hash of the parent block + string receipts_root = 12; // The root hash of the receipts trie + string sha3_uncles = 13; // The SHA3 hash of the uncles data in this block + uint64 size = 14; // The size of this block + string state_root = 15; // The root hash of the state trie + uint64 timestamp = 16; + string total_difficulty = 17; // The total difficulty of the chain until this block + string transactions_root = 18; // The root hash of the transactions trie + uint64 indexed_at = 19; // When the block was indexed by crawler + repeated Game7Transaction transactions = 20; // The transactions included in this block + + string mix_hash = 21; // The timestamp of this block + string send_count = 22; // The number of sends in this block + string send_root = 23; // The root hash of the sends trie + uint64 l1_block_number = 24; // The block number of the corresponding L1 block +} + +message Game7EventLog { + string address = 1; // The address of the contract that generated the log + repeated string topics = 2; // Topics are indexed parameters during log generation + string data = 3; // The data field from the log + uint64 block_number = 4; // The block number where this log was in + string transaction_hash = 5; // The hash of the transaction that generated this log + string block_hash = 6; // The hash of the block where this log was in + bool removed = 7; // True if the log was reverted due to a chain reorganization + uint64 log_index = 8; // The index of the log in the block + uint64 transaction_index = 9; // The index of the transaction in the block +} + +message Game7BlocksBatch { + repeated Game7Block blocks = 1; + + string seer_version = 2; +} diff --git a/blockchain/handlers.go b/blockchain/handlers.go index 2ec0c33..5b981f1 100644 --- a/blockchain/handlers.go +++ b/blockchain/handlers.go @@ -16,6 +16,7 @@ import ( "github.com/G7DAO/seer/blockchain/b3_sepolia" seer_common "github.com/G7DAO/seer/blockchain/common" "github.com/G7DAO/seer/blockchain/ethereum" + "github.com/G7DAO/seer/blockchain/game7" "github.com/G7DAO/seer/blockchain/game7_orbit_arbitrum_sepolia" "github.com/G7DAO/seer/blockchain/game7_testnet" "github.com/G7DAO/seer/blockchain/imx_zkevm" @@ -48,6 +49,9 @@ func NewClient(chain, url string, timeout int) (BlockchainClient, error) { } else if chain == "arbitrum_sepolia" { client, err := arbitrum_sepolia.NewClient(url, timeout) return client, err + } else if chain == "game7" { + client, err := game7.NewClient(url, timeout) + return client, err } else if chain == "game7_orbit_arbitrum_sepolia" { client, err := game7_orbit_arbitrum_sepolia.NewClient(url, timeout) return client, err diff --git a/blockchain/settings.go b/blockchain/settings.go index 55aae1c..87da135 100644 --- a/blockchain/settings.go +++ b/blockchain/settings.go @@ -57,6 +57,12 @@ func CheckVariablesForBlockchains() error { if MOONSTREAM_NODE_IMX_ZKEVM_SEPOLIA_A_EXTERNAL_URI == "" { return fmt.Errorf("MOONSTREAM_NODE_IMX_ZKEVM_SEPOLIA_A_EXTERNAL_URI environment variable is required") } + + MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI := os.Getenv("MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI") + if MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI == "" { + return fmt.Errorf("MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI environment variable is required") + } + MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI := os.Getenv("MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI") if MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI == "" { return fmt.Errorf("MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI environment variable is required") @@ -80,6 +86,7 @@ func CheckVariablesForBlockchains() error { "arbitrum_sepolia": MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI, "game7_orbit_arbitrum_sepolia": MOONSTREAM_NODE_GAME7_ORBIT_ARBITRUM_SEPOLIA_A_EXTERNAL_URI, "game7_testnet": MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI, + "game7": MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI, "xai": MOONSTREAM_NODE_XAI_A_EXTERNAL_URI, "xai_sepolia": MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI, "mantle": MOONSTREAM_NODE_MANTLE_A_EXTERNAL_URI, diff --git a/crawler/settings.go b/crawler/settings.go index cfad824..5844513 100644 --- a/crawler/settings.go +++ b/crawler/settings.go @@ -74,6 +74,12 @@ func CheckVariablesForCrawler() error { if MOONSTREAM_NODE_IMX_ZKEVM_SEPOLIA_A_EXTERNAL_URI == "" { return fmt.Errorf("MOONSTREAM_NODE_IMX_ZKEVM_SEPOLIA_A_EXTERNAL_URI environment variable is required") } + + MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI := os.Getenv("MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI") + if MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI == "" { + return fmt.Errorf("MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI environment variable is required") + } + MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI := os.Getenv("MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI") if MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI == "" { return fmt.Errorf("MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI environment variable is required") @@ -100,6 +106,7 @@ func CheckVariablesForCrawler() error { "arbitrum_sepolia": MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI, "game7_orbit_arbitrum_sepolia": MOONSTREAM_NODE_GAME7_ORBIT_ARBITRUM_SEPOLIA_A_EXTERNAL_URI, "game7_testnet": MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI, + "game7": MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI, "xai": MOONSTREAM_NODE_XAI_A_EXTERNAL_URI, "xai_sepolia": MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI, "mantle": MOONSTREAM_NODE_MANTLE_A_EXTERNAL_URI, diff --git a/prepare_blockchains.sh b/prepare_blockchains.sh index 40a8881..26c521e 100755 --- a/prepare_blockchains.sh +++ b/prepare_blockchains.sh @@ -21,3 +21,5 @@ for BLOCKCHAIN in $BLOCKCHAIN_NAMES_RAW; do fi fi done + +go fmt ./... diff --git a/sample.env b/sample.env index 85302c7..59c25d3 100644 --- a/sample.env +++ b/sample.env @@ -7,6 +7,7 @@ export MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI="https:// Date: Mon, 11 Nov 2024 21:42:19 +0200 Subject: [PATCH 2/5] Add working version. --- blockchain/game7/game7.go | 1 + indexer/db.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/blockchain/game7/game7.go b/blockchain/game7/game7.go index 394512c..86d4b52 100644 --- a/blockchain/game7/game7.go +++ b/blockchain/game7/game7.go @@ -501,6 +501,7 @@ func ToEntireBlocksBatchFromLogProto(obj *Game7BlocksBatch) *seer_common.BlocksB } func ToProtoSingleBlock(obj *seer_common.BlockJson) *Game7Block { + return &Game7Block{ BlockNumber: fromHex(obj.BlockNumber).Uint64(), Difficulty: fromHex(obj.Difficulty).Uint64(), diff --git a/indexer/db.go b/indexer/db.go index ed91f44..a9ea110 100644 --- a/indexer/db.go +++ b/indexer/db.go @@ -66,6 +66,8 @@ func IsBlockchainWithL1Chain(blockchain string) bool { return true case "game7_testnet": return true + case "game7": + return true case "xai": return true case "xai_sepolia": From 5aa0f2fea504330180ce378cc964eece7d6d60a7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 11 Nov 2024 21:44:01 +0200 Subject: [PATCH 3/5] Bump version. --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 6588084..2c0bf07 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,3 @@ package version -var SeerVersion string = "0.3.9" +var SeerVersion string = "0.3.10" From 83f39549555ac2e4086449c7ce1c06a311b2e4af Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 12 Nov 2024 13:30:06 +0200 Subject: [PATCH 4/5] Add deploy scripts. --- deploy/deploy.bash | 7 +++++++ deploy/seer-crawler-game7.service | 16 ++++++++++++++++ .../seer-historical-synchronizer-game7.service | 16 ++++++++++++++++ deploy/seer-historical-synchronizer-game7.timer | 9 +++++++++ deploy/seer-synchronizer-game7.service | 16 ++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 deploy/seer-crawler-game7.service create mode 100644 deploy/seer-historical-synchronizer-game7.service create mode 100644 deploy/seer-historical-synchronizer-game7.timer create mode 100644 deploy/seer-synchronizer-game7.service diff --git a/deploy/deploy.bash b/deploy/deploy.bash index b47d0d7..84575ad 100755 --- a/deploy/deploy.bash +++ b/deploy/deploy.bash @@ -26,6 +26,7 @@ USER_SYSTEMD_DIR="${USER_SYSTEMD_DIR:-/home/ubuntu/.config/systemd/user}" SEER_CRAWLER_ARBITRUM_ONE_SERVICE_FILE="seer-crawler-arbitrum-one.service" SEER_CRAWLER_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-crawler-arbitrum-sepolia.service" SEER_CRAWLER_ETHEREUM_SERVICE_FILE="seer-crawler-ethereum.service" +SEEER_CRAWLER_GAME7_SERVICE_FILE="seer-crawler-game7.service" SEER_CRAWLER_GAME7_TESTNET_SERVICE_FILE="seer-crawler-game7-testnet.service" SEER_CRAWLER_MANTLE_SEPOLIA_SERVICE_FILE="seer-crawler-mantle-sepolia.service" SEER_CRAWLER_MANTLE_SERVICE_FILE="seer-crawler-mantle.service" @@ -43,6 +44,7 @@ SEER_SYNCHRONIZER_ETHEREUM_SERVICE_FILE="seer-synchronizer-ethereum.service" SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE="seer-synchronizer-polygon.service" SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE="seer-synchronizer-arbitrum-one.service" SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-synchronizer-arbitrum-sepolia.service" +SEER_SYNCHRONIZER_GAME7_SERVICE_FILE="seer-synchronizer-game7.service" SEER_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE="seer-synchronizer-game7-testnet.service" SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE="seer-synchronizer-mantle-sepolia.service" SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE="seer-synchronizer-mantle.service" @@ -63,6 +65,8 @@ SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE="seer-historical-synchron SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_ONE_TIMER_FILE="seer-historical-synchronizer-arbitrum-one.timer" SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-historical-synchronizer-arbitrum-sepolia.service" SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_SEPOLIA_TIMER_FILE="seer-historical-synchronizer-arbitrum-sepolia.timer" +SEER_HISTORICAL_SYNCHRONIZER_GAME7_SERVICE_FILE="seer-historical-synchronizer-game7.service" +SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE="seer-historical-synchronizer-game7.timer" SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE="seer-historical-synchronizer-game7-testnet.service" SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE="seer-historical-synchronizer-game7-testnet.timer" SEER_HISTORICAL_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE="seer-historical-synchronizer-mantle-sepolia.service" @@ -118,6 +122,9 @@ echo "MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI=${MOONSTREAM_NODE_ARBITRUM_ONE MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI=$(gcloud secrets versions access latest --secret=MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI) echo "MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI=${MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI}" >> "${PARAMETERS_ENV_PATH}" +MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI=$(gcloud secrets versions access latest --secret=MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI) +echo "MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI=${MOONSTREAM_NODE_GAME7_A_EXTERNAL_URI}" >> "${PARAMETERS_ENV_PATH}" + MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI=$(gcloud secrets versions access latest --secret=MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI) echo "MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI=${MOONSTREAM_NODE_GAME7_TESTNET_A_EXTERNAL_URI}" >> "${PARAMETERS_ENV_PATH}" diff --git a/deploy/seer-crawler-game7.service b/deploy/seer-crawler-game7.service new file mode 100644 index 0000000..c4a7fd9 --- /dev/null +++ b/deploy/seer-crawler-game7.service @@ -0,0 +1,16 @@ +[Unit] +Description=Seer crawler service for Game7 blockchain +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/seer +EnvironmentFile=/home/ubuntu/seer-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/seer/seer crawler --chain game7 --confirmations 0 --threads 2 --proto-time-limit 1 --retry-wait 1000 --retry-multiplier 1 --batch-size 0 +SyslogIdentifier=seer-crawler-game7 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/seer-historical-synchronizer-game7.service b/deploy/seer-historical-synchronizer-game7.service new file mode 100644 index 0000000..be2cb44 --- /dev/null +++ b/deploy/seer-historical-synchronizer-game7.service @@ -0,0 +1,16 @@ +[Unit] +Description=Seer historical synchronizer service for game7 blockchain +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/seer +EnvironmentFile=/home/ubuntu/seer-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/seer/seer historical-sync --auto --chain game7 +SyslogIdentifier=seer-historical-synchronizer-game7 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/seer-historical-synchronizer-game7.timer b/deploy/seer-historical-synchronizer-game7.timer new file mode 100644 index 0000000..20bbd73 --- /dev/null +++ b/deploy/seer-historical-synchronizer-game7.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs seer historical synchronizer on game7 + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/deploy/seer-synchronizer-game7.service b/deploy/seer-synchronizer-game7.service new file mode 100644 index 0000000..10b3afb --- /dev/null +++ b/deploy/seer-synchronizer-game7.service @@ -0,0 +1,16 @@ +[Unit] +Description=Seer synchronizer service for game7 blockchain +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/seer +EnvironmentFile=/home/ubuntu/seer-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/seer/seer synchronizer --chain game7 --cycle-ticker-wait-time 1 +SyslogIdentifier=seer-synchronizer-game7 + +[Install] +WantedBy=multi-user.target From 6beeca1ea1e5f48f7977da537a2c48dbaa3c2196 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 12 Nov 2024 13:38:57 +0200 Subject: [PATCH 5/5] Add deploy scripts. --- deploy/deploy.bash | 34 ++++++++++++++++++------- deploy/monitoring-seer-crawlers.service | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/deploy/deploy.bash b/deploy/deploy.bash index 84575ad..18ac488 100755 --- a/deploy/deploy.bash +++ b/deploy/deploy.bash @@ -272,6 +272,14 @@ cp "${SCRIPT_DIR}/${SEER_CRAWLER_IMX_ZKEVM_SEPOLIA_SERVICE_FILE}" "${USER_SYSTEM XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_CRAWLER_IMX_ZKEVM_SEPOLIA_SERVICE_FILE}" +echo +echo +echo -e "${PREFIX_INFO} Replacing existing seer crawler for Game7 blockchain service definition with ${SEEER_CRAWLER_GAME7_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${SEEER_CRAWLER_GAME7_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${SEEER_CRAWLER_GAME7_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEEER_CRAWLER_GAME7_SERVICE_FILE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEEER_CRAWLER_GAME7_SERVICE_FILE}" + echo echo echo -e "${PREFIX_INFO} Replacing existing seer crawler for Game7 Testnet blockchain service definition with ${SEER_CRAWLER_GAME7_TESTNET_SERVICE_FILE}" @@ -388,6 +396,14 @@ cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_IMX_ZKEVM_SEPOLIA_SERVICE_FILE}" "${USER_S XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_IMX_ZKEVM_SEPOLIA_SERVICE_FILE}" +echo +echo +echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Game7 blockchain service definition with ${SEER_SYNCHRONIZER_GAME7_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_GAME7_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_GAME7_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_GAME7_SERVICE_FILE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_GAME7_SERVICE_FILE}" + echo echo echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Game7 Testnet blockchain service definition with ${SEER_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}" @@ -451,6 +467,15 @@ cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_SEPOLIA_TIMER_FILE}" " XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_HISTORICAL_SYNCHRONIZER_ARBITRUM_SEPOLIA_TIMER_FILE}" +echo +echo +echo -e "${PREFIX_INFO} Replacing existing seer historical synchronizer for Game7 blockchain service and timer with: ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_SERVICE_FILE}, ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_SERVICE_FILE}" "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE}" +cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE}" "${USER_SYSTEMD_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TIMER_FILE}" + echo echo echo -e "${PREFIX_INFO} Replacing existing seer historical synchronizer for Game7 Testnet blockchain service and timer with: ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}, ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" @@ -523,15 +548,6 @@ cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_IMX_ZKEVM_SEPOLIA_TIMER_FILE}" XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_HISTORICAL_SYNCHRONIZER_IMX_ZKEVM_SEPOLIA_TIMER_FILE}" -echo -echo -echo -e "${PREFIX_INFO} Replacing existing seer historical synchronizer for Game7 Testnet blockchain service and timer with: ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}, ${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" -chmod 644 "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}" "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" -cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_SERVICE_FILE}" -cp "${SCRIPT_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" "${USER_SYSTEMD_DIR}/${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" -XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload -XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_HISTORICAL_SYNCHRONIZER_GAME7_TESTNET_TIMER_FILE}" - echo echo echo -e "${PREFIX_INFO} Replacing existing seer historical synchronizer for B3 blockchain service and timer with: ${SEER_HISTORICAL_SYNCHRONIZER_B3_SERVICE_FILE}, ${SEER_HISTORICAL_SYNCHRONIZER_B3_TIMER_FILE}" diff --git a/deploy/monitoring-seer-crawlers.service b/deploy/monitoring-seer-crawlers.service index 9623ff7..44e29e8 100644 --- a/deploy/monitoring-seer-crawlers.service +++ b/deploy/monitoring-seer-crawlers.service @@ -9,7 +9,7 @@ Restart=on-failure RestartSec=15s WorkingDirectory=/home/ubuntu/ EnvironmentFile=/home/ubuntu/seer-secrets/monitoring.env -ExecStart=/home/ubuntu/monitoring -plugin systemd -host "127.0.0.1" -port 7171 -healthcheck -server -threshold 3 -config /home/ubuntu/.monitoring/monitoring-seer-crawlers-config.json -service seer-crawler-arbitrum-one.service -service seer-crawler-arbitrum-sepolia.service -service seer-crawler-ethereum.service -service seer-crawler-imx-zkevm-sepolia.service -service seer-crawler-imx-zkevm.service -service seer-crawler-mantle-sepolia.service -service seer-crawler-mantle.service -service seer-crawler-polygon.service -service seer-crawler-sepolia.service -service seer-crawler-xai-sepolia.service -service seer-crawler-xai.service -service seer-synchronizer-arbitrum-one.service -service seer-synchronizer-arbitrum-sepolia.service -service seer-synchronizer-ethereum.service -service seer-synchronizer-imx-zkevm-sepolia.service -service seer-synchronizer-imx-zkevm.service -service seer-synchronizer-mantle-sepolia.service -service seer-synchronizer-mantle.service -service seer-synchronizer-polygon.service -service seer-synchronizer-sepolia.service -service seer-synchronizer-xai-sepolia.service -service seer-synchronizer-xai.service -service seer-crawler-game7-testnet.service -service seer-synchronizer-game7-testnet.service -service seer-crawler-b3.service -service seer-synchronizer-b3.service -service seer-crawler-b3-sepolia.service -service seer-synchronizer-b3-sepolia.service +ExecStart=/home/ubuntu/monitoring -plugin systemd -host "127.0.0.1" -port 7171 -healthcheck -server -threshold 3 -config /home/ubuntu/.monitoring/monitoring-seer-crawlers-config.json -service seer-crawler-arbitrum-one.service -service seer-crawler-arbitrum-sepolia.service -service seer-crawler-ethereum.service -service seer-crawler-imx-zkevm-sepolia.service -service seer-crawler-imx-zkevm.service -service seer-crawler-mantle-sepolia.service -service seer-crawler-mantle.service -service seer-crawler-polygon.service -service seer-crawler-sepolia.service -service seer-crawler-xai-sepolia.service -service seer-crawler-xai.service -service seer-synchronizer-arbitrum-one.service -service seer-synchronizer-arbitrum-sepolia.service -service seer-synchronizer-ethereum.service -service seer-synchronizer-imx-zkevm-sepolia.service -service seer-synchronizer-imx-zkevm.service -service seer-synchronizer-mantle-sepolia.service -service seer-synchronizer-mantle.service -service seer-synchronizer-polygon.service -service seer-synchronizer-sepolia.service -service seer-synchronizer-xai-sepolia.service -service seer-synchronizer-xai.service -service seer-crawler-game7-testnet.service -service seer-synchronizer-game7-testnet.service -service seer-crawler-b3.service -service seer-synchronizer-b3.service -service seer-crawler-b3-sepolia.service -service seer-synchronizer-b3-sepolia.service -service seer-crawler-game7.service -service seer-synchronizer-game7.service CPUWeight=90 SyslogIdentifier=monitoring-seer-crawlers