WORK IN PROGRESS

This package is still under development. This page will get more content as the package evolves.

Installation

Clone

cd ~/ark-core/plugins
git clone https://github.com/arkx-ecosystem/core-payroll
lerna bootstrap

Registration

Open ~/.ark/config/plugins.js and append the following to the bottom of the object.

{
  '@arkx/core-payroll': {
    delegate: '...',
    passphrases: {
      first: '...',
      second: '...'
    },
    share: {
      percentage: {
        voter: 90,
        delegate: 10
      }
    },
    wallets: {
      delegate: '...',
      blacklist: '...'
    }
  }
}

TIP

Those are the bare minimum options that need to be configured, many more are available!

Configuration

Arguments

  • server.enabled - Determines if the REST API is enabled
  • server.whitelist - A list of IP addresses that can connect to the REST API
  • server.hapi.host - The host under which the REST API will be available
  • server.hapi.port - The port under which the REST API will be available
  • server.hapi.routes.cors - Enabling or disabling CORS for any incoming requests
  • delegate - The username of the forging delegate
  • threshold - The minimum threshold required for a disbursement
  • startBlockHeight - The starting block to use for calculations
  • vendorField - The vendor field used for a disbursement
  • blacklist - A list of addresses that are excluded from calculations
  • passphrases.first - The first passphrase of the delegates wallet
  • passphrases.second - The second passphrase of the delegates wallet
  • share.percentage.voter - Percentage of a block reward that goes to the voters
  • share.percentage.delegate - Percentage of a block reward that goes to the delegate
  • share.balance.min - The minimum voter balance required to be eligible for block reward calculations
  • share.balance.max - The maximum voter balance allowed for block reward calculations
  • share.fixed - A list of addresses and amounts for fixed disbursements
  • fee.share - Shares forged fees with voters
  • fee.cover - Indicates if transfer fees are covered by the delegate
  • payroll.enabled - Determines if automatic disbursements are enabled
  • payroll.interval - How often disbursements will be send out
  • wallets.delegate - The wallet for delegate earning transfers
  • wallets.blacklist - The wallet for blacklist earning transfer

Defaults

module.exports = {
    database: {
        client: 'sqlite3',
        useNullAsDefault: true,
        connection: {
            filename: `${process.env.ARK_PATH_DATA}/plugins/core-payroll/database.sqlite`
        },
        migrations: {
            directory: path.resolve(__dirname, 'database/migrations'),
            tableName: 'migrations'
        },
        seeds: {
            directory: path.resolve(__dirname, 'database/seeds')
        }
    },
    server: {
        enabled: false,
        whitelist: ['127.0.0.1'],
        hapi: {
            host: '0.0.0.0',
            port: 5000,
            routes: {
                cors: true
            }
        }
    },
    delegate: null,
    threshold: 0.1,
    startBlockHeight: 1,
    vendorField: '{username} ~ height {height}',
    blacklist: [],
    passphrases: {
        first: null,
        second: null
    },
    share: {
        percentage: {
            voter: 90,
            delegate: 10
        },
        balance: {
            min: 1,
            max: 0
        },
        fixed: {}
    },
    fees: {
        share: false,
        cover: true,
        transfer: 0
    },
    payroll: {
        enabled: true,
        interval: 211
    },
    wallets: {
        delegate: null,
        blacklist: null
    },
    relays: [`http://127.0.0.1:${process.env.ARK_API_PORT || 4003}`]
}