Payman — A Tezos Batch Payment Tool

BriceAldrich
Coinmonks
5 min readMay 2, 2019

--

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

Source Install

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:

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.

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.

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:

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

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.

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:

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.

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

Get Best Software Deals Directly In Your Inbox

--

--

BriceAldrich
Coinmonks

Software Development, Cryptocurrency, Investing/Personal Finance