Merge branch 'develop' into feature/token-v1

This commit is contained in:
Jude Nelson
2018-04-19 12:13:22 -04:00
6 changed files with 44 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ immediately transferrable to Blockstack.
Blockstack applications look and feel like traditional Web applications.
Under the hood they use Blockstack APIs for user authentication and storage.
Blockstack handles user authentication using the [Blockstack Naming
Service](docs/blockstack_naming_service)
Service](docs/blockstack_naming_service.md)
(BNS), a decentralized naming and public key infrastructure built on top of the Bitcoin
blockchain. It handles storage using [Gaia](https://github.com/blockstack/gaia), a scalable decentralized
key/value storage system that looks and feels like `localStorage`,

View File

@@ -593,17 +593,44 @@ Get the current Blockstack consensus hash on a blockchain.
},
}
## Get number of names on blockchain [GET /v1/blockchains/{blockchainName}/name_count]
## Get number of names on blockchain [GET /v1/blockchains/{blockchainName}/name_count{?all}]
Get the number of names on a blockchain.
+ Public Endpoint
+ Parameters
+ blockchainName : bitcoin (string) - the given blockchain
+ blockchainName: bitcoin (string) - the given blockchain
+ all: true (enum[string], optional) - include expired names
+ Response 200 (application/json)
+ Body
{
"names_count": 73950
}
{
"names_count": 73950
}
+ Schema
{
'type': 'object',
'properties': {
'names_count': {
'type': 'integer',
'minimum': 0,
},
},
}
+ Response 400 (application/json)
+ Body
{ "error": "Unsupported blockchain" }
+ Schema
{
'type': 'object',
'properties': {
'error': { 'type': 'string' },
},
},
## Get blockchain name record [GET /v1/blockchains/{blockchainName}/names/{name}]
Get the raw blockchain record for a name

View File

@@ -258,7 +258,7 @@ correct environment variables for it to run).
Once this environment has started, you can issue a registration request from curl:
```
curl -X POST --data '{"zonefile": "$ORIGIN baz\n$TTL 3600\n_file URI 10 1 \"file:///tmp/baz.profile.json\"\n", "name": "baz", "owner_address": "14x2EMRz1gf16UzGbxZh2c6sJg4A8wcHLD"}' http://localhost:3000/register/
curl -X POST -H 'Content-Type: application/json' --data '{"zonefile": "$ORIGIN baz\n$TTL 3600\n_file URI 10 1 \"file:///tmp/baz.profile.json\"\n", "name": "baz", "owner_address": "14x2EMRz1gf16UzGbxZh2c6sJg4A8wcHLD"}' http://localhost:3000/register/
```
This registers `baz.foo.id` -- you can check the registrar's status with

View File

@@ -32,7 +32,7 @@ example, the following command runs the test that will create a
zonefile hash, and create an empty profile for it:
```bash
IMAGE=$(docker run -dt -v /tmp:/tmp quay.io/blockstack/integrationtests:develop blockstack-test-scenario blockstack_integration_tests.scenarios.portal_test_env)
IMAGE=$(docker run -dt -v /tmp:/tmp quay.io/blockstack/integrationtests:develop blockstack-test-scenario blockstack_integration_tests.scenarios.browser_env)
```
You can check the status of the test:
@@ -94,15 +94,15 @@ And from the container, set the test environment variables:
$ export BLOCKSTACK_TEST=1 # tells Blockstack CLI that it's running with the test environment
$ export BLOCKSTACK_TESTNET=1 # tells Blockstack CLI to use testnet addresses
$ export BLOCKSTACK_DEBUG=1 # print debug-level output in the CLI; great for troubleshooting
$ export BLOCKSTACK_CLIENT_CONFIG=/tmp/blockstack-run-scenario.blockstack_integration_tests.scenarios.portal_test_env/client/client.ini
$ export BLOCKSTACK_CLIENT_CONFIG=/tmp/blockstack-run-scenario.blockstack_integration_tests.scenarios.browser_env/client/client.ini
```
You can also set these variables with an automated script included in the test
framework:
```bash
$ . $(which blockstack-test-env) portal_env_test
|blockstack-test portal_env_test| $
$ . $(which blockstack-test-env) browser_env
|blockstack-test browser_env| $
```
Your `$PS1` variable will be updated to show the name of the test if you take
@@ -244,7 +244,7 @@ order to "confirm" it.
This example will set up an interactive regtest node that you can connect to via Blockstack Browser
```bash
$ BLOCKSTACK_TEST_CLIENT_RPC_PORT=6270 blockstack-test-scenario --interactive 2 blockstack_integration_tests.scenarios.portal_test_env
$ BLOCKSTACK_TEST_CLIENT_RPC_PORT=6270 blockstack-test-scenario --interactive 2 blockstack_integration_tests.scenarios.browser_env
```
In this example, a block will be generated once every 2 seconds.
@@ -252,7 +252,7 @@ In this example, a block will be generated once every 2 seconds.
You can also do this:
```bash
$ BLOCKSTACK_TEST_CLIENT_RPC_PORT=6270 blockstack-test-scenario --interactive-web 3001 blockstack_integration_tests.scenarios.portal_test_env
$ BLOCKSTACK_TEST_CLIENT_RPC_PORT=6270 blockstack-test-scenario --interactive-web 3001 blockstack_integration_tests.scenarios.browser_env
```
In this example, you will need to manually generate blocks in order to confirm

View File

@@ -880,6 +880,8 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
return self._reply_json({'status': 'available'}, status_code=404)
elif 'failed to load subdomain' in name_rec['error'].lower():
return self._reply_json({'status': 'available'}, status_code=404)
elif 'expired' in name_rec['error'].lower():
return self._reply_json({'error': name_rec['error']}, status_code=404)
else:
return self._reply_json({'error': 'Blockstack daemon error: {}'.format(name_rec['error'])}, status_code=500)
@@ -899,7 +901,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
log.debug("{} is registered_subdomain".format(name))
ret = {
'status': 'registered_subdomain',
'zonefile_txt': zonefile_txt,
'zonefile': zonefile_txt,
'zonefile_hash': storage.get_zonefile_data_hash(zonefile_txt),
'address': name_rec['address'],
'blockchain': 'bitcoin',

View File

@@ -25,3 +25,4 @@ __version_major__ = '0'
__version_minor__ = '19'
__version_patch__ = '0'
__version__ = '{}.{}.{}.0'.format(__version_major__, __version_minor__, __version_patch__)
>>>>>>> develop:blockstack_client/version.py