Transaction data processing helper for chaind-eth
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nolash fc1b7db4d8
Add readme
10 months ago
config Add submitter script 1 year ago
scripts Add readme 10 months ago
README.md Add readme 10 months ago
example.csv Add readme 10 months ago
requirements.txt Update scripts to dep changes 10 months ago

README.md

cic-batch

Helper scripts for submitting erc20 transfers to chaind-eth queuer.

Currently it contains two scripts:

  • scripts/parse_csv.py - Generate signed ethereum transactions from input data in csv format
  • scripts/submit.py - Submit signed transactions to the chaind-eth socket server

Parsing

The expected CSV input format is:

recipient_address,token_address,value

The value can be an integer or a floating-point value.

Signed transactions will be written as individual files, as hex-encode byte literals. The file name will be prefixed with the transaction's position in the csv.

The output directory will be the concatenation of the --output and --session-id argument flags. If --output is not given, the default folder name will be ./output. If --session-id is not specified, a new uuid will be generated and used as the session id.

To verify the details of the generated transactions, the contents of the generated files can be piped to eth-decode. Note that the same fee price will be used for all generated transactions.

Submitting

Invoke scripts/submit.py on the output of parse_csv.py.

You may specify the input directory (that is, the output location used by parse_csv.py as a single, optional positional argument to submit.py). If omitted, the default value ./output will be used.

The --session-id argument is used both to create the input data path, aswell as the socket file for the chaind-eth server.

For example: If you invoke submit.py [...] --session-id foo ./bar then any files in ./bar/foo will be attempted processed as signed transactions. However, if you invoke submit.py [...] --session-id foo (omitting the positional argument), files in ./output/foo will be parsed.

Caveats

The --session-id argument value should be the same as the corresponding value used when starting the chaind-eth socket server.

The default value of --fee-limit in parse_csv.py is 8000000. If you are issuing transactions against a erc20 contract you do not fully know or trust, you may want to explicitly set this to a lower value.