counterpartyxcp / counterparty-cli Goto Github PK
View Code? Open in Web Editor NEWCounterparty Protocol Command‐Line Interface
Home Page: http://counterparty.io
License: MIT License
Counterparty Protocol Command‐Line Interface
Home Page: http://counterparty.io
License: MIT License
From @Rippler on January 9, 2015 18:6
I run counterpartyd-cli --testnet market
and it chokes on TESTASSETONE
:
[INFO] Running v9.49.3 of counterpartyd.←[0m
[INFO] Connecting to database.←[0m
Your Pending Order Matches
+------------------+-----------+
| Matched Order ID | Time Left |
+------------------+-----------+
+------------------+-----------+
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 109
2, in <module>
market(args.give_asset, args.get_asset)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 133
, in market order = format_order(order)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 63,
in format_order give_quantity = util.value_out(db, D(order['give_quantity']), order['give_as
set'])
File "c:\counterpartyd_build\dist\counterpartyd\lib\util.py", line 380, in val
ue_out divisible = is_divisible(db, asset)
File "c:\counterpartyd_build\dist\counterpartyd\lib\util.py", line 338, in is_
divisible if not issuances: raise exceptions.AssetError('No such asset: {}'.format(ass
et))
lib.exceptions.AssetError: No such asset: TESTASSETONE←[0m
However there is such an asset
http://testnet.blockscan.com/asset?q=TESTASSETONE
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
Copied from original issue: CounterpartyXCP/counterparty-core#609
Got those errors when trying to run counterparty-server on Windows 7:
C:\Users\millz\Desktop\coutnerwallet\counterparty-cli-win32-1.0.0>counterparty-server.exe --testnet server
Traceback (most recent call last):
File "counterparty-server", line 12, in <module>
File "C:\counterparty\counterparty-cli\counterpartycli\server.py", line 175, i
n main
File "C:\Users\millz\Desktop\coutnerwallet\counterparty-cli-win32-1.0.0\librar
y\counterparty\server.py", line 151, in initialise
raise ConfigurationError('backend RPC password not set. (Use configuration f
ile or --backend-password=PASSWORD)')
counterparty.server.ConfigurationError: backend RPC password not set. (Use confi
guration file or --backend-password=PASSWORD)
Here's the configuration file:
C:\Users\millz\AppData\Roaming\counterparty-server\counterparty-server.conf:
[Default]
backend-name = addrindex
backend-connect = localhost
backend-user = rpcuser
backend-password = password
rpc-host = 0.0.0.0
rpc-user = rpcuser
rpc-password = password
From @Rippler on January 9, 2015 18:15
I get this when I try to open a bet from a testnet address.
[INFO] Running v9.49.3 of counterpartyd.←[0m
[INFO] Connecting to database.←[0m
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 869
, in <module> args.unsigned)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 232
, in cli unsigned_tx_hex = util.api(method, params)
File "c:\counterpartyd_build\dist\counterpartyd\lib\util.py", line 69, in api
raise RPCError('{}'.format(response_json['error']))
lib.util.RPCError: {'message': 'Server error', 'code': -32000, 'data': {'message
': "local variable 'btc_out' referenced before assignment", 'args': ["local vari
able 'btc_out' referenced before assignment"], 'type': 'UnboundLocalError'}}←[0m
Then I add --unconfirmed
and it goes through right away.
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
Copied from original issue: CounterpartyXCP/counterparty-core#610
Standalone Windows setup, v.9.49.3.
Problem: without --data-dir
counterparty-cli doesn't want to work, although it should because it is specified in my counterpartyd config file. I tried to add
data-dir` to the config file (although that shouldn't be necessary). but that doesn't help either.
C:\bitcoin-core-0.10>c:\python34\python.exe c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py --config-file c:\bitcoin-core-0.10\TESTNET.counterpartyd.conf --testnet market
Traceback (most recent call last):
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 722, in <module>
testcoin=args.testcoin, force=args.force)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 250, in set_options
config.DATA_DIR = appdirs.user_config_dir(appauthor=config.XCP_NAME, appname=config.XCP_CLIENT, roaming=True)
AttributeError: 'module' object has no attribute 'user_config_dir'
I built server
and client
from develop.
Then I tried the filtering with getrows
filters from 55ea56a
counterparty-client.exe --testnet getrows --table broadcasts --filter 'address' '=' 'mmo6v1Mbs4gwRBkYBTa2dua9k1Ke8aRzGi'
[INFO] Running v1.0.0 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "c:\Python34\Scripts\counterparty-client-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0', 'console_scripts', 'counterparty-client')()
File "C:\Python34\lib\site-packages\counterpartycli\__init__.py", line 12, in client_main
client.main()
File "C:\Python34\lib\site-packages\counterpartycli\client.py", line 255, in main
view = console.get_view(args.action, args)
File "C:\Python34\lib\site-packages\counterpartycli\console.py", line 34, in get_view
return util.api(method, params)
File "C:\Python34\lib\site-packages\counterpartycli\util.py", line 95, in api
return rpc(config.COUNTERPARTY_RPC, method, params=params, ssl_verify=config.COUNTERPARTY_RPC_SSL_VERIFY)
File "C:\Python34\lib\site-packages\counterpartycli\util.py", line 92, in rpc
raise RPCError('{}'.format(response_json['error']))
counterpartycli.util.RPCError: {'message': 'Server error', 'code': -32000, 'data': {'type': 'APIError', 'args': ["Invalid operator for the field ''address''"], 'message': "Invalid operator for the field ''address''"}}
Is this the correct syntax?
I tried '==' as well as source
instead of address
.
Just as a reminder (I'm not sure if this is being addressed elsewhere, if yes, feel free to close), on Windows can you rename counterparty-[client,server]
to counterparty-[client,server].py
so that they can be executed from Windows without explicitly using python.exe
.
It works for a BTC transfer.
Would it be possible that the issuance asks for the public keys as the BTC transfer does?
sudo pip3 install counterparty-cli
Installing counterparty-client script to /usr/local/bin
writing list of installed files to '/tmp/pip-aon_8hyr-record/install-record.txt'
running generate_configuration_files
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-kgvhjjbh/counterparty-cli/setup.py", line 126, in <module>
setup(**setup_options)
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-kgvhjjbh/counterparty-cli/setup.py", line 34, in run
self.run_command('generate_configuration_files')
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-kgvhjjbh/counterparty-cli/setup.py", line 21, in run
generate_config_files()
File "/tmp/pip-build-kgvhjjbh/counterparty-cli/counterpartycli/setup.py", line 142, in generate_config_files
from counterpartycli.server import CONFIG_ARGS as SERVER_CONFIG_ARGS
File "/tmp/pip-build-kgvhjjbh/counterparty-cli/counterpartycli/server.py", line 11, in <module>
from counterpartylib import server
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/server.py", line 19, in <module>
from counterpartylib.lib import api, config, util, exceptions, blocks, check, backend, database, transaction, script, log
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/api.py", line 39, in <module>
from counterpartylib.lib import check
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/check.py", line 12, in <module>
from counterpartylib.lib import backend
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/__init__.py", line 18, in <module>
from counterpartylib.lib.backend import addrindex, btcd
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/addrindex.py", line 6, in <module>
from requests.exceptions import Timeout, ReadTimeout, ConnectionError
ImportError: cannot import name 'ReadTimeout'
----------------------------------------
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-kgvhjjbh/counterparty-cli/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aon_8hyr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-kgvhjjbh/counterparty-cli
Maybe related to #55 or pip3 (after #55 I upgraded pip3 to 7.1.0)
user@ubuntu:~$ sudo pip3 list
appdirs (1.4.0)
apsw (3.8.7.3.post1)
chardet (2.2.1)
colorama (0.2.5)
colorlog (2.6.0)
command-not-found (0.3)
counterparty-cli (1.1.1)
counterparty-lib (9.51.3)
coverage (3.7.1)
Flask (0.10.1)
Flask-HTTPAuth (2.5.0)
html5lib (0.999)
itsdangerous (0.24)
Jinja2 (2.8)
json-rpc (1.10.1)
language-selector (0.1)
MarkupSafe (0.23)
pip (7.1.0)
prettytable (0.7.2)
py (1.4.30)
pycoin (0.52)
pycrypto (2.6.1)
pygobject (3.12.0)
pysha3 (0.3)
pytest (2.7.2)
pytest-cov (2.0.0)
python-apt (0.9.3.5ubuntu1)
python-bitcoinlib (0.4.0)
python-dateutil (2.4.2)
requests (2.7.0)
setuptools (3.3)
six (1.9.0)
tendo (0.2.8)
tornado (4.2.1)
ufw (0.34-rc-0ubuntu2)
urllib3 (1.7.1)
Werkzeug (0.10.4)
wheel (0.24.0)
xmltodict (0.9.2)
user@ubuntu:~$ sudo pip3 -V
pip 7.1.0 from /usr/local/lib/python3.4/dist-packages (python 3.4)
I got this error when I upgraded both counterpartyd and counterparty-cli, while trying to install counterparty-cli. I installed counterpartyd first.
It complains about missing config files.
C:\Python34>counterparty-client -h
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "C:\Python34\Scripts\counterparty-client-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0', 'console_scripts', 'counterparty-client')()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0-py3.4.egg\counterpartycli\__init__.py", line 12, in client_main
client.main()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0-py3.4.egg\counterpartycli\client.py", line 655, in main
wallet_ssl=args.wallet_ssl, wallet_ssl_verify=args.wallet_ssl_verify)
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0-py3.4.egg\counterpartycli\client.py", line 421, in set_options
raise ConfigurationError('wallet RPC password not set. (Use configuration file or --wallet-password=PASSWORD)')
counterpartycli.client.ConfigurationError: wallet RPC password not set. (Use configuration file or --wallet-password=PASSWORD)←[0m
Hi,
trying to install counterpaty-cliCommand python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/counterparty-cli
When looking up BTC (from wallet with no BTC):
$ counterparty-client asset BTC
[INFO] Running v1.1.1 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-client')()
File "/usr/lib/python3.4/site-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/lib/python3.4/site-packages/counterpartycli/client.py", line 262, in main
print_method(view)
File "/usr/lib/python3.4/site-packages/counterpartycli/console.py", line 71, in print_asset
if asset['sends']:
KeyError: 'sends'
When looking up nonexistent asset:
$ counterparty-client asset ABCD
[INFO] Running v1.1.1 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-client')()
File "/usr/lib/python3.4/site-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/lib/python3.4/site-packages/counterpartycli/client.py", line 257, in main
view = console.get_view(args.action, args)
File "/usr/lib/python3.4/site-packages/counterpartycli/console.py", line 10, in get_view
return wallet.asset(args.asset)
File "/usr/lib/python3.4/site-packages/counterpartycli/wallet/__init__.py", line 121, in asset
supply = api('get_supply', {'asset': asset_name})
File "/usr/lib/python3.4/site-packages/counterpartycli/util.py", line 92, in api
return rpc(config.COUNTERPARTY_RPC, method, params=params, ssl_verify=config.COUNTERPARTY_RPC_SSL_VERIFY)
File "/usr/lib/python3.4/site-packages/counterpartycli/util.py", line 89, in rpc
raise RPCError('{}'.format(response_json['error']))
counterpartycli.util.RPCError: {'code': -32000, 'message': 'Server error', 'data': {'args': ['ABCD'], 'type': 'KeyError', 'message': "'ABCD'"}}
As for the standalone binaries (this one https://github.com/CounterpartyXCP/counterparty-cli/releases/tag/v1.0.0 ?? ). It complains about a missing package...json file. I have to first git and install the python counterparty-cli tools and run that once. Only then can I run the standalone libraries at https://github.com/CounterpartyXCP/counterparty-cli/releases/tag/v1.0.0
failover mode (and consensus mode ?)
This was initially created (and fixed) here (CounterpartyXCP/counterparty-core#591), but I just spotted it again, so instead of reopening it in the wrong repo, I'm creating a new issue here. This is on develop
branches of counterpartyd
and counterpartyd_build
.
counterparty-cli.py --config-file c:\bitcoin-core-0.10\TESTNET.counterpartyd.conf --data-dir c:\bitcoin-core-0.10\counterparty-testnet market
Your Pending Order Matches
+------------------+-----------+
....
Traceback (most recent call last):
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 1078, in <module>
market(args.give_asset, args.get_asset)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 134, in market
bet = format_bet(bet)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 81, in format_bet
return [util.BET_TYPE_NAME[bet['bet_type']], bet['feed_address'], util.isodt(bet['deadline']), target_value, leverage, str(bet['wager_remaining']
/ config.UNIT) + ' XCP', util.value_out(db, odds, 'odds'), bet['expire_index'] - util.last_block(db)['block_index'], bet['tx_hash']]
AttributeError: 'module' object has no attribute 'isodt'
raise ConfigurationError('wallet RPC password not set. (Use configuration file or --wallet-password=PASSWORD)')
unterpartycli.clientapi.ConfigurationError: wallet RPC password not set. (Use configuration file or --wallet-password=PASSWORD)
I think I've seen more than one example where =
is retained in CLI examples
Shouldn't this be --wallet-password PASSWORD
(if passed via CLI)?
I think the below was caused by UTF8 encoding of the config file. I did make some changes and also saved it as ANSI, after that it worked, so I'm not 100% sure.
C:\Python34\Scripts>counterparty-server start
[INFO] Running v1.0.0 of counterparty-server.
Traceback (most recent call last):
File "C:\Python34\Scripts\counterparty-server-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0rc5', 'console_scripts', 'counterparty-server')()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0rc5-py3.4.egg\counterpartycli\__init__.py", line 14, in server_main
server.main()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0rc5-py3.4.egg\counterpartycli\server.py", line 61, in main
parser = add_config_arguments(parser, CONFIG_ARGS, 'server.conf')
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0rc5-py3.4.egg\counterpartycli\util.py", line 113, in add_config_arguments
configfile.read(cmd_args.config_file)
File "C:\Python34\lib\configparser.py", line 672, in read
self._read(fp, filename)
File "C:\Python34\lib\configparser.py", line 993, in _read
for lineno, line in enumerate(fp, start=1):
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 551: character maps to <undefined>
Been running fine for several weeks on testnet, with zero workload. Then there was a timeout and a subsequent error. bitcoind did not crash, but maybe it was overloaded due to the many transactions.
I'm reporting this just in case other error may be something unrelated that got exposed by the timeout. If it's simply a consequence of the RPC error, please close this issue.
counterpartylib.lib.backend.addrindex.BackendRPCError: Cannot communicate with backend at `http://bitcoin-rpc:xxxxxxxxxx@localhost:18332`. (server is set to run on testnet, is backend?)
[ERROR] Unhandled Exception
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/addrindex.py", line 230, in getrawtransaction_batch
result[tx_hash] = raw_transactions_cache[tx_hash]
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/util.py", line 637, in __getitem__
return self.dict[key]
KeyError: 'bb99912225a4d04da11d7e9ee507c5484e51c42fddeb7e3c9d057759fe7aa063'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/counterparty-server", line 9, in <module>
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-server')()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/__init__.py", line 16, in server_main
server.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/server.py", line 135, in main
server.start_all(db)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/server.py", line 372, in start_all
blocks.follow(db)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/blocks.py", line 1077, in follow
mempool_tx_index = list_tx(db, None, block_index, curr_time, tx_hash, mempool_tx_index)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/blocks.py", line 719, in list_tx
backend.extract_addresses([tx_hash,]) # prepare cache for backend.unconfirmed_transactions().
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/__init__.py", line 65, in extract_addresses
return BACKEND().extract_addresses(txhash_list)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/addrindex.py", line 103, in extract_addresses
raw_transactions = getrawtransaction_batch(list(tx_inputs_hashes), verbose=True)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/lib/backend/addrindex.py", line 235, in getrawtransaction_batch
e, len(txhash_list), hashlib.md5(json.dumps(list(txhash_list)).encode()).hexdigest(), len(raw_transactions_cache), len(payload),
NameError: name 'e' is not defined
Current version, both Linux and Windows.
$ counterparty-client --config-file .config/counterparty/client.testnet.conf broadcast \
--text TEST --value 1 --source n3PUj39dhkt65iYwq4QSnMY8ajsBEnNQSP
[INFO] Running v1.1.0 of counterparty-client.
ERROR:root:Unhandled Exception
Traceback (most recent call last):
File "/usr/local/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.0', 'console_scripts', 'counterparty-client')()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/client.py", line 230, in main
unsigned_hex = messages.compose(args.action, args)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/messages.py", line 272, in compose
return compose_transaction(args, message, param_names)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/messages.py", line 263, in compose_transaction
unsigned_tx_hex = util.api(method, params)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/util.py", line 92, in api
return rpc(config.COUNTERPARTY_RPC, method, params=params, ssl_verify=config.COUNTERPARTY_RPC_SSL_VERIFY)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/util.py", line 89, in rpc
raise RPCError('{}'.format(response_json['error']))
counterpartycli.util.RPCError: {'code': -32000, 'message': 'Server error', 'data': {'message': 'unorderable types: NoneType() < int()', 'type': 'APIError', 'args': ['unorderable types: NoneType() < int()']}}
$ counterparty-client bet --source ADD1 --feed-address ADD2 --wager 0.05 --counterwager 0.06 --expiration 20 --bet-type Equal --deadline 2015-11-01T05:06:07+00:00
[INFO] Running v1.1.1 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "/usr/local/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-client')()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/client.py", line 230, in main
unsigned_hex = messages.compose(args.action, args)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/messages.py", line 274, in compose
return compose_transaction(args, message, param_names)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/messages.py", line 250, in compose_transaction
args = prepare_args(args, message_name)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/messages.py", line 169, in prepare_args
args.deadline = calendar.timegm(dateutil.parser.parse(args.deadline).utctimetuple())
NameError: name 'calendar' is not defined
DB was created with counterpartyd
9.49.3. Even if the DB directory is empty, the error hapens. Reparse of the existing DB exits with the same error.
[INFO] Starting API Server.←[0m
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "C:\Python34\Scripts\counterparty-server-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0rc4', 'console_scripts', 'counterparty-server')()
File "C:\Python34\lib\site-packages\counterpartycli\__init__.py", line 14, in server_main
server.main()
File "C:\Python34\lib\site-packages\counterpartycli\server.py", line 170, in main
server.start_all(db)
File "C:\Python34\lib\site-packages\counterpartylib\server.py", line 351, in start_all
blocks.follow(db)
File "C:\Python34\lib\site-packages\counterpartylib\lib\blocks.py", line 867, in follow
initialise(db)
File "C:\Python34\lib\site-packages\counterpartylib\lib\blocks.py", line 202, in initialise
raise exceptions.DatabaseError('First block in database is not block {}.'.format(config.BLOCK_FIRST))
counterpartylib.lib.exceptions.DatabaseError: First block in database is not block 310000.←[0m
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "C:\Python34\Scripts\counterparty-server-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0rc4', 'console_scripts', 'counterparty-server')()
File "C:\Python34\lib\site-packages\counterpartycli\__init__.py", line 14, in server_main
server.main()
File "C:\Python34\lib\site-packages\counterpartycli\server.py", line 170, in main
server.start_all(db)
File "C:\Python34\lib\site-packages\counterpartylib\server.py", line 351, in start_all
blocks.follow(db)
File "C:\Python34\lib\site-packages\counterpartylib\lib\blocks.py", line 867, in follow
initialise(db)
File "C:\Python34\lib\site-packages\counterpartylib\lib\blocks.py", line 202, in initialise
raise exceptions.DatabaseError('First block in database is not block {}.'.format(config.BLOCK_FIRST))
counterpartylib.lib.exceptions.DatabaseError: First block in database is not block 310000.←[0m
Testnet config file:
[Default]
backend-name = addrindex
backend-user = rpc
backend-password = testnet
rpc-host = localhost
rpc-user = rpc
rpc-password = testnet
testnet = 1
data-dir = C:\blockchain\counterparty-testnet
config-file = C:\blockchain\TESTNET.counterpartyd.conf
v9.49.3 (master
) on Windows:
C:\bitcoin-core-0.10>c:\python34\python.exe c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py --data-dir c:\bitcoin-core-0.10\counterparty --testnet --config-file c:\bitcoin-core-0.10\TESTNET.counterpartyd.conf --testnet broadcast --text "Source is defined 1=Y,2=N" --value 1 --source myG2jGS146LntchbNHaAHqPZJyqwqdorUX --fee-fraction 0.005
Transaction (unsigned): 0100000005ddb9d0224a344f15cab63c9efa19b1216d57c0f39c00bd31cdbdd47dbf7cab68000000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88acffffffff8979e521cdffb6bcff70fbb19a7e48caa5c8ec487a733d7c297391b346a4d293000000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88acffffffff64fb70adb5e72c791bf78e6312b3e6846bf67c1363290e27ed94b7453fad59cb000000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88acffffffff7330166630dfa9de6d8c42784165ce58be5c799b2c229cc179ef7a9cff7613d1000000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88acffffffff72a8ed7a6a4f1def6f49c5786a494f0aa0bf5b2681005068cb447463988f2ad2020000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88acffffffff02771e000000000000695121023f26f66bbdfde326445a420083656d290c42ce4aa44b5408d3e89c769740e54f21030b95330dd051f58d36cc915e2ed565f61d48f9bf44f710877dd2ae11c79439c0210376156a1397b2f282c8f18bda70e09b5fa1bd9cd6b159c11ba661d68ec11a288853ae8f941c00000000001976a914c29fba0187fc7070b58247244cecf503ee0a67fb88ac00000000
Sign and broadcast? (y/N) y
Traceback (most recent call last):
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 832, in <module>
args.unsigned)
File "c:\counterpartyd_build\dist\counterpartyd\counterparty-cli.py", line 223, in cli
if backend.is_mine(proxy, source):
NameError: name 'source' is not defined
With v 1.1.0:
[INFO] Running v1.1.0 of counterparty-server.←[0m
Traceback (most recent call last):
File "C:\Python34\Scripts\counterparty-server-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.1.0', 'console_scripts', 'counterparty-server')()
File "C:\Python34\lib\site-packages\counterpartycli\__init__.py", line 16, in server_main
server.main()
File "C:\Python34\lib\site-packages\counterpartycli\server.py", line 110, in main
force=args.force, verbose=args.verbose)
File "C:\Python34\lib\site-packages\counterpartylib\server.py", line 137, in initialise
log.set_up(root_logger, verbose=verbose, logfile=config.LOG)
File "C:\Python34\lib\site-packages\counterpartylib\lib\log.py", line 36, in set_up
fileh = util_windows.SanitizedRotatingFileHandler(logfile, maxBytes=max_log_size, backupCount=5)
File "C:\Python34\lib\logging\handlers.py", line 150, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
File "C:\Python34\lib\logging\handlers.py", line 57, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
File "C:\Python34\lib\logging\__init__.py", line 1006, in __init__
StreamHandler.__init__(self, self._open())
File "C:\Python34\lib\logging\__init__.py", line 1030, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: 'C:\\blockchain'
Cause?
--log-file LOG_FILE the path to the server log file
When this is set to a directory path (instead of file), counterparty-server attempts to treat that directory as file, which fails.
Downloaded zip archive from develop
, unzipped and tried to build the executable from a console with Admin privileges.
C:\Python34\counterparty-cli-develop\counterparty-cli-develop>..\..\python.exe s
etup.py py2exe
Traceback (most recent call last):
File "setup.py", line 56, in <module>
shutil.rmtree(WIN_DIST_DIR)
File "C:\Python34\lib\shutil.py", line 477, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Python34\lib\shutil.py", line 359, in _rmtree_unsafe
onerror(os.listdir, path, sys.exc_info())
File "C:\Python34\lib\shutil.py", line 357, in _rmtree_unsafe
names = os.listdir(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'coun
terparty-cli-win32-1.0.0'
counterparty-server
v9.49.4 handles it, but counterparty-cli
1.0.0 does not.
rippler@ubuntu:/usr/local/lib/python3.4/dist-packages$ counterparty-client -V
counterparty-client v1.0.0
rippler@ubuntu:/usr/local/lib/python3.4/dist-packages$ counterparty-server
Traceback (most recent call last):
File "/usr/local/bin/counterparty-server", line 12, in <module>
server.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/server.py", line 172, in main
broadcast_tx_mainnet=broadcast_tx_mainnet)
File "/usr/local/lib/python3.4/dist-packages/counterpartylib/server.py", line 155, in initialise
raise ConfigurationError('backend RPC password not set. (Use configuration file or --backend-password=PASSWORD)')
counterpartylib.server.ConfigurationError: backend RPC password not set. (Use configuration file or --backend-password=PASSWORD)
rippler@ubuntu:/usr/local/lib/python3.4/dist-packages$ counterparty-client
[INFO] Running v1.0.0 of counterparty-client.
[ERROR] Unhandled Exception
Traceback (most recent call last):
File "/usr/local/bin/counterparty-client", line 12, in <module>
client.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/client.py", line 684, in main
wallet_ssl=args.wallet_ssl, wallet_ssl_verify=args.wallet_ssl_verify)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/client.py", line 337, in set_options
raise ConfigurationError('counterparty RPC password not set. (Use configuration file or --counterparty-rpc-password=PASSWORD)')
counterpartycli.client.ConfigurationError: counterparty RPC password not set. (Use configuration file or --counterparty-rpc-password=PASSWORD)
Ideally the bootstrap command should behave consistently as all the others (read the config file):
$ counterparty-server --config-file /home/xcp/.config/counterparty-server/server.conf --testnet bootstrap
[INFO] Running v1.1.1 of counterparty-server.
Downloading database from https://s3.amazonaws.com/counterparty-bootstrap/counterparty-db-testnet.latest.tar.gz...
100.0% 52158464 / 52151822
Extracting to "/home/xcp/.local/share/counterparty"...
Cleaning up...
$ cat /home/xcp/.config/counterparty-server/server.conf | grep data
data-dir=/blockchain/bitcoin/data/counterparty/
database-file=/blockchain/bitcoin/data/counterparty/counterparty.9.testnet.db
In this particular case it would be nice if at least data-dir
was recognized.
I first installed Fed Node and noticed counterparty-client is not installed. When I installed counterparty-cli, it threw this error:
Using /usr/lib/python3/dist-packages
Finished processing dependencies for counterparty-cli==1.0.0
writing list of installed files to '/tmp/pip-lt8uw0eq-record/install-record.txt'
running generate_configuration_files
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip_build_root/counterparty-cli/setup.py", line 116, in <module>
setup(**setup_options)
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip_build_root/counterparty-cli/setup.py", line 28, in run
self.run_command('generate_configuration_files')
File "/usr/lib/python3.4/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip_build_root/counterparty-cli/setup.py", line 21, in run
generate_config_files()
File "/tmp/pip_build_root/counterparty-cli/counterpartycli/setup.py", line 140, in generate_config_files
from counterpartycli.server import CONFIG_ARGS as SERVER_CONFIG_ARGS
File "/tmp/pip_build_root/counterparty-cli/counterpartycli/server.py", line 10, in <module>
log.set_up(logger)
File "/usr/local/lib/python3.4/dist-packages/counterparty_lib-9.49.4-py3.4.egg/counterpartylib/lib/log.py", line 55, in set_up
requests.packages.urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'packages'
----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/counterparty-cli/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lt8uw0eq-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/counterparty-cli
Storing debug log for failure in /home/rippler/.pip/pip.log
After I listed pip3 packages and it's there, but when I run it, it doesn't run.
counterparty-cli (1.0.0)
counterparty-lib (9.49.4)
Here's what I get.
counterparty-client
Traceback (most recent call last):
File "/usr/local/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0', 'console_scripts', 'counterparty-client')()
File "/usr/local/lib/python3.4/dist-packages/counterparty_cli-1.0.0-py3.4.egg/counterpartycli/__init__.py", line 11, in client_main
from counterpartycli import client
File "/usr/local/lib/python3.4/dist-packages/counterparty_cli-1.0.0-py3.4.egg/counterpartycli/client.py", line 20, in <module>
from counterpartycli import util
File "/usr/local/lib/python3.4/dist-packages/counterparty_cli-1.0.0-py3.4.egg/counterpartycli/util.py", line 26, in <module>
log.set_up(logger)
File "/usr/local/lib/python3.4/dist-packages/counterparty_lib-9.49.4-py3.4.egg/counterpartylib/lib/log.py", line 55, in set_up
requests.packages.urllib3.disable_warnings()
AttributeError: 'module' object has no attribute 'packages'
I tried with requests v2.3.0 as well, same thing.
Similar issue:
https://lists.debian.org/debian-python/2014/11/msg00021.html
On testnet, after burning all available BTC at n1LFjn1JVeoSgopz4bhvnb3tS4bjZmgwQK
, the counterparty-client wallet
cmd did not display unnamed assets A1111111111111111111
or A2222222222222222222
.
https://testnet.blockscan.com/address/n1LFjn1JVeoSgopz4bhvnb3tS4bjZmgwQK
Since the wallet
cmd still did not display XCP or A111 or A222 balances after 5 confirmations, I tried running the balances
cmd:
counterparty-client --config-file ~/.config/counterparty/client.testnet.conf balances n1LFjn1JVeoSgopz4bhvnb3tS4bjZmgwQK
[INFO] Running v1.1.1 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-client')()
File "/usr/lib/python3.4/site-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/lib/python3.4/site-packages/counterpartycli/client.py", line 257, in main
view = console.get_view(args.action, args)
File "/usr/lib/python3.4/site-packages/counterpartycli/console.py", line 8, in get_view
return wallet.balances(args.address)
File "/usr/lib/python3.4/site-packages/counterpartycli/wallet/__init__.py", line 198, in balances
'BTC': get_btc_balance(address)
File "/usr/lib/python3.4/site-packages/counterpartycli/wallet/__init__.py", line 75, in get_btc_balance
return WALLET().get_btc_balance(address)
File "/usr/lib/python3.4/site-packages/counterpartycli/wallet/btcwallet.py", line 57, in get_btc_balance
if output['address'] == addresses:
NameError: name 'addresses' is not defined
Running pip3 install --pre --upgrade counterparty-cli
:
C:\Windows\System32>pip3 install --pre --upgrade counterparty-cli
Downloading/unpacking counterparty-cli from https://pypi.python.org/packages/source/c/counterparty-cli/counterparty-cli-1.0.0rc5.tar.gz#md5=569c292c58
1c63c3d9c72b387be0d9d4
Downloading counterparty-cli-1.0.0rc5.tar.gz
Running setup.py egg_info for package counterparty-cli
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 5639: character maps to <undefined>
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "C:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 5639: character maps to <undefined>
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in C:\Users\hal_AD~1\AppData\Local\Temp\pip_build_sean\counterparty-cli
Storing complete log in C:\Users\hal_ADMIN\pip\pip.log
Getting this error when trying the new Windows package:
C:\Users\millz\Desktop\coutnerwallet\counterparty-cli-win32-1.0.0>counterparty-client.exe
Traceback (most recent call last):
File "counterparty-client", line 10, in <module>
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "C:\counterparty\counterparty-cli\counterpartycli\client.py", line 27, in
<module>
File "C:\Users\millz\Desktop\coutnerwallet\counterparty-cli-win32-1.0.0\librar
y\counterparty\lib\util_windows.py", line 10, in <module>
class SanitizedRotatingFileHandler(logging.handlers.RotatingFileHandler):
AttributeError: 'module' object has no attribute 'handlers'
Here's the configuration file:
C:\Users\millz\AppData\Roaming\counterparty-client\counterparty-client.conf:
[Default]
wallet-name = bitcoincore
wallet-connect = localhost
wallet-user = rpcuser
wallet-password = password
counterparty-rpc-host = localhost
counterparty-rpc-user = rpcuser
counterparty-rpc-password = password
sudo pip3 install counterparty-cli
I get these errors.
copying counterpartylib/protocol_changes.json -> build/lib/counterpartylib
installing to build/bdist.linux-x86_64/wheel
running install
Checking .pth file support in build/bdist.linux-x86_64/wheel/
/usr/bin/python3 -E -c pass
TEST FAILED: build/bdist.linux-x86_64/wheel/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
build/bdist.linux-x86_64/wheel/
and your PYTHONPATH environment variable currently contains:
''
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
I got 0.099 BTC on this testnet address:
$ counterparty-client --config-file /home/xcp/.config/counterparty/client.conf --testnet burn --source mt9WRXRphy3yDx1rg6XMV8Y7DtMHxqtZy2 --quantity 0.01
[INFO] Running v1.1.0 of counterparty-client.
[INFO] Transaction (unsigned): 01000000015c44f2fe3cec961f43e5697baaa6f69e10be1629fc93c1af44568a9c2789eb9b000000001976a9148a8b4dc6e22f1f577ae648891c1e4c274e8cb3c488acffffffff0240420f00000000001976a914a11b66a67b3ff69671c8f82254099faf374b800e88ac303bb007000000001976a9148a8b4dc6e22f1f577ae648891c1e4c274e8cb3c488ac00000000
Sign and broadcast? (y/N) y
[INFO] Transaction (signed): 01000000015c44f2fe3cec961f43e5697baaa6f69e10be1629fc93c1af44568a9c2789eb9b000000006b483045022100bd1b94dc3d76dbacc550f3ad25ce5f1474fd7d306be9bd9329cf7869da5d5bc8022050cebad6a1a12cd22f9814eca265988031d5bb29d4846638fcb688320d34f309012102762a86fa9404ff35bf1c45b4df00ac94f296b6594a2b06b6bd74c87ec7f39d36ffffffff0240420f00000000001976a914a11b66a67b3ff69671c8f82254099faf374b800e88ac303bb007000000001976a9148a8b4dc6e22f1f577ae648891c1e4c274e8cb3c488ac00000000
ERROR:root:Unhandled Exception
Traceback (most recent call last):
File "/usr/local/bin/counterparty-client", line 9, in <module>
load_entry_point('counterparty-cli==1.1.0', 'console_scripts', 'counterparty-client')()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/__init__.py", line 12, in client_main
client.main()
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/client.py", line 251, in main
tx_hash = wallet.send_raw_transaction(signed_tx_hex)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/wallet/__init__.py", line 81, in send_raw_transaction
return WALLET().send_raw_transaction(tx_hex)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/wallet/bitcoincore.py", line 65, in send_raw_transaction
return rpc('sendrawtransaction', [tx_hex])
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/util.py", line 95, in wallet_api
return rpc(config.WALLET_URL, method, params=params, ssl_verify=config.WALLET_SSL_VERIFY)
File "/usr/local/lib/python3.4/dist-packages/counterpartycli/util.py", line 89, in rpc
raise RPCError('{}'.format(response_json['error']))
counterpartycli.util.RPCError: {'code': -25, 'message': ''}
sudo pip3 install counterparty-cli
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pytest
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/counterparty-cli
Storing debug log for failure in /home/user/.pip/pip.log
Install missing modules and continue:
user@ubuntu:~$ sudo pip3 install pytest_cov
Downloading/unpacking pytest-cov
Downloading pytest_cov-2.0.0-py2.py3-none-any.whl
user@ubuntu:~$ sudo apt-get install python3-apsw
After this counterparty-cli
can be installed using pip3.
...
removing '/usr/local/lib/python3.4/dist-packages/counterparty_cli-1.1.1.egg-info' (and everything under it)
Copying counterparty_cli.egg-info to /usr/local/lib/python3.4/dist-packages/counterparty_cli-1.1.1.egg-info
running install_scripts
Installing counterparty-client script to /usr/local/bin
Installing counterparty-server script to /usr/local/bin
running generate_configuration_files
I cloned from git and installed via setup.py
. Until rc5
, --help
would provide good help. Now I get this:
C:\Python34\Scripts>counterparty-client.exe --h
usage: counterparty-client [-h] [-V] [--config-file CONFIG_FILE]
Counterparty CLI for counterparty-server
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--config-file CONFIG_FILE
the location of the configuration file
Isn't that a little too spartan?
I am having some issues with creating issuances via the JSON-RPC... I am copying the example issuance from the API page...only value I am changing is the source, and adding "pubkey": null
payload={
"jsonrpc": "2.0",
"method": "create_issuance",
"id": 791679928,
"params": {
"source": "1AssetiB9oec9pmbTThvCLFqBPcLSaQGjB",
"asset": "MYASSET",
"quantity": 1000,
"description": "my asset is cool",
"divisible": false,
"pubkey": null
}
}
response from server is :
{
"error": {
"data": {
"args": [
"argument should be bytes, buffer or ASCII string, not <class 'NoneType'>"
],
"message": "argument should be bytes, buffer or ASCII string, not <class 'NoneType'>",
"type": "APIError"
},
"message": "Server error",
"code": -32000
},
"id": 791679928,
"jsonrpc": "2.0"
}
Links like https://pypip.in/py_versions/counterparty-cli/badge.svg (in readme files) are broken because the host is frequently down.
Consider switching to another host. See badges/pypipins#37 (comment)
Should be done across all repos that have links to that domain.
divisible
should default to True
, but here it can't work without it being setissuance --help
it is not clear what are the options for divisible
(it seems the lack of --divisible
would mean undivisible, but in practice it doesn't). Can this be clarified in online help?counterparty-client.exe --config-file TESTNET-counterparty-client.conf issuance --source mkZ6ECVZYtTE6iGZ6wvBfkw49KAvsGhCM --quantity XCPRULEZ --description TESTASSET --asset XCPRULEZ
←[31m[ERROR] Unhandled Exception←[0m
Traceback (most recent call last):
File "c:\Python34\Scripts\counterparty-client-script.py", line 9, in <module>
load_entry_point('counterparty-cli==1.0.0', 'console_scripts', 'counterparty-client')()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0-py3.4.egg\counterpartycli\__init__.py", line 12, in client_main
client.main()
File "C:\Python34\lib\site-packages\counterparty_cli-1.0.0-py3.4.egg\counterpartycli\client.py", line 727, in main
quantity = util.value_in(args.quantity, None, divisible=args.divisible)
TypeError: value_in() got an unexpected keyword argument 'divisible'←[0m
The automatic generation of the configuration file doesn't work as expected if counterparty-cli
in installed with sudo
(the config files are placed in /root/
).
another option is to do something like (untested):
os.environ['XDG_CONFIG_HOME'] = os.path.expanduser("~%s/.config" % os.environ.get('SUDO_USER', ''))
(edited)then use appdirs.user_config_dir and it should work with sudo
but only do this for non mac/non windows. on nix, this should preserve the existing functionality, even when sudo is in use (and work if sudo is not in use, as well) (edited)
From: https://github.com/CounterpartyXCP/Documentation/blob/master/CLI/counterparty-cli.md
* Check the status of the server with: $ counterparty-client get_running_info
But that action is invalid.
counterparty-client: error: argument action: invalid choice: 'get_running_info' (choose from 'send', 'order', 'btcpay', 'issuance', 'broadcast', 'bet', 'dividend', 'burn', 'cancel', 'rps', 'rpsresolve', 'publish', 'execute', 'destroy', 'balances', 'asset', 'wallet', 'pending', 'market')
Moved from here: CounterpartyXCP/counterparty-core#182
$ counterparty-client getinfo
[INFO] Running v1.1.1 of counterparty-client.
Unhandled Exception
Traceback (most recent call last):
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/bin/../lib/python3.4/encodings/idna.py", line 167, in encode
raise UnicodeError("label too long")
UnicodeError: label too long
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/bin/counterparty-client", line 9, in
load_entry_point('counterparty-cli==1.1.1', 'console_scripts', 'counterparty-client')()
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/counterpartycli/init.py", line 12, in client_main
client.main()
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/counterpartycli/client.py", line 257, in main
view = console.get_view(args.action, args)
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/counterpartycli/console.py", line 16, in get_view
return util.api('get_running_info')
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/counterpartycli/util.py", line 92, in api
return rpc(config.COUNTERPARTY_RPC, method, params=params, ssl_verify=config.COUNTERPARTY_RPC_SSL_VERIFY)
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/counterpartycli/util.py", line 67, in rpc
response = rpc_session.post(url, data=json.dumps(payload), headers=headers, verify=ssl_verify, timeout=config.REQUESTS_TIMEOUT)
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/lib/python3.4/site-packages/requests/sessions.py", line 508, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/lib/python3.4/site-packages/requests/sessions.py", line 456, in request
prep.url, proxies, stream, verify, cert
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/lib/python3.4/site-packages/requests/sessions.py", line 614, in merge_environment_settings
env_proxies = get_environ_proxies(url) or {}
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/lib/python3.4/site-packages/requests/utils.py", line 534, in get_environ_proxies
if should_bypass_proxies(url):
File "/Users/tomoaki/Documents/workspace_py/counterparty-cli/lib/python3.4/site-packages/requests/utils.py", line 523, in should_bypass_proxies
bypass = proxy_bypass(netloc)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 2441, in proxy_bypass
return proxy_bypass_macosx_sysconf(host)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 2425, in proxy_bypass_macosx_sysconf
return _proxy_bypass_macosx_sysconf(host, proxy_settings)
File "/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 2398, in _proxy_bypass_macosx_sysconf
hostIP = socket.gethostbyname(hostonly)
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label too long)
Hello there. I think this commit should probably be in the master branch. Thanks.
counterparty-server
fileInstalling collected packages: counterparty-cli, counterparty-lib
Running setup.py install for counterparty-cli
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\rippler_AD~1\AppData\Local\Temp\pip_build_rippler\counterparty-cli\setup.py", line 174, in <module>
os.makedirs(new_server_appdir)
File "C:\Python34\lib\os.py", line 237, in makedirs
mkdir(name, mode)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\rippler_ADMIN\\AppData\\Roaming\\Counterparty\\counterparty-server'
Complete output from command C:\Python34\python.exe -c "import setuptools;__file__='C:\\Users\\rippler_AD~1\\AppData\\Local\\Temp\\pip_build_rippler
nterparty-cli\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\rippler_AD~1\AppData
l\Temp\pip-5qoiuv8b-record\install-record.txt --single-version-externally-managed:
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\counterpartycli
copying counterpartycli\client.py -> build\lib\counterpartycli
copying counterpartycli\server.py -> build\lib\counterpartycli
copying counterpartycli\util.py -> build\lib\counterpartycli
copying counterpartycli\__init__.py -> build\lib\counterpartycli
creating build\lib\counterpartycli\wallet
copying counterpartycli\wallet\bitcoincore.py -> build\lib\counterpartycli\wallet
copying counterpartycli\wallet\__init__.py -> build\lib\counterpartycli\wallet
running build_scripts
creating build\scripts-3.4
copying and adjusting bin\counterparty-client -> build\scripts-3.4
copying and adjusting bin\counterparty-server -> build\scripts-3.4
running install_lib
creating C:\Python34\Lib\site-packages\counterpartycli
copying build\lib\counterpartycli\client.py -> C:\Python34\Lib\site-packages\counterpartycli
copying build\lib\counterpartycli\server.py -> C:\Python34\Lib\site-packages\counterpartycli
copying build\lib\counterpartycli\util.py -> C:\Python34\Lib\site-packages\counterpartycli
creating C:\Python34\Lib\site-packages\counterpartycli\wallet
copying build\lib\counterpartycli\wallet\bitcoincore.py -> C:\Python34\Lib\site-packages\counterpartycli\wallet
copying build\lib\counterpartycli\wallet\__init__.py -> C:\Python34\Lib\site-packages\counterpartycli\wallet
copying build\lib\counterpartycli\__init__.py -> C:\Python34\Lib\site-packages\counterpartycli
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\client.py to client.cpython-34.pyc
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\server.py to server.cpython-34.pyc
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\util.py to util.cpython-34.pyc
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\wallet\bitcoincore.py to bitcoincore.cpython-34.pyc
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\wallet\__init__.py to __init__.cpython-34.pyc
byte-compiling C:\Python34\Lib\site-packages\counterpartycli\__init__.py to __init__.cpython-34.pyc
running install_egg_info
running egg_info
writing requirements to counterparty_cli.egg-info\requires.txt
writing top-level names to counterparty_cli.egg-info\top_level.txt
counterparty-lib
then counterparty-cli
installs counterparty-lib
9.49.3counterparty-cli
first, then upgrade counterparty-lib
to 9.49.4A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.