callback + auto generate wallet address functions ?!

tungfa

Well-known member
Foundation Member
Masternode Owner/Operator
I am posting this for somebody else
(as he is not able to sign on)

"Hey guys, i'm doing some internal develop and i need to use 2 type of function. Thats call back (notification member when received dash) and auto generate wallet address. If got any idea or advise pls share it , thanks."
 
I am posting this for somebody else
(as he is not able to sign on)

"Hey guys, i'm doing some internal develop and i need to use 2 type of function. Thats call back (notification member when received dash) and auto generate wallet address. If got any idea or advise pls share it , thanks."
Notification when received dash can be setup in dash.conf
walletnotify=/home/dash/walletnotify.sh %s
The %s will be transaction hash when the script "/home/dash/walletnotify.sh" be called from wallet after received dash.
Auto generate wallet address , this can be called with dash-cli
Examples: (from dash-cli help getaddressesbyaccount)
> dash-cli getaddressesbyaccount "tabby"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9998/
 
Notification when received dash can be setup in dash.conf
walletnotify=/home/dash/walletnotify.sh %s
The %s will be transaction hash when the script "/home/dash/walletnotify.sh" be called from wallet after received dash.
Auto generate wallet address , this can be called with dash-cli
Examples: (from dash-cli help getaddressesbyaccount)
> dash-cli getaddressesbyaccount "tabby"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9998/

he sais :
hi, i tried both still cant, is it the code for php api ? because i'm using php
 
he sais :
hi, i tried both still cant, is it the code for php api ? because i'm using php
I'm so sorry, I gave wrong command , it should be 'getnewaddress'
I don't know how to write in php but I can show you this example running of curl on testnet
Code:
$ curl -vvv --user darkcoinrpc --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": ["myaddress-01"] }' -H 'content-type: text/plain;' http://127.0.0.1:19998/
Enter host password for user 'darkcoinrpc':
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 19998 (#0)
* Server auth using Basic with user 'darkcoinrpc'
> POST / HTTP/1.1
> Authorization: Basic ZGFya.......................................................................................................................................kZBWTk=
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:19998
> Accept: */*
> content-type: text/plain;
> Content-Length: 91
>
* upload completely sent off: 91 out of 91 bytes
< HTTP/1.1 200 OK
< Date: Tue, 13 Oct 2015 16:21:28 +0000
< Connection: keep-alive
< Content-Length: 77
< Content-Type: application/json
* Server dash-json-rpc/v0.12.0.56-e6d842f is not blacklisted
< Server: dash-json-rpc/v0.12.0.56-e6d842f
<
{"result":"y4v8ZDqydcdRaojZQgtphZkcxAV4SzdRjo","error":null,"id":"curltest"}
* Connection #0 to host 127.0.0.1 left intact
Then, I get new address y4v8ZDqydcdRaojZQgtphZkcxAV4SzdRjo with account "myaddress-01" in my wallet ready to received :)
 
I'm so sorry, I gave wrong command , it should be 'getnewaddress'
I don't know how to write in php but I can show you this example running of curl on testnet
Code:
$ curl -vvv --user darkcoinrpc --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": ["myaddress-01"] }' -H 'content-type: text/plain;' http://127.0.0.1:19998/
Enter host password for user 'darkcoinrpc':
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 19998 (#0)
* Server auth using Basic with user 'darkcoinrpc'
> POST / HTTP/1.1
> Authorization: Basic ZGFya.......................................................................................................................................kZBWTk=
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:19998
> Accept: */*
> content-type: text/plain;
> Content-Length: 91
>
* upload completely sent off: 91 out of 91 bytes
< HTTP/1.1 200 OK
< Date: Tue, 13 Oct 2015 16:21:28 +0000
< Connection: keep-alive
< Content-Length: 77
< Content-Type: application/json
* Server dash-json-rpc/v0.12.0.56-e6d842f is not blacklisted
< Server: dash-json-rpc/v0.12.0.56-e6d842f
<
{"result":"y4v8ZDqydcdRaojZQgtphZkcxAV4SzdRjo","error":null,"id":"curltest"}
* Connection #0 to host 127.0.0.1 left intact
Then, I get new address y4v8ZDqydcdRaojZQgtphZkcxAV4SzdRjo with account "myaddress-01" in my wallet ready to received :)

FB man sais:
"Thanks to "thelazier" but im prefer on php because i have no idea with curl command"
 
Back
Top