GithubHelp home page GithubHelp logo

cryptobuks / anyswap-anytoken-distribution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anyswap/anytoken-distribution

0.0 1.0 0.0 480 KB

ANYToken distribution

License: GNU General Public License v3.0

Shell 0.14% Go 99.54% Makefile 0.32%

anyswap-anytoken-distribution's Introduction

ANYToken distribution

Building

git clone https://github.com/anyswap/ANYToken-distribution.git
cd ANYToken-distribution
make all

After building, the following files will be generated in ./build/bin directory:

distribute
config-example.toml

Config file

Copy config-example.toml to config.toml and modify it accordingly.

Please refer config file example

Run distribute

prepare the following:

  1. install mongodb
  2. start mongod service
  3. start fusion node (--gcmode archive)
  4. config rightly
setsid ./build/bin/distribute --verbosity 6 --config build/bin/config.toml --log build/bin/logs/distribute.log >/dev/null 2>&1

Command line

Show help info, run

./build/bin/distribute --help

The following are command line options:

   --config value, -c value     config file, use toml format
   --syncfrom value             sync start height, 0 means read from database (default: 0)
   --syncto value               sync end height (excluding end), 0 means endless (default: 0)
   --overwrite                  overwrite exist items in database (default: false)
   --verbosity value, -v value  log verbosity (0:panic, 1:fatal, 2:error, 3:warn, 4:info, 5:debug, 6:trace) (default: 4)
   --log value                  log file, support rotate
   --rotate value               log rotation time (unit hour) (default: 24)
   --maxage value               log max age (unit hour) (default: 720)
   --json                       output log in json format (default: false)
   --color                      output log in color text format (default: true)
   --help, -h                   show help (default: false)

byliquid subcommand

OPTIONS:
   --rewardToken value  reward token
   --rewards value      total rewards (uint wei)
   --start value        start height (start inclusive)
   --end value          end height (end exclusive)
   --exchange value     exchange address
   --accounts value     accounts file (line format: <address>), read from database if not specified
   --keystore value     keystore file path
   --password value     password file path
   --gasLimit value     gas limit in transaction, use default if not specified
   --gasPrice value     gas price in transaction, use default if not specified
   --nonce value        nonce in transaction, use default if not specified
   --output value       output file of result
   --dryrun             dry run (default: false)
   --help, -h           show help (default: false)

The meaning of options is same as byvolume subcommand. please see it at next section.

only --accounts is different, which is used to manually specify all account list of the corresponing exchange.

Example:

./distribute -v 6 -c config.toml byliquid -rewardToken 0xd05a60de2893ddc485cb8e9868be9a4abfa02a6b -rewards 100000000000000000000 -start 100 -end 200 -exchange 0x9fd692e4e681b62b6cb62d5afe397573cbd33d32 -keystore keystore.json -password password.txt -accounts accounts.txt -output result.txt -dryrun

We should use global options -c to specify config file where the MongoDB, Gateway etc. are reightly configed.

byvolume subcommand

OPTIONS:
   --rewardToken value  reward token
   --rewards value      total rewards (uint wei)
   --start value        start height (start inclusive)
   --end value          end height (end exclusive)
   --exchange value     exchange address
   --volumes value      volumes file (line format: <address> <volume>), read from database if not specified
   --keystore value     keystore file path
   --password value     password file path
   --gasLimit value     gas limit in transaction, use default if not specified
   --gasPrice value     gas price in transaction, use default if not specified
   --nonce value        nonce in transaction, use default if not specified
   --output value       output file of result
   --dryrun             dry run (default: false)
   --help, -h           show help (default: false)

Example:

./distribute -v 6 -c config.toml byvolume -rewardToken 0xd05a60de2893ddc485cb8e9868be9a4abfa02a6b -rewards 100000000000000000000 -start 100 -end 200 -exchange 0x9fd692e4e681b62b6cb62d5afe397573cbd33d32 -keystore keystore.json -password password.txt -volumes volumes.txt -output result.txt -dryrun

options usage

--rewardToken value reward token

specify send which token(ERC20) as reward, its the token's contract address.

--rewards value total rewards (uint wei)

specify the total rewards to send in specified block height range.

--start value start height (start inclusive)

specify start height of block range, start is inclusive.

--end value end height (end exclusive)

specify end height of block range, end is exclusive.

--exchange value exchange address

specify which exchange is statistics for the liquidity and volume.

--volumes value volumes file (line format:

), read from database if not specified

specify volumes file manually. read from database if not specified.

--keystore value keystore file path

specify keystore file to sign transaction to send rewards.

--password value password file path

specify password file to sign transaction to send rewards.

--gasLimit value gas limit in transaction

specify gas limit to build transaction to send rewards. get from RPC is not specified.

--gasPrice value gas price in transaction

specify gas price to build transaction to send rewards. get from RPC is not specified.

--nonce value nonce in transaction

specify account nonce to build transaction to send rewards. get from RPC is not specified.

--output value output file of result

specify output result file. with line format: <address> <reswards> <txhash> (zero hash mean tx is not sent)

--dryrun dry run (default: false)

specify whether send transaction to blockchain or just dry run.

anyswap-anytoken-distribution's People

Contributors

jowenshaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.