This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tx-submit: Add cardano-tx-submit/Readme.md
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |