diff --git a/README.md b/README.md index 33aefbda57cc3b01b456d122f0342bda14f93b74..61d65d2321f17abf85b2fa4cb1251c1942b23e32 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ silkaj -ep <hostname>:<port>/<path> <sub-command> ## Wrappers -- [How-to: automate transactions and multi-output](https://silkaj.duniter.org/how-to_automate_transactions_and_multi-output/) +- [Multi-recipients transfers and automation](https://silkaj.duniter.org/multi-recipients_transfers_and_automation) - [Transaction generator written in Shell](https://gitlab.com/jytou/tgen) - [Ğ1Cotis](https://git.duniter.org/matograine/g1-cotis) - [G1pourboire](https://git.duniter.org/matograine/g1pourboire) diff --git a/docs/how-to_automate_transactions_and_multi-output.md b/docs/how-to_automate_transactions_and_multi-output.md deleted file mode 100644 index 28bc765d568399f36256c185e4a83c8bb17126b3..0000000000000000000000000000000000000000 --- a/docs/how-to_automate_transactions_and_multi-output.md +++ /dev/null @@ -1,67 +0,0 @@ -# How-to: automate transactions and multi-output - -Once silkaj installed. We want to be able to send a transaction to many recipients and to automate that process. - -Tutoriel based on this [forum post (fr)](https://forum.duniter.org/t/silkaj-installation-virements-automatiques-et-multi-destinataires/4836). - -### Create a recipient file - -You have to create a list of the public keys addresses to the recipients you wants to send money. - -> Example: here, we want to send money to Duniter’s pubkeys contributors. - -Create a `recipients.txt` file containing the list of the recipients keys. You can gather them with `silkaj id <user_id>`. - -> Example: -> -> ```txt -> 2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ -> FEkbc4BfJukSWnCU6Hed6dgwwTuPFTVdgz5LpL4iHr9J -> D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx -> HbTqJ1Ts3RhJ8Rx4XkNyh1oSKmoZL1kY5U7t9mKTSjAB -> 38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE -> 5cnvo5bmR8QbtyNVnkDXWq6n5My6oNLd1o6auJApGCsv -> GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP -> 7F6oyFQywURCACWZZGtG97Girh9EL1kg2WBwftEZxDoJ -> CRBxCJrTA6tmHsgt9cQh9SHcCc8w8q95YTp38CPHx2Uk -> 2sZF6j2PkxBDNAqUde7Dgo5x3crkerZpQ4rBqqJGn8QT -> 4FgeWzpWDQ2Vp38wJa2PfShLLKXyFGRLwAHA44koEhQj -> 55oM6F9ZE2MGi642GGjhCzHhdDdWwU6KchTjPzW7g3bp -> BH8ZqCsp4sbHeDPPHpto53ukLLA4oMy4fXC5JpLZtB2f -> ``` - -### Create an authentication file - -To process automated transactions, Silkaj needs to have an authentication file allowing to spent money. - -In order to create this file, with your wallet’s secret credentials, run following command: - -```bash -silkaj authfile -Please enter your Scrypt Salt (Secret identifier): -Please enter your Scrypt password (masked): -Using default values. Scrypt parameters not specified or wrong format -Scrypt parameters used: N: 4096, r: 16, p: 1 -Authentication file 'authfile' generated and stored in current folder for following public key: -XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -``` - -### Run the transaction - -Finally, you just have to run following command: - -```bash -silkaj --auth-file tx --amountUD 20 --output `cat recipients.txt | tr '\n' ':' | sed -e 's/:*$//'` -``` - -Note: Each pubkey will receive 20 UD. - -### Automated transaction - -If you want to automate a transaction on each first day of the month, you can set a `crontab` on your machine (preferably a server running 7/24): - -```bash -0 0 1 * * silkaj --auth-file tx --yes --amountUD 20 --output `cat recipients.txt | tr '\n' ':' | sed -e 's/:*$//'` -``` - -Note: the `--yes` option won’t prompt a confirmation. diff --git a/docs/multi-recipients_transfers_and_automation.md b/docs/multi-recipients_transfers_and_automation.md new file mode 100644 index 0000000000000000000000000000000000000000..a501e08ad9bce41eb3541f2979b2577a9d25bf87 --- /dev/null +++ b/docs/multi-recipients_transfers_and_automation.md @@ -0,0 +1,42 @@ +# Multi-recipients transfers and automation + +We want to transfer money to multiple recipients and to automate that process. + +### Create a recipients file + +Create a file (i.e.: `recipients.txt`) containing the list of the recipients public keys you want to send money to. + +```title="recipients.txt" +<ABSOLUTE|RELATIVE> + +# comment 1 +<amount1> <pubkey1> + +# comment 2 +<amount2> <pubkey2>:[<checksum2>] +``` + +The file content should be prefixed with `RELATIVE` or `ABSOLUTE` so the amounts will be expressed in UD Ğ1 or Ğ1. + +### Set up the authentication + +- Check [authentication documentation](/account_storage#Authentication) on how to handle the authentication. + +### Transfer + +Finally, you just have to run following command: + +```bash +silkaj -a <account_name> money transfer --file recipients.txt +``` + +### Automation + +In case you want to automate a transfer on a regural basis, on the first day of the month in this example, you can set a `crontab` on your machine (preferably a machine running 7/24): + +```bash +0 0 1 * * silkaj -a <account_name> money transfer --file recipients.txt --yes +``` + +Pass `--yes` option so no confirmation gets prompted. +In case a password is set on the authentication, pass as well the `--password <password>` general option. diff --git a/mkdocs.yml b/mkdocs.yml index bb2f2ff5e0bd5e6026925dfc6277398fa91ca5a5..34dc283f695af33075211911c4f14abb4ffdc6fc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -49,7 +49,7 @@ nav: - index.md - Installation: install.md - Usage: - - how-to_automate_transactions_and_multi-output.md + - multi-recipients_transfers_and_automation.md - DeathReaper: deathreaper.md - Blog: - blog/index.md