Skip to content

Commit

Permalink
added targets and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinssgh committed Mar 14, 2024
1 parent 331ab63 commit cf7a4aa
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,14 @@ mainnet-bitcoind-node:
cd contrib/mainnet/bitcoind && DOCKER_TAG=$(DOCKER_TAG) docker-compose up

athens3-zetarpc-node:
cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up
cd contrib/athens3/zetacored && DOCKER_TAG=$(DOCKER_TAG) docker-compose up

###############################################################################
### Debug Tools ###
###############################################################################

filter-missed-btc: install-zetatool
./tool/filter_missed_deposits/filter_missed_btc.sh

filter-missed-eth: install-zetatool
./tool/filter_missed_deposits/filter_missed_eth.sh
2 changes: 1 addition & 1 deletion cmd/zetatool/filterdeposit/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
)

var evmCmd = &cobra.Command{
Use: "evm",
Use: "eth",
Short: "Filter inbound eth deposits",
Run: FilterEVMTransactions,
}
Expand Down
1 change: 1 addition & 0 deletions cmd/zetatool/filterdeposit/filterdeposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func CheckForCCTX(list []Deposit, cfg *config.Config) []Deposit {
}
}

fmt.Printf("Found %d missed transactions.\n", len(missedList))
for _, entry := range missedList {
fmt.Printf("%s, amount: %d\n", entry.TxID, entry.Amount)
}
Expand Down
24 changes: 24 additions & 0 deletions docs/cli/zetatool/filterdeposit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# filterdeposit

Filter missing inbound deposits

### Synopsis

Filters relevant inbound transactions for a given network and attempts to find an associated cctx from the core. If a
cctx is not found, the associated transaction hash and amount is added to a list and displayed.

```
zetatool filterdeposit [command]
```
### Options

```
Available Commands:
btc Filter inbound btc deposits
eth Filter inbound eth deposits
```

### Options inherited from parent commands
```
--config string custom config file: --config filename.json
```
63 changes: 63 additions & 0 deletions docs/cli/zetatool/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Zeta Tool

Currently, has only one subcommand which finds inbound transactions or deposits that weren't observed on a particular
network. `filterdeposit`

## Configuring

#### RPC endpoints
Configuring the tool for specific networks will require different reliable endpoints. For example, if you wanted to
configure an ethereum rpc endpoint, then you will have to find an evm rpc endpoint for eth mainnet and set the field:
`EthRPC`

#### Zeta URL
You will need to find an enpoint for zetachain and set the field: `ZetaURL`

#### TSS Addresses
Depending on which network you are using, you will have to populate the tss addresses for both EVM and BTC using these
fields: `TssAddressBTC`, `TssAddressEVM`

#### Contract Addresses
Depending on the network, connector and custody contract addresses must be set using these fields: `ConnectorAddress`,
`CustodyAddress`

#### EVM Block Ranges
When filtering evm transactions, a range of blocks is required and to reduce runtime of the command, a suitable range
must be selected and set in these fields: `EvmStartBlock`, `EvmMaxRange`

If a configuration file is not provided, a default config will be generated under the name
`InboundTxFilter_config.json`. Below is an example of a configuration file used for mainnet:

```json
{
"ZetaURL": "http://46.4.15.110:1317",
"TssAddressBTC": "bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y",
"TssAddressEVM": "0x70e967acfcc17c3941e87562161406d41676fd83",
"BtcExplorer": "https://blockstream.info/api/address/bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y/txs",
"EthRPC": "https://ethereum-rpc.publicnode.com",
"ConnectorAddress": "0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a",
"CustodyAddress": "0x0000030Ec64DF25301d8414eE5a29588C4B0dE10",
"EvmStartBlock": 19200110,
"EvmMaxRange": 1000
}
```

## Running Tool

There are two targets available:

```
filter-missed-btc: install-zetatool
./tool/filter_missed_deposits/filter_missed_btc.sh
filter-missed-eth: install-zetatool
./tool/filter_missed_deposits/filter_missed_eth.sh
```

Running the commands can be simply done through the makefile in the node repo:

```
make filter-missed-btc
or ...
make filter-missed-eth
```
11 changes: 11 additions & 0 deletions tool/filter_missed_deposits/InboundTxFilter_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"ZetaURL": "http://46.4.15.110:1317",
"TssAddressBTC": "bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y",
"TssAddressEVM": "0x70e967acfcc17c3941e87562161406d41676fd83",
"BtcExplorer": "https://blockstream.info/api/address/bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y/txs",
"EthRPC": "https://ethereum-rpc.publicnode.com",
"ConnectorAddress": "0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a",
"CustodyAddress": "0x0000030Ec64DF25301d8414eE5a29588C4B0dE10",
"EvmStartBlock": 19200110,
"EvmMaxRange": 1000
}
3 changes: 3 additions & 0 deletions tool/filter_missed_deposits/filter_missed_btc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

zetatool filterdeposit btc --config ./tool/filter_missed_deposits/InboundTxFilter_config.json
3 changes: 3 additions & 0 deletions tool/filter_missed_deposits/filter_missed_eth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

zetatool filterdeposit eth --config ./tool/filter_missed_deposits/InboundTxFilter_config.json

0 comments on commit cf7a4aa

Please sign in to comment.