Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
tx-submit: Add cardano-tx-submit/Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Dec 13, 2019
1 parent 05400bf commit 94ddd00
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cardano-tx-submit/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# cardano-tx-submit-webapi

The `cardano-tx-submit-webapi` is a program that provides a webapi that allows transactions
(generated using the `cardano-cli` program in the `cardano-node` repository) to be HTTP POSTed
to the Cardano blockchain.

In order to submit a transaction to the network (mainnet, staging or any of the testnets), the
webapi needs a running `cardano-node` and the Genesis file and Genesis hash value for the network.

The config for `mainnet` is provided at `config/tx-submit-mainnet-config.yaml` of this repository.

Configuration for other networks can be generated using the above as a template using:
```
scripts/generate-tx-submit-config.sh --require-magic --genesis-hash <hash> --output config.yaml
```
where `--require-magic` is required for all test nets, but should be replaced with
`--require-no-magic` for mainnet or staging.

Once the correct configuration has been generated, the webapi can be run using:
```
cabal run cardano-tx-submit-webapi -- \
--config config.yaml \
--genesis-file <genesis file> \
--socket-path <socket path> \
--port 8101
```

With the webapi running, it is possible to submit a preformed transaction using:
```
curl -X POST \
--header "Content-Type:application/octet-stream" \
--data-binary @transaction.bin http://localhost:8101/api/submit/tx
```
where `transaction.bin` is the preformed transaction.

0 comments on commit 94ddd00

Please sign in to comment.