Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development' into jsonrpc1
Browse files Browse the repository at this point in the history
* development:
  changelog: start 0.4.7-dev entry
  symlink changelog into docs/source
  Bump version: 0.4.6 → 0.4.7-dev
  Bump version: 0.4.6-dev → 0.4.6
  Combine 2 changelogs into 1, and symlink into docs
  Bump version: 0.4.6 → 0.4.7-dev
  Bump version: 0.4.6-dev → 0.4.6
  Combine 2 changelogs into 1, and symlink into docs
  CHANGELOG: added recent additions to the dev branch
  Added support for StateTransaction and StateDescriptors (#193)
  remove PWDatabase singleton to allow multiple open sqlite databases at once
  Getting Started update (#178)
  added tests for new functionality
  adding ability to specify tx attrs with send command
  Incorporate feedback
  Make command responses more consistent
  Minor cleanups
  • Loading branch information
metachris committed Jan 24, 2018
2 parents 8679538 + da42918 commit f168115
Show file tree
Hide file tree
Showing 26 changed files with 668 additions and 304 deletions.
28 changes: 0 additions & 28 deletions CHANGELOG.md

This file was deleted.

60 changes: 60 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Changelog
=========

All notable changes to this project following the ``0.4.0`` release will be documented in this file.

[0.4.7-dev] work in progress
----------------------------

- ...

[0.4.6] 2018-01-24
------------------

- Added support for StateTransaction and StateDescriptors (`PR #193 <https://github.com/CityOfZion/neo-python/pull/193>`_)
- Allow multiple open wallets (`PR #185 <https://github.com/CityOfZion/neo-python/pull/185>`_)
- Added ability to include transaction attributes with the send command. example: ``send neo APRgMZHZubii29UXF9uFa6sohrsYupNAvx 10 --tx-attr={'usage':241,'data':'My Remark'}`` (`PR #184 <https://github.com/CityOfZion/neo-python/pull/184>`_)
- Notification REST API (`PR #177 <https://github.com/CityOfZion/neo-python/pull/177>`_, `examples/notification-rest-api-server.py <https://github.com/CityOfZion/neo-python/blob/development/examples/notification-rest-api-server.py>`_)
- Minor cleanups and documentation updates

[0.4.5] 2018-01-18
------------------

- updated ``neo-boa`` to ``0.2.2``, added support for array ``REMOVE`` VM opcodes
- moved core functions to `neocore <https://github.com/CityOfZion/neo-python-core>`_
- better LevelDB support for OSX
- dependency udates
- Makefile with some useful commands
- ability to claim GAS from SC address
- lots of documentation
- various small bugfixes

[0.4.3] 2017-12-21
------------------

- updated ``neo-boa`` to ``0.2.1``
- added support for array ``REVERSE`` and ``APPEND`` VM opcodes

[0.4.3] 2017-12-21
------------------

- updated ``neo-boa`` to ``0.2.1``
- added support for array ``REVERSE`` and ``APPEND`` VM opcodes


[0.4.2] 2017-12-18
------------------

- updated ``neo-boa`` to ``0.2.0``
- added support for `debug storage <https://github.com/CityOfZion/neo-python/pull/120>`_


[0.4.1] 2017-12-15
------------------

- added support for runtime notifications from verification contracts
- added support for checking verification during ``mintTokens`` invoke
- updated prompt help
- added additional SC Api ( ``Neo.Runtime.GetTime``, ``Neo.Transaction.GetUnspentCoins``, ``Neo.Header.GetIndex``)
- added support for dynamically defined smart contract execution
- added ability to alias an address in the wallet
124 changes: 71 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
### What does it currently do

- This project aims to be a full port of the original C#
[NEO project](https://github.com/neo-project)
[NEO project](https://github.com/neo-project)
- Run a Python based P2P node
- Interactive CLI for configuring node and inspecting blockchain
- Build, deploy, and run smart contracts
- Runs smart contracts on the blockchain in a Python virtual machine
- Very basic Wallet functionality (not fully tested, please do not use on mainnet)
- [NEP2](https://github.com/neo-project/proposals/blob/master/nep-2.mediawiki>) and [NEP5](https://github.com/neo-project/proposals/blob/master/nep-5.mediawiki) compliant wallet functionality
- [NEP2](https://github.com/neo-project/proposals/blob/master/nep-2.mediawiki>) and
[NEP5](https://github.com/neo-project/proposals/blob/master/nep-5.mediawiki)
compliant wallet functionality
- RPC Client
- ``Runtime.Log`` and ``Runtime.Notify`` event monitoring

- `Runtime.Log` and `Runtime.Notify` event monitoring

### What will it do

Expand All @@ -46,34 +48,45 @@

### Documentation

- Installation, Configuration, and usage documentation available at [Read The Docs](https://neo-python.readthedocs.io/en/latest/)
The full documentation on how to install, configure and use neo-python can be
found at [Read The Docs](https://neo-python.readthedocs.io/en/latest/).

### Get Help or give help
### Get help or give help

- Open a new [issue](https://github.com/CityOfZion/neo-python/issues/new) if you encounter a problem.
- Or ping **@localhuman** or **@metachris** on the [NEO Discord](https://discord.gg/R8v48YA).
- Pull requests welcome. You can help with wallet functionality, writing tests or documentation, or on any other feature you deem awesome. All successful pull requests will be rewarded with one photo of a cat or kitten.

- Pull requests welcome. You can help with wallet functionality, writing tests
or documentation, or on any other feature you deem awesome. All successful
pull requests will be rewarded with one photo of a cat or kitten.

## Getting started

You will need to install the libleveldb library. Install [Python 3.5](https://www.python.org/downloads/release/python-354/) to make sure you don't run into any issues with your version of Python being different than the current maintainer's version. Note that Python 3.6 is not currently supported due to incompatibilities with the byteplay module.
neo-python has two System dependencies (everything else is covered with `pip`):

- [LevelDB](https://github.com/google/leveldb)
- [Python 3.5.4](https://www.python.org/downloads/release/python-354) (3.6 and up is currently not supported due to its `byteplay3` dependency)

We have published a Youtube [video](https://youtu.be/oy6Z_zd42-4) to help get
you started. There are many more videos under the
[CityOfZion](https://www.youtube.com/channel/UCzlQUNLrRa8qJkz40G91iJg) Youtube
channel, check them out.

We have published a Youtube [video](https://youtu.be/oy6Z_zd42-4) to help get you started with this library. There are other videos under the [CityOfZion](https://www.youtube.com/channel/UCzlQUNLrRa8qJkz40G91iJg) Youtube channel.

##### OSX:
### LevelDB

#### OSX

```
brew install leveldb
```

##### Ubuntu/Debian
#### Ubuntu/Debian

```
apt-get install libleveldb-dev python3.5-dev python3-pip python3-venv libssl-dev g++
```

##### Centos/Redhat/Fedora
#### Centos/Redhat/Fedora

This is a bit more tricky...

Expand All @@ -88,34 +101,44 @@ yum install -y epel-release
yum install -y readline-devel leveldb-devel libffi-devel gcc-c++ redhat-rpm-config gcc python-devel openssl-devel
```

### For all of these, make sure that the `Chains` directory in your project has the proper write permissions
#### Windows

##### Windows
Help needed. Installing the Python package plyvel seems to require C++ compiler
support tied to Visual Studio and libraries.

Not sure. Installing the Python package plyvel seems to require C++ compiler support tied to Visual Studio and libraries.
### Python 3.5

-------------------
neo-python is currently only compatible with **Python 3.5** (due to its `byteplay3` dependency).

On *nix systems, install Python 3.5 via your package manager, or download an installation package
from the [official homepage](https://www.python.org/downloads/release/python-354).

### Virtual Environment

Now navigate into the project, make a Python 3 virtual environment and activate
it via
It is recommended to put all project dependencies into its own virtual environment,
this way we don't pollute the global installation which could lead to version conflicts.

```
python3.5 -m venv venv
source venv/bin/activate
```

Then install the requirements:
Now let's install neo-python's dependencies:

```
pip install -U setuptools pip wheel
pip install -e .
```

-------------------

## Running
After installing requirements and activating your environment, there is an easy
to use `prompt.py` file for you to run the node as well as some basic interactivity

Before running the neo-python CLI, make sure that the `Chains` directory in the
project has the proper write permissions.

After installing requirements and activating the environment, there is an easy
to use CLI (`prompt.py`) that starts the node and allows some basic interactivity.

```
python prompt.py
Expand All @@ -127,7 +150,10 @@ Progress: 1054913 / 1237188
neo>
```

You can query for a block in the current server by hash or by block index:
By default, the CLI connects to the **TestNet** (see below how to switch to
MainNet or PrivNet).

Let's query for a block in the current server by hash or by block index:

```
python prompt.py
Expand All @@ -151,11 +177,13 @@ neo> block 122235
neo>
```


#### Available Wallet commands
### Available Wallet commands

```
help
python prompt.py
NEO cli. Type 'help' to get started
neo> help
create wallet {wallet_path}
open wallet {wallet_path}
Expand All @@ -167,10 +195,11 @@ import wif { WIF }
send { ASSET_ID } { ADDRESS } { AMOUNT }
```

### Running on MainNet

#### Extra notes

To run the prompt on mainnet, you can use the cli argument `-m`:
To run the prompt on MainNet, you can use the CLI argument `-m` (eg. `python
prompt.py -m`), for running on PrivNet you can use `-p`. Be sure to check out
the details of the parameters:

```
$ python prompt.py -h
Expand All @@ -188,45 +217,28 @@ optional arguments:
--version show program's version number and exit
```

On OSX, if you would like to run the process in the background, even when your computer is sleeping, you can use the built in `caffeinate` command

```
caffeinate python prompt.py
```

### Logging

Currently, `prompt.py` logs to `prompt.log`

## Tests

Tests are important. Currently there are not enough, but we are working on that. You can start them by running this commands:

make test
make coverage
Note that some of the unit tests use a giant blockchain fixture database
(~800MB). This file is not kept in the repo, but are downloaded the first
time the tests are run, this can take some time (depending on the internet
connection), but happens only once.

Note that some of the unit tests use a giant blockchain fixture database ( around 800mb ). This file is not kept in the repo.

When running tests the first time, the test setup will try to download the file and extract it to the proper directory.
**Long story short**: the first time you run your tests, it will take a while to download those fixtures. After that it should be pretty quick.


## Useful commands
### Useful commands

make lint
make test
make coverage
make docs


## Updating the version number and releasing new versions of neo-python

(Only for admins)

This is a checklist for releasing a new version:

.. code-block:: console

# In case you want to increase the version number again (eg. scope changed from patch to minor):
bumpversion --no-tag patch|minor|major

Expand All @@ -245,15 +257,21 @@ This is a checklist for releasing a new version:

## Troubleshooting

If you encounter any problems, please take a look at the [installation section](https://neo-python.readthedocs.io/en/latest/install.html#further-install-notes) in the docs, and if that doesn't help open an issue. We'll try to help.
If you run into problems, check these things before ripping out your hair:

* Double-check that you are using Python 3.5.x
* Update the project dependencies (`pip install -e .`)
* If you encounter any problems, please take a look at the [installation
section](https://neo-python.readthedocs.io/en/latest/install.html#further-install-notes)
in the docs, and if that doesn't help open an issue. We'll try to help.
* You can reach us on the [NEO Discord](https://discord.gg/R8v48YA), or simply file
a [GitHub issue](https://github.com/CityOfZion/neo-python/issues/new).

## License

- Open-source [MIT](https://github.com/CityOfZion/neo-python/blob/master/LICENSE.md).
- Main author is [@localhuman](https://github.com/localhuman).


## Donations

Accepted at __ATEMNPSjRVvsXmaJW4ZYJBSVuJ6uR2mjQU__
46 changes: 0 additions & 46 deletions docs/source/changelog.rst

This file was deleted.

1 change: 1 addition & 0 deletions docs/source/changelog.rst
Loading

0 comments on commit f168115

Please sign in to comment.