44 lines
2.1 KiB
Markdown
44 lines
2.1 KiB
Markdown
# 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.
|