Skip to content

Commit

Permalink
Release v1.77.9
Browse files Browse the repository at this point in the history
  • Loading branch information
shanevc committed Oct 26, 2020
1 parent 27aca49 commit 34ad84b
Show file tree
Hide file tree
Showing 32 changed files with 1,213 additions and 176 deletions.
1 change: 1 addition & 0 deletions requirements-cli.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
aiohttp==3.6.2
websockets==8.1
pyhumps==1.6.1
web3==5.10.0
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ipaddress==1.0.22
cffi==1.12.2
csiphash==0.0.5
aiohttp==3.6.2
web3==5.10.0

# TODO: plan future work to remove this package
bloxroute-pyelliptic==1.5.10
83 changes: 83 additions & 0 deletions src/bloxroute_cli/README.compare-eth-on-block-feed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Compare On Block Feeds

compare_eth_on_block_feed.py is a script that compares the performance of the bloXroute ethOnBlock feed
offered by the bloXroute Gateway or Cloud API against custom implementation with an Ethereum node's feeds.

Example statistics output:

````
Started feed comparison. Duration: 600s
Start: 2020-10-11 18:02:03.410172, End: 2020-10-11 18:12:05.430070
Blocks seen in duration: 47
Number of blocks with results: 46
Number of results from Blxr first: 42
Number of results from Eth first: 4
Percentage of results seen first from gateway: 91.30%
Average time difference for results received first from Blxr (ms): 2067.04
Average time difference for results received first from Eth (ms): 1285.99
````

# Installing and setting up

Install bloxroute-cli with the following command:
````
pip install bloxroute-cli
````

To enable websocket RPC on your Gateway, use the following parameters:
```
--ws True --ws-host <IP address of client application> --ws-port 28333
```

Add the following parameter to have your Gateway connect to your Ethereum
node's websocket server:
```
--eth-ws-uri ws://<eth node IP address>:8546
```

To enable websocket RPC on your Ethereum node, use the following parameters:
```
--ws --wsaddr <gateway IP address> --wsapi eth --wsport 8546
```

Ensure you are running with Python 3.7 or later.

# Arguments

Example command:

```
python compare_eth_on_block_feed.py --gateway ws://127.0.0.1:28333 --eth ws://127.0.0.1:8546 --duration 600
```

Use `--gateway` to specify URL of the Gateway running with websocket RPC enabled.

Default: ws://127.0.0.1:28333

Use `--eth` to specify URL of an Ethereum node running with websocket RPC enabled.

Default: ws://127.0.0.1:8546

Use `--duration` to set the total duration of the test in seconds.

Default: 600

Use `--gateway-type` to indicate if you would like to use the bloXroute Cloud API websocket endpoint or
a local bloXroute Gateway endpoint. If set to Cloud, you must also use the --ssl-dir argument.

Options: Cloud, Local

Default: Cloud

Use `--ssl-dir` to specify the path to your bloXroute certificates if `--gateway-type` is Cloud.

Example: --ssl-dir /home/user/ssl/external_gateway/registration_only

Use `--call-params-file` to specify the EthCall commands source file to be executed by the subscription.
It is recommended to run with the `--debug` flag, in order to verify that the commands are valid.

Default: on_block_feed_call_params_example.json

Use the `--verbose` flag to print extra information.

Use the `--debug` flag to log debug information.
55 changes: 55 additions & 0 deletions src/bloxroute_cli/README.compare-tx-speed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Compare Transaction Speed

`compare_tx_speed.py` is a script that compares the performance of sending raw transactions with bloXroute Cloud-API and
other service providers -- Alchemy and Infura.

Example statistics output:
```
Initial check completed. Sleeping 30 sec.
Sending tx group 1.
2020-10-20 23:27:24.255892 - Sending transaction to https://mainnet.infura.io/v3/XXXXXXXXXX. TX Hash: XXXXXXXXXX
2020-10-20 23:27:24.257892 - Sending transaction to https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXX. TX Hash: XXXXXXXXXX
2020-10-20 23:27:24.258892 - Sending transaction to bloXroute Cloud-API. TX Hash: XXXXXXXXXX
Sleeping 30 sec.
Sending tx group 2.
2020-10-20 23:27:54.417183 - Sending transaction to https://mainnet.infura.io/v3/XXXXXXXXXX. TX Hash: XXXXXXXXXX
2020-10-20 23:27:54.418183 - Sending transaction to https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXX. TX Hash: XXXXXXXXXX
2020-10-20 23:27:54.419183 - Sending transaction to bloXroute Cloud-API. TX Hash: XXXXXXXXXX
Sleeping 1 min before checking transaction status.
---------------------------------------------------------------------------------------------------------
Summary:
Sent 2 groups of transactions to bloXroute Cloud-API and other providers, 2 of them have been confirmed:
Number of Alchemy transactions mined: 0
Number of Infura transactions mined: 0
Number of bloXrotue transactions mined: 2
```

# Installation
Install bloxroute-cli with the following command:
````
pip install bloxroute-cli
````

Example startup command:
```
python compare_tx_speed.py --alchemy-api-key XXXXXXXX --infura-api-key XXXXXXXXX --blxr-auth-header XXXXXXXXXX \
--sender-private-key 0xabcdXXXX --receiver-address 0xabcdXXXX --gas-price 33 --num-tx-groups 2
```

# Arguments
`--alchemy-api-key`: Alchemy API key. Please visit https://alchemyapi.io/ for more information.

`--infura-api-key`: Infura API key / project ID. Please visit https://infura.io/ for more information.

`--blxr-auth-header`: bloXroute authorization header. Use base64 encoded value of account_id:secret_hash for Cloud-API.
Please visit https://bloxroute.com/docs/bloxroute-documentation/cloud-api/overview/ for more information.

`--sender-private-key`: Private key of the Ethereum sender, which is required in order to sign transactions.

`--receiver-address`: Address of the transaction receiver.

`--gas-price`: Gas price (in Gwei) of the transactions.

`--num-tx-groups`: Number of groups of transactions to be sent. Default: 1.

`--delay`: Time (in sec) to sleep between two consecutive groups. Default: 30.
Loading

0 comments on commit 34ad84b

Please sign in to comment.