Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage #2

Open
taylorgag opened this issue Jun 6, 2022 · 4 comments
Open

usage #2

taylorgag opened this issue Jun 6, 2022 · 4 comments

Comments

@taylorgag
Copy link

Sorry to bother you, given the address of a smart contract, can I know the number of transactions it receives, how to use it, and what commands

@cpurta
Copy link
Owner

cpurta commented Jun 6, 2022

Hey @taylorgag this is a pretty old repo and really should be archived as I do not intend to maintain it. But it should be able to give you the number of transactions it received. You can build the binary using the instructions in the README. But if you are using a version of go that is using go mod you will need to run the following commands in the project root:

$ go mod init
$ go mod tidy

Then you can build the binary:

$ go build -o ./bin/eth-scanner ./cmd/eth-scanner

You can then get some info on how to run the program using the --help and similarly with the start command:

$ ./bin/eth-scanner --help
NAME:
   eth-scanner - Scan blocks on the Ethereum block chain and filter transactions

USAGE:
    [global options] command [command options] [arguments...]

VERSION:
   0.0.1

COMMANDS:
   start    Scan all blocks on the ethereum block chain for all transactions using a specific address
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

start help:

$ ./bin/eth-scanner start --help
NAME:
    start - Scan all blocks on the ethereum block chain for all transactions using a specific address

USAGE:
    start [command options] [arguments...]

OPTIONS:
   --ethereum-host value   host endpoint of the ethereum node (default: "http://localhost:8545") [$ETHEREUM_HOST]
   --block-workers value   number of routines that will pull block information (default: 1) [$BLOCK_WORKERS]
   --start-block value     block number of the first block to begin scanning (default: 1) [$START_BLOCK]
   --end-block value       block number of the first block to begin scanning (default: 6000000) [$END_BLOCK]
   --filter-address value  filters all transactions to those only containing the specified address [$FILTER_ADDRESS]

@taylorgag
Copy link
Author

Hey @taylorgag this is a pretty old repo and really should be archived as I do not intend to maintain it. But it should be able to give you the number of transactions it received. You can build the binary using the instructions in the README. But if you are using a version of go that is using go mod you will need to run the following commands in the project root:

$ go mod init
$ go mod tidy

Then you can build the binary:

$ go build -o ./bin/eth-scanner ./cmd/eth-scanner

You can then get some info on how to run the program using the --help and similarly with the start command:

$ ./bin/eth-scanner --help
NAME:
   eth-scanner - Scan blocks on the Ethereum block chain and filter transactions

USAGE:
    [global options] command [command options] [arguments...]

VERSION:
   0.0.1

COMMANDS:
   start    Scan all blocks on the ethereum block chain for all transactions using a specific address
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

start help:

$ ./bin/eth-scanner start --help
NAME:
    start - Scan all blocks on the ethereum block chain for all transactions using a specific address

USAGE:
    start [command options] [arguments...]

OPTIONS:
   --ethereum-host value   host endpoint of the ethereum node (default: "http://localhost:8545") [$ETHEREUM_HOST]
   --block-workers value   number of routines that will pull block information (default: 1) [$BLOCK_WORKERS]
   --start-block value     block number of the first block to begin scanning (default: 1) [$START_BLOCK]
   --end-block value       block number of the first block to begin scanning (default: 6000000) [$END_BLOCK]
   --filter-address value  filters all transactions to those only containing the specified address [$FILTER_ADDRESS]

Thanks for your replay. In fact, I want to know the number of transactions received by many addresses(like https://etherscan.io/address/0x69fac1dbf56d983c265528d594f48fdce59ed665) on https://etherscan.io/. Can I achieve this goal by using eth-scanner?
when I use the command $ ./bin/eth-scanner start --filter-address 0x69fac1dbf56d983c265528d594f48fdce59ed665, it runs very fast, but it doesn't output any results. I would be happy and honored if you could give me some advice.

@taylorgag
Copy link
Author

when I use the command ./bin/eth-scanner start --ethereum-host https://etherscan.io/address/ --filter-address 0x69fac1dbf56d983c265528d594f48fdce59ed665 , it outputs the following:
2022/06/07 19:12:45 Starting scanner for blocks 1 - 6000000
2022/06/07 19:12:45 starting block workers manager...
2022/06/07 19:12:45 starting transaction worker...
2022/06/07 19:12:45 starting to log all transactions...
2022/06/07 19:12:45 Block worker starting to pull block info for blocks 1 - 6000000
2022/06/07 19:12:45 starting scanner reporter...
2022/06/07 19:12:45 Current block progress: 0 / 5999999 (0.0000%)
2022/06/07 19:12:45 Error making request to rpc node
2022/06/07 19:12:45 Unable to retrieve block results for block 1 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45344->104.22.14.57:443: read: connection reset by peer
2022/06/07 19:12:45 Error making request to rpc node
2022/06/07 19:12:45 Unable to retrieve block results for block 2 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41282->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:46 Error making request to rpc node
2022/06/07 19:12:46 Unable to retrieve block results for block 3 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41284->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:46 Error making request to rpc node
2022/06/07 19:12:46 Unable to retrieve block results for block 4 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41286->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:46 Error making request to rpc node
2022/06/07 19:12:46 Unable to retrieve block results for block 5 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41288->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:46 Error making request to rpc node
2022/06/07 19:12:46 Unable to retrieve block results for block 6 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41290->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:46 Error making request to rpc node
2022/06/07 19:12:46 Unable to retrieve block results for block 7 : Post https://etherscan.io/address/: read tcp 192.168.206.143:41292->172.67.8.107:443: read: connection reset by peer
2022/06/07 19:12:57 Error making request to rpc node
2022/06/07 19:12:57 Unable to retrieve block results for block 8 : Post https://etherscan.io/address/: net/http: TLS handshake timeout
2022/06/07 19:12:58 Error making request to rpc node
2022/06/07 19:12:58 Unable to retrieve block results for block 9 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45360->104.22.14.57:443: read: connection reset by peer
2022/06/07 19:12:58 Error making request to rpc node
2022/06/07 19:12:58 Unable to retrieve block results for block 10 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45078->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:12:59 Error making request to rpc node
2022/06/07 19:12:59 Unable to retrieve block results for block 11 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45080->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:12:59 Error making request to rpc node
2022/06/07 19:12:59 Unable to retrieve block results for block 12 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45082->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:12:59 Error making request to rpc node
2022/06/07 19:12:59 Unable to retrieve block results for block 13 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45084->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:12:59 Error making request to rpc node
2022/06/07 19:12:59 Unable to retrieve block results for block 14 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45086->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:12:59 Error making request to rpc node
2022/06/07 19:12:59 Unable to retrieve block results for block 15 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45088->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:00 Error making request to rpc node
2022/06/07 19:13:00 Unable to retrieve block results for block 16 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45090->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:00 Error making request to rpc node
2022/06/07 19:13:00 Unable to retrieve block results for block 17 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45092->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:00 Error making request to rpc node
2022/06/07 19:13:00 Unable to retrieve block results for block 18 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45094->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:00 Error making request to rpc node
2022/06/07 19:13:00 Unable to retrieve block results for block 19 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45096->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:01 Error making request to rpc node
2022/06/07 19:13:01 Unable to retrieve block results for block 20 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45098->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:01 Error making request to rpc node
2022/06/07 19:13:01 Unable to retrieve block results for block 21 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45100->104.22.15.57:443: read: connection reset by peer
2022/06/07 19:13:01 Error making request to rpc node
2022/06/07 19:13:01 Unable to retrieve block results for block 22 : Post https://etherscan.io/address/: read tcp 192.168.206.143:45102->104.22.15.57:443: read: connection reset by peer

@cpurta
Copy link
Owner

cpurta commented Jun 7, 2022

Looks like there is a networking issue that is causing the error to be thrown. Also, you will want to use an Ethereum node address and not the etherscan.io/address endpoint. If you have your own eth node running point it to that, if not you can easily set up an account with infura and point it to your project's API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants