Summary

If you are a current or upcoming baker participating in Tezos this tutorial may be helpful. This tutorial will focus on how to use Payman to payout batch payments to your delegations. There are existing tools in the Tezos ecosystem that do the same thing, but I believe that Payman is easier to use, and more configurable.

Payman is an opensource free to use tool under the MIT License.

Motivation

My primary motivation for making Payman was to demonstrate the cababilties of go-tezos . Payman underneath the hood uses a Golang Tezos library I have personally been developing, alongside many contributors. As an added bonus, Payman itself uses GoLang concurrency models under the hood to make payouts faster than competitors.

Installation

Release Install



sudo mv

sudo chmod a+x /usr/local/bin/payman wget https://github.com/DefinitelyNotAGoat/payman/releases/download/v1.0.0/payman_linux_amd64 sudo mv payman_linux_amd64 /usr/local/bin/paymansudo chmod a+x /usr/local/bin/payman

Source Install

git clone https://github.com/DefinitelyNotAGoat/payman

cd payman

git checkout tags/v1.0.0

go build

sudo mv /usr/local/bin/payman cd paymangit checkout tags/v1.0.0go buildsudo mv /usr/local/bin/payman

Usage

Prerequisites

Before we dive into the different capabilities of Payman, it’s important to understand how to use the tezos-client CLI to get your wallet information. Payman depends on the encrypted secret key for the wallet you are paying out with, as well as the password. Payman does not save this information anywhere, or use it maliciously. You can verify by reading the code.

You do want to be cautious when using Payman with your wallet credentials. Just like any payout tool, or even the tezos-client itself, when you give the tool your credentials your wallet will exist in memory as the tool is running. On that note, be sure that when running Payman you are doing so from a secure computer.

Getting your wallet’s secret key:

./tezos-client show address <alias> -S

Example of doing this with alphanet with a wallet under the alias payman1 :

Generating Report

The first thing I would like to demonstrate is how to use Payman to generate a report of a payout without actually paying out.

./payman \

report \

--delegate=<delegate_public_key> \

--cycle=<cycle_number> \

--node=<address> \

--port=<port_number> \

--fee=<fee_as_float>

The above command will call payman report which calculates the payout with the information passed, and then reports it by printing a table and generating a csv file with the current data and time in the current working directory.

Example with Alphanet:

Payout For Cycle

The next thing I am going to demonstrate is paying out for a specific cycle.

./payman \

payout \

--delegate=<delegate_public_key> \

--secret=<encrypted_secret_to_wallet> \

--password=<password_to_encrypted_wallet> \

--cycle=<cycle_num> \

--node=<address> \

--port=<port_number> \

--fee=<fee_as_float>

Example with Alphanet:

As you can see from the above, when you use the payout command you will get the same table as using the report command, but before that you will also get the operation hash of your successful payment.

Using Reddit Bot

To use the reddit bot you will need to get API access to reddit. That is out of the scope of this tutorial, but with a simple google search you will be all set. To add your reddit access to create a bot using payman payout you will need to pass the flags below:

--reddit=<reddit_agent_file> \

--reddit-title=<pretitle_to_reddit_post>

The agent file contains your reddit credentials in the following format:

user_agent: "DNG_DELEGATION:BAKINGBOT:0.0.1 (by /u/magicaglet)"

client_id: <from_api_access>

client_secret: <from_api_access>

username: "MagicAglet"

password: <password>

First you see user_agent which is a unique id you make to assign to your bot. Then pass the client_id and secret from your reddit account. Substitute MagicAglet with your username, and add your password.

As an example my reddit bot, which used DefinitelyNotABot (Beep Bop Boop): as the --reddit-title , posted:

Using Twitter Bot

The twitter bot is going to be much like the reddit bot.

--twitter

--twitter-title=<pretitle_to_reddit_post>

The above flags will turn on the twitter bot and look for a twitter.yml config file in the current directory which contains your api keys. If you want the twitter.yml file is not in the current directory, you can add the path by --twitter-path=/path/to/file/ .

Your twitter.yml file must look like the following:

consumerKey: ""

consumerKeySecret: ""

accessToken: ""

accessTokenSecret: ""

You can easily find the above values once you get approved for a twitter developer account https://developer.twitter.com/.

As an example my twitter bot, which used DefinitelyNotABot (Beep Bop Boop): as the --twitter-title , posted:

Payout Server

Finally the last part of Payman’s functionality is the payout server. The payout server will payout for every cycle going forward. You must make sure your wallet is funded for each payout though, which is the caveat for all payout server scripts.

./payman \

payout \

--delegate=<delegate_public_key> \

--secret=<encrypted_secret_to_wallet> \

--password=<password_to_encrypted_wallet> \

--cycle=<cycle_num> \

--node=<address> \

--port=<port_number> \

--fee=<fee_as_float> \

--serve

Notice the --serve command. You will still get all the normal output from a normal payout, including the csv logs.

Conclusion

If you’re a baker and you need a payout script, this may be the one you’re looking for. It’s easy to use, developer friendly, and highly configurable.

Roadmap

Blacklists

Tax Reporting

Source Code