dourvaris / nano-python

RaiBlocks Node RPC Python Client

Home Page:https://nano-python.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connecting to ip6 localhost

locktemp997 opened this issue · comments

Hi maybe you can add this to the docs, but on my ubuntu mate machine, nano.rpc.Client('http://localhost:7076') would not work (connection refused). Instead I had to do nano.rpc.Client('http://ip6-localhost:7076')

Could you post your rai_node config.json

{ "version": "4", "wallet": "removed", "account": "removed", "node": { "version": "9", "peering_port": "7075", "bootstrap_fraction_numerator": "1", "receive_minimum": "1000000000000000000000000", "logging": { "version": "3", "ledger": "false", "ledger_duplicate": "false", "vote": "false", "network": "true", "network_message": "false", "network_publish": "false", "network_packet": "false", "network_keepalive": "false", "node_lifetime_tracing": "false", "insufficient_work": "true", "log_rpc": "true", "bulk_pull": "false", "work_generation_time": "true", "log_to_cerr": "false", "max_size": "16777216", "rotation_size": "4194304", "flush": "true" }, "work_peers": "", "preconfigured_peers": [ "rai.raiblocks.net" ], "preconfigured_representatives": [ "xrb_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4", "xrb_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou", "xrb_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p", "xrb_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m", "xrb_3hd4ezdgsp15iemx7h81in7xz5tpxi43b6b41zn3qmwiuypankocw3awes5k", "xrb_1awsn43we17c1oshdru4azeqjz9wii41dy8npubm4rg11so7dx3jtqgoeahy", "xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs", "xrb_1hza3f7wiiqa7ig3jczyxj5yo86yegcmqk3criaz838j91sxcckpfhbhhra1" ], "inactive_supply": "0", "password_fanout": "1024", "io_threads": "4", "work_threads": "4", "enable_voting": "true", "bootstrap_connections": "4", "bootstrap_connections_max": "64", "callback_address": "", "callback_port": "0", "callback_target": "", "lmdb_max_dbs": "128" }, "rpc": { "address": "::1", "port": "7076", "enable_control": "false", "frontier_request_limit": "16384", "chain_request_limit": "16384" }, "rpc_enable": "true", "opencl_enable": "false", "opencl": { "platform": "0", "device": "0", "threads": "1048576" } }

::1 is the loopback address in IPv6, which is the default in config.json.

While we're at it:
The nano-python library seem to default to http://localhost:7076, which, on most systems, maps to an IPv4 address--I'm guessing IPv4 was the old default in config.json / rai_node.

The easy solution would be to update the default URI in nano.rpc.Client--however, this would probably cause breakage for some users when upgrading the library.