The first 4 bytes of the data returned from the socket is a 32-bit big-endian result code. The data payload follows from the 5th byte.
## Batch processing
The `chaind-eth-send` executable generates signed transactions with data from a csv file.
The data columns must be in the following order:
1. receipient address
2. transaction value
3. token specifier (optional, network fee token if not given)
4. network fee token value (optional)
If the gas token value (4) is not given for a gas token transaction, the transaction value (2) will be used.
By default the signed transactions are output as hex to stdout, each on a separate line.
If a valid `--socket` is given (i.e. the socket of the `chaind-eth-server`) the transactions will be send to the socket instead. The hash of the transaction will be output to standard output.
### Using token symbols
If token symols are to be used in some or all values of column 3, then a valid `--token-index` executable address is required (in this case, a smart contract implementing the [`registry`](https://gitlab.com/grassrootseconomics/cic-contracts/-/blob/master/solidity/Registry.sol) contract interface).
### Input validity checks
The validity of the input data is verified _before_ actual execution takes place.
These checks include:
- The token can be made sense of.
- The values can be parsed to integer amounts.
- The recipient address is a valid checksum address.
The checks do however _not_ include whether the token balances of the signer are sufficient to successfully execute the transactions on the network.
1. send 10 tokens from token contract `0xb708175e3f6Cd850643aAF7B32212AFad50e2549` to recipient `0x72B70906fD07c72f2d96aAA250C2D31662D0d809`.
2. send 42 `GFT` tokens along with 100 network gas tokens to recipient `0xD536CB6d1d9B8d33875E0ba0Aa3515eD7478f889`
3. send 666 network gas tokens to recipient `0xeE08b59a95E822AE346489038D25750C8EdfcC25`
### Resending transactions
Since the `chaind-eth-server` does not have access to signing keys, resending stalled transactions is also a separate external action.
The `chaind-eth-resend` executable takes a list of signed transactions (e.g. as output from `chaind-eth-send` using the socket) and automatically increases the fee price of the transaction to create a replacement.
As with `chaind-eth-send`, the resend executable optionally takes a socket argument that sends the transaction directly to a socket. Otherwise, the signed transactions are send to standard output.
For example, the following will output details of the transaction generated by `chaind-eth-resend`, in which the fee price has been slightly incremented:
```
eth-gas --raw --fee-price 100000000 -a $recipient 1024 > tx1.txt
chaind-eth-resend tx1.txt > tx1_bump.txt
cat tx1_bump.txt | eth-decode
```
### Retrieving transactions for resend
The `chaind-list` tool can be used to retrieve transactions with the same filters as `chainqueue-list`, but also allowing results limited a specific session id.
As with `chainqueue-list`, which column to output can be customized. This enables creation of signed transaction lists in the format accepted by `chaind-eth-resent`.
One examples of criteria for transactions due to be resent may be:
```
# get any pending transaction in session "testsession"