Skip to content

boecklim/node-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

380b265 · Feb 20, 2025
Dec 8, 2024
Jan 5, 2025
Dec 30, 2024
Jan 5, 2025
Jan 5, 2025
Dec 11, 2024
Dec 7, 2024
Dec 30, 2024
Jan 5, 2025
Jan 4, 2025
Dec 8, 2024
Jan 5, 2025
Dec 30, 2024
Dec 4, 2024
Dec 30, 2024
Dec 30, 2024
Dec 25, 2024

Repository files navigation

What is node analysis?

Node analysis is tool which allows to run simulated networks of BSV & BTC nodes with a broadcaster application that ingests transactions at a specified rate while logging the frequency and size of blocks generated by simulated mining.

How to run locally

For both BTC and BSV versions of the tool there exists a docker compose file. There are the following 2 make commands which just start 2 nodes of the respective blockchain

  • make run-btc-nodes
  • make run-bsv-nodes

In order to start the nodes together with the broadcaster application you can run one of the following make commands

  • make run-btc-nodes-with-broadcaster
  • make run-bsv-nodes-with-broadcaster

How to deploy to remote instances

Prepare terraform and Azure subscription

  1. Install Terraform
  2. Create an account & subscription on Azure

Both the infrastructure and the deployment of broadcaster can be done in one Go. The flags for the broadcaster application are parameterized and can be given together with the command which creates the infrastructure

For BTC:

terraform -chdir=infra destroy --auto-approve -var use_btc=true -var virtual_machines=5 -var broadcaster_version=v0.1.12 -var rate=50 -var limit=1h -var gen_block_time=10m -var start_time="2024-12-10T21:58:00+01:00"

For BSV:

terraform -chdir=infra destroy --auto-approve -var use_btc=false -var virtual_machines=5 -var broadcaster_version=v0.1.12 -var rate=50 -var limit=1h -var gen_block_time=10m -var start_time="2024-12-10T21:58:00+01:00"

Possibly the quota for Standard Av2 Family vCPUs and Total Regional vCPUs needs to be increased: https://portal.azure.com/#view/Microsoft_Azure_Capacity/QuotaMenuBlade/~/myQuotas

Connect to instances

In order to connect to any of the instances run the following script

./connect.sh <nr of instance starting with 0>

There is also a script which connects to 5 nodes (if 5 have been setup) each in a different tmux pane:

./tmux_session.sh

Run the node analysis application

Start broadcaster

Run the following command to see the meaning of each flag

./broadcaster -h

For BSV:

./broadcaster -rpc-port=18332 -zmq-port=28332 -blockchain=bsv -gen-blocks=15s -rate=10 -limit=2m -output=./results/bsv/output.log -start-at=2024-12-11T13:30:00+01:00

For BTC:

./broadcaster -rpc-port=18443 -zmq-port=29000 -blockchain=btc -gen-blocks=10s -rate=10 -limit=2m -output=./results/btc/output.log -start-at=2024-12-09T17:56:00+01:00