I can’t seem to communicate to grin-wallet via json-rpc. I’m just testing using curl.
Referencing: https://github.com/mimblewimble/docs/wiki/Wallet-JSON-RPC-API-Guide
I try:
curl -0 -X POST -u grin:`cat ~/.grin/main/.api_secret` --data '{"jsonrpc":"2.0","method":"retrieve_summary_info","params":[true, 10],"id":1}' http://127.0.0.1:3415/v2/owner
and get no response. If I try port 3420 it says connection refused. halp?
(some specs: ubuntu 18, grin 4.0.2, grin-wallet 4.0.0)
Output after starting grin-wallet listen (removed addresses):
20200827 02:28:30.015 WARN grin_wallet_controller::controller - Starting TOR Hidden Service for API listener at address <tor-address>, binding to 0.0.0.0:3415
20200827 02:28:32.225 WARN grin_wallet_controller::controller - Starting HTTP Foreign listener API server at 0.0.0.0:3415.
20200827 02:28:32.226 WARN grin_wallet_controller::controller - HTTP Foreign listener started.
20200827 02:28:32.226 WARN grin_wallet_controller::controller - Slatepack Address is: <slatepack_addr>
Here is my config: /home/me/.grin/main/grin-wallet.toml
#########################################
### WALLET CONFIGURATION ###
#########################################
[wallet]
chain_type = "Mainnet"
#host IP for wallet listener, change to "0.0.0.0" to receive grins
api_listen_interface = "0.0.0.0"
#path of TLS certificate file, self-signed certificates are not supported
#tls_certificate_file = "/home/me/fullchain.pem"
#private key for the TLS certificate
#tls_certificate_key = "/home/me/privkey.pem"
#port for wallet listener
api_listen_port = 3415
#port for wallet owner api
owner_api_listen_port = 3420
#path of the secret token used by the API to authenticate the calls
#comment it to disable basic auth
api_secret_path = "/home/me/.grin/main/.owner_api_secret"
#location of the node api secret for basic auth on the Grin API
node_api_secret_path = "/home/me/.grin/main/.api_secret"
#where the wallet should find a running node
check_node_api_http_addr = "http://127.0.0.1:3413"
#include the foreign API endpoints on the same port as the owner
#API. Useful for networking environments like AWS ECS that make
#it difficult to access multiple ports on a single service.
owner_api_include_foreign = false
#where to find wallet files (seed, data, etc)
data_file_dir = "/home/me/.grin/main/wallet_data"
#If true, don't store calculated commits in the database
#better privacy, but at a performance cost of having to
#re-calculate commits every time they're used
no_commit_cache = false
#Whether to use the black background color scheme for command line
dark_background_color_scheme = true
#The exploding lifetime for keybase notification on coins received.
#Unit: Minute. Default value 1440 minutes for one day.
#Refer to https://keybase.io/blog/keybase-exploding-messages for detail.
#To disable this notification, set it as 0.
keybase_notify_ttl = 1440
#########################################
### TOR CONFIGURATION (Experimental) ###
#########################################
[tor]
skip_send_attempt = false
#Whether to start tor listener on listener startup (default true)
use_tor_listener = true
# TOR (SOCKS) proxy server address
socks_proxy_addr = "0.0.0.0:59050"
#Directory to output TOR configuration to when sending
send_config_dir = "/home/me/.grin/main"
#########################################
### LOGGING CONFIGURATION ###
#########################################
[logging]
#whether to log to stdout
log_to_stdout = true
#log level for stdout: Error, Warning, Info, Debug, Trace
stdout_log_level = "Info"
#whether to log to a file
log_to_file = true
#log level for file: Error, Warning, Info, Debug, Trace
file_log_level = "Info"
#log file path
log_file_path = "/home/me/.grin/main/grin-wallet.log"
#whether to append to the log file (true), or replace it on every run (false)
log_file_append = true
#maximum log file size in bytes before performing log rotation
#comment it to disable log rotation
log_max_size = 16777216
log_max_files = 32
