{"_id":"@cactus1549/cactus-tbw","name":"@cactus1549/cactus-tbw","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@cactus1549/cactus-tbw","description":"TBW for Solar Core","homepage":"https://github.com/Cactus-15-49/cactus-tbw","version":"0.0.1","contributors":[{"name":"alessiodf","email":"alessiodf@pm.me"},{"name":"cactus1549","email":"cactus1549pool@gmail.com"}],"license":"CC-BY-ND-4.0","main":"dist/index.js","scripts":{"build":"pnpm clean && tsc","build:watch":"pnpm clean && pnpm compile -w","clean":"rimraf dist","compile":"node ../../node_modules/typescript/bin/tsc","lint":"../../node_modules/eslint/bin/eslint.js . --ext .ts --fix","prettier":"prettier --write './**/*.{ts,js,json,md}'"},"dependencies":{"@hapi/boom":"^9.1.4","@hapi/hapi":"^20.1.5","better-sqlite3":"7.6.2","delay":"5.0.0","joi":"17.6.0"},"devDependencies":{"@solar-network/core":"workspace:*","@solar-network/kernel":"workspace:*","@solar-network/crypto":"workspace:*","@solar-network/database":"workspace:*","@solar-network/cli":"workspace:*"},"types":"./dist/index.d.ts","gitHead":"68f81f557a663d37fc0e76829611802741695605","_id":"@cactus1549/cactus-tbw@0.0.1","_nodeVersion":"18.8.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-JTShd55jjirUpgKvWUYEk6bgVaV66XK9EnhQx1VxK2h6PGyYr1uBLYX8+Nq3Cw525BPYnv0hhYLMLKgjVLjPgA==","shasum":"03eca6ddf8cce2c7c5f497a60209803933f2cd5e","tarball":"https://registry.npmjs.org/@cactus1549/cactus-tbw/-/cactus-tbw-0.0.1.tgz","fileCount":40,"unpackedSize":158918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNf5r/QSGw1VbAUu8y5kuj9esGGQphsqa3IkvrI8LGrAiEAvvhz75SKwS4MnWgahXHngy7kTl8hOzWbNqbn+TYUv/E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjDJUqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqLzg//UtOqAlY3vT+QMdQAWtKmCQXjGnfkMv8x6hCWNe4ly1r2UewE\r\nIss+KzjGz7xp+EWAfQMx3cuvWO6I7o2pmAKFoHSEYmrjFr0HoXLgaKCAqvo1\r\ny0Nad/1EOkqHt7LwKMzGUzHitnExA29WtfQWSj8Vof5Zb0fZ4LYXzRa31aRS\r\nY2lVrcsLf1jFifxmmYU9DHmwOMe1/6vU5s52V1cgGerbek/I0nJ3LBOcrtC3\r\ntwOmD/yDt+q0PpTkHWzIXe1bvqZKPQCR97ludT45sKIcrXXUXGv1L8noGGBG\r\nOBYHyJnFwSr6D0ER5VNhKtFP2dCyXw/KFBmgfJ6J0pFhIM5CA0+V8VXbq3EL\r\najN/zrK2Aw7XYrChcURyt+bqJizUEmfC6q5Mpc9oSfBA3dNbGuKEwIVsu5Jm\r\nS5HFE2araKd6xlPub1vTP0njIaFNK7O7VCQT3sNh0wXPcr6mBiFjnRL9hH6w\r\nVOF2C/Z8l4R7TEICmwQ9FkmS7jJBQzrkq9qyXJrXzsTGQ3hCzSMtqhgW92ex\r\nC7tmvvan3w/TWwhrFaHPKGC9Z+yKG3fYfJiEcAizikuJnok6JUP72DBH6l5w\r\ndS8mGkzyAt/mSUJVcPGOTRcD+Yk6EhR+Smi1rOCR9UDqfSLTu43jGsH9zdsK\r\n71DKT47rdbbMxd1Zsg5NSGImEFlbP16ltPs=\r\n=LSl/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cactus1549","email":"cactus1549pool@gmail.com"},"directories":{},"maintainers":[{"name":"cactus1549","email":"cactus1549pool@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cactus-tbw_0.0.1_1661769002727_0.4382683793780282"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-29T10:30:02.668Z","0.0.1":"2022-08-29T10:30:02.941Z","modified":"2022-08-29T10:30:03.062Z"},"maintainers":[{"name":"cactus1549","email":"cactus1549pool@gmail.com"}],"description":"TBW for Solar Core","homepage":"https://github.com/Cactus-15-49/cactus-tbw","contributors":[{"name":"alessiodf","email":"alessiodf@pm.me"},{"name":"cactus1549","email":"cactus1549pool@gmail.com"}],"license":"CC-BY-ND-4.0","readme":"# Cactus TBW\n\n## How to install\nTo install the tbw just run: `solar plugin:install https://github.com/Cactus-15-49/cactus-tbw.git` .  \nOnce installed, run `solar tbw:enable` to enable TBW and run `solar tbw:configure` to configure the TBW.  \nOnce configured, restart core and you should see `Delegates configured for true block weight: [delegate name]`.  \nIf you want to set a starting height, you can run `solar tbw:database set_start [height]`. Please bear in mind that this command will temporarily stop core and do a rollback.  \nTo run the payout, just use `solar tbw:pay`. The run can be executed automatically by running the command through a cronjob.\n## Modes\n0. **Classic** : Classic mode is the standard mode of TBW. The rewards are based only on the weight of voters at the time of forging.\n1. **Every** : The rewards are calculated considering the weight of the voters on **all** blocks, including the one you are not forging. For this mode, fidelity will not consider the weight on the past blocks but only if the vote was cast or not.\n2. **Min** : The rewards are calculated based on the minimum weight every voter had during every round.\n3. **Last** : The rewards are calculated based on the weight every voter had on the last block of every round.\n\n## Config file\nThe config file is located in `$HOME/.local/share/solar-core/{NETWORK}/tbw/config.json`. The file can be edited manually or through CLI commands. The latter way is advised as an invalid configuration will cause the TBW to stop working.\n\n- **blacklist** : List of addresses you want to exclude from the payout. Their weight will not be considered during payout.\n- **routes** : Object with addresses as key and values called respectively source and destination used when you want to redirect a payout of an address (source) to another address (destination).\n- **whitelist** : List of addresses you want to exclusively pay. Any other address not in this array will not be included in the payout. Leave empty to disable whitelist.\n- **sharing** : The percentage of the rewards you want to share with voters. It's a number between 0 and 100.\n- **extraFee**: The percent to add on top of the minimal fee for payout transactions to avoid not being forged during congestions. It's a number between 0 and 100.\n- **max** : Cap for weight. Any weight exceeding the max cap will be ignored. `null` for none.\n- **min** : Min weight to be eligeble to receive rewards. `null` for none.\n- **memo** : Memo to include in the payout transactions. Empty string for none.\n- **payFees** : Either pay or keep rewards from transaction fees. It can be either y or n.\n- **reserve** : An object with addresses as keys and a percentage as values specifying what percentage of the delegate rewards go to which addresses. The sum of all percentages has to be 100.\n- **pp1** : First passphrases of the delegate.\n- **pp2** : Second passphrase of the delegate. `null` for none.\n- **fidelity** : Number of blocks required for an address to be voting before receiving rewards. Behaviour may vary depending on the mode.\n- **mode** : Mode of operation for calculating rewards. See [Modes](#modes).\n\n## CLI commands\n### `tbw:blacklist`\n- Show the current blacklist.\n- add [address] : Add a new address to the blacklist.\n- remove [address] : Remove an existing address from the blacklist.\n- disable: Empty and disable the blacklist.\n### `tbw:configure`\n- Configure TBW script. Any existing configuration will be overwritten.\n### `tbw:disable`\n- Disable the TBW plugin. Core must be restarted to completely disable.\n### `tbw:enable`\n- Enable the TBW plugin. Core must be restarted.\n### `tbw:extra_fee`\n- Show the current extra fee.\n- [value] : Set a new extra fee. `value` must be a number between 0 and 100.\n### `tbw:fidelity`\n- Show the current fidelity.\n- [value] : Set a new fidelity. `value` must be a number bigger than 0 or 0 for disabling.\n### `tbw:max`\n- Show the current max cap.\n- [value] : Set a new max cap. `value` must be a number bigger than 0 or 0 for disabling.\n### `tbw:memo`\n- Show the current memo.\n- [value] : Set a new memo. `value` must be a string.\n### `tbw:min`\n- Show the current min cap.\n- [value] : Set a new min cap. `value` must be a number bigger than 0 or 0 for disabling.\n### `tbw:mode`\n- Show the current mode.\n- [value] : Set a new mode. `value` must be either classic, every, min or last.\n### `tbw:passphrase`\n- Set the new passphrases (Changing the first passphrase will empty the block table of the TBW database). Use flags `pp1` or `pp2` to selectively change only one of the 2 passphrases.\n### `tbw:pay`\n- Run the payout.\n### `tbw:pay_fees`\n- Show the current payFees option.\n- [value] : Set a new payFees option. `value` must be either y or n.\n### `tbw:reserve`\n- Show the current reserve.\n- set [value] : Set a new reserve. `value` must be a correctly formatted string `addr1:80,addr2:20` where `addr` is the reserve address and the number is the percentage of the total reserve to send to that address. The sum of all percentages must be 100.\n### `tbw:routes`\n- Show the current routes.\n- add [source address] [destination address] : Add a new source/destination to routes.\n- remove [source address] : Remove an existing source from routes.\n- disable: Empty and disable routes.\n### `tbw:sharing`\n- Show the current sharing percentage.\n- [value] : Set a new sharing percentage. `value` must be a number between 0 and 100.\n### `tbw:unconfirmed`\n- Show all the currently unconfirmed transactions.\n- show [id]: Show details of one of the unconfirmed transactions \n- replay [id] : Replay one of the unconfimed transactions.\n### `tbw:whitelist`\n- Show the current whitelist.\n- add [address] : Add a new address to the whitelist.\n- remove [address] : Remove an existing address from the whitelist.\n- disable: Empty and disable the whitelist.\n","readmeFilename":"README.md"}