diff options
| author | Adam Soltys <[email protected]> | 2024-02-01 11:52:57 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-02-01 11:52:57 -0800 |
| commit | e5d8a9e55fbcffd4f60001cca7f730ea1cd6943b (patch) | |
| tree | e16370f38ea95f5655a6942a26744fb1e18be457 | |
| parent | fbfc8f0e109f46d083b7054f56ee18fd6f1f5fdf (diff) | |
| download | coinos-server-e5d8a9e55fbcffd4f60001cca7f730ea1cd6943b.tar.gz coinos-server-e5d8a9e55fbcffd4f60001cca7f730ea1cd6943b.zip | |
liquid sample config
| -rw-r--r-- | sampledata/liquid/elements.conf | 18 | ||||
| -rwxr-xr-x | sampledata/liquid/transaction.sh | 39 |
2 files changed, 57 insertions, 0 deletions
diff --git a/sampledata/liquid/elements.conf b/sampledata/liquid/elements.conf new file mode 100644 index 00000000..a6778b25 --- /dev/null +++ b/sampledata/liquid/elements.conf @@ -0,0 +1,18 @@ +chain=liquidregtest +listen=1 +txindex=1 +fallbackfee=0.00000002 + +[liquidregtest] +rpcuser=admin1 +rpcpassword=123 +rpcbind=0.0.0.0 +rpcallowip=0.0.0.0/0 +rpcwallet=coinos +validatepegin=0 +initialfreecoins=2100000000000000 +wallet=coinos +wallet=external +wallet=raretoshi +walletnotify=/home/elements/.elements/transaction.sh %s %w +# con_blocksubsidy=5000000000 diff --git a/sampledata/liquid/transaction.sh b/sampledata/liquid/transaction.sh new file mode 100755 index 00000000..cecee38a --- /dev/null +++ b/sampledata/liquid/transaction.sh @@ -0,0 +1,39 @@ +#!/usr/bin/perl +use strict; +use warnings; +use IO::Socket::INET; + +# Auto-flush on socket +$| = 1; + +# Creating a socket, connecting to the server +my $socket = new IO::Socket::INET ( + PeerHost => 'app', + PeerPort => '3119', + Proto => 'tcp', +) or die "ERROR in Socket Creation : $!\n"; + +my $txid = $ARGV[0] // die "txid not provided"; +my $wallet = $ARGV[1] // die "wallet not provided"; + +# Define HTTP request +my $json = "{\"txid\": \"$txid\", \"wallet\": \"$wallet\", \"type\": \"liquid\"}"; +my $request = "POST /confirm HTTP/1.1\r\n"; +$request .= "Host: app\r\n"; +$request .= "Content-Type: application/json\r\n"; +$request .= "Content-Length: " . length($json) . "\r\n"; +$request .= "Connection: close\r\n"; +$request .= "\r\n"; +$request .= $json; + +# Send request to server +print $socket "$request"; +shutdown($socket, 1); + +# Read the response +while (my $line = <$socket>) { + print $line; +} + +# Close the socket +$socket->close(); |
