<commit_before>package daemon

import (
	"github.com/btcsuite/btcrpcclient"
	"log"
	"os/exec"
	"strconv"
	"time"
)

type bitcoindNode struct {
	index   int
	datadir string
	port    string
	rpcport string
	client  *btcrpcclient.Client
}

func (bn *bitcoindNode) Start() error {
	opts := append([]string{}, "-regtest", "-daemon",
		"-datadir="+bn.datadir, "-port="+bn.port,
		"-rpcport="+bn.rpcport, "-rpcuser=test", "-rpcpassword=<PASSWORD>",
	)

	if bn.index > 0 {
		opts = append(opts, "-connect=127.0.0.1:19000")
	}

	return exec.Command("bitcoind", opts...).Run()
}

func (bn *bitcoindNode) Stop() {
	bn.client.Shutdown()
	bn.Command("stop")
}

func (bn *bitcoindNode) Clean() {
	exec.Command("rm", "-r", bn.datadir).Run()
}

func (bn *bitcoindNode) Command(cmd ...string) error {
	args := append([]string{}, "-rpcport="+bn.rpcport, "-rpcuser=test", "-rpcpassword=<PASSWORD>")
	full := append(args, cmd...)
	return exec.Command("bitcoin-cli", full...).Run()
}<commit_msg>Enable zmq on port 28333<commit_after>package daemon

import (
	"github.com/btcsuite/btcrpcclient"
	"log"
	"os/exec"
	"strconv"
	"time"
)

type bitcoindNode struct {
	index   int
	datadir string
	port    string
	rpcport string
	client  *btcrpcclient.Client
}

func (bn *bitcoindNode) Start() error {
	//TODO
	zmqaddress := "127.0.0.1:28333"
	opts := append([]string{}, "-regtest", "-daemon",
		"-datadir="+bn.datadir, "-port="+bn.port,
		"-rpcport="+bn.rpcport, "-rpcuser=test", "-rpcpassword=<PASSWORD>",
	)

	if bn.index > 0 {
		opts = append(opts, "-connect=127.0.0.1:19000")
	} else {
		opts = append(opts,
			"-zmqpubhashtx=tcp://"+zmqaddress,
			"-zmqpubhashblock=tcp://"+zmqaddress,
			"-zmqpubrawblock=tcp://"+zmqaddress,
			"-zmqpubrawtx=tcp://"+zmqaddress,
		)
	}

	return exec.Command("bitcoind", opts...).Run()
}

func (bn *bitcoindNode) Stop() {
	bn.client.Shutdown()
	bn.Command("stop")
}

func (bn *bitcoindNode) Clean() {
	exec.Command("rm", "-r", bn.datadir).Run()
}

func (bn *bitcoindNode) Command(cmd ...string) error {
	args := append([]string{}, "-rpcport="+bn.rpcport, "-rpcuser=test", "-rpcpassword=<PASSWORD>")
	full := append(args, cmd...)
	return exec.Command("bitcoin-cli", full...).Run()
}
{'fraction_non_alphanumeric': 0.20894160583941607, 'fraction_numerical': 0.01824817518248175, 'mean_word_length': 4.2214285714285715, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1946067', 'n_tokens_mistral': 918, 'n_tokens_neox': 877, 'n_words': 162}