Skip to content

Commit

Permalink
Merge pull request #375 from RavenProject/release_2.1.0
Browse files Browse the repository at this point in the history
Release 2.1.0 - Merge to Master
  • Loading branch information
cfrogjump authored Oct 8, 2018
2 parents c8a772c + 0e86fe6 commit 293532c
Show file tree
Hide file tree
Showing 233 changed files with 12,834 additions and 3,378 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This issue tracker is only for technical issues related to bitcoin-core.

General bitcoin questions and/or support requests and are best directed to the [Bitcoin StackExchange](https://bitcoin.stackexchange.com).
General ravencoin questions and/or support requests and are best directed to the [Ravencoin Discord](https://discord.gg/GwtXdyc).

For reporting security issues, please read instructions at [https://bitcoincore.org/en/contact/](https://bitcoincore.org/en/contact/).
For reporting security issues, please direct message one of the core developers in discord.

### Describe the issue

Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ env:
- CCACHE_COMPRESS=1
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
- SDK_URL=https://ravencoin.org/depends-sources/sdks
- PYTHON_DEBUG=1
- WINEDEBUG=fixme-all
matrix:
# ARM
Expand Down Expand Up @@ -75,7 +74,7 @@ script:
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib
- if [ "$RUN_TESTS" = "true" ]; then travis_wait 30 make $MAKEJOBS check VERBOSE=1; fi
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then extended="--extended --exclude pruning,dbcrash"; fi
- if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --coverage --quiet ${extended}; fi
- if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet ${extended}; fi
after_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ Bitcoin is and always should be focused on its goals of being a better form of m

In the new global economy, borders and jurisdictions will be less relevant as more assets are tradable and trade across borders is increasingly frictionless. In an age where people can move significant amounts of wealth instantly using Bitcoin, global consumers will likely demand the same efficiency for their securities and similar asset holdings.

For such a global system to work it will need to be independent of regulatory jurisdictions. This is not due to ideological belief but practicality: if the rails for blockchain asset transfer are not censorship resistance and jurisdiction agnostic, any given jurisdiction may be in conflict with another. In legacy systems, wealth was generally confined in the jurisdiction of the holder and therefor easy to control based on the policies of that jurisdiction. Because of the global nature of blockchain technology any protocol level ability to control wealth would potentially place jurisdictions in conflict and will not be able to operate fairly.
For such a global system to work it will need to be independent of regulatory jurisdictions. This is not due to ideological belief but practicality: if the rails for blockchain asset transfer are not censorship resistance and jurisdiction agnostic, any given jurisdiction may be in conflict with another. In legacy systems, wealth was generally confined in the jurisdiction of the holder and therefore easy to control based on the policies of that jurisdiction. Because of the global nature of blockchain technology any protocol level ability to control wealth would potentially place jurisdictions in conflict and will not be able to operate fairly.

11 changes: 11 additions & 0 deletions assets/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@ Issue assets from a .csv file.
Check for assets that have signed documents.
* Set the constants at the top of signed_promises.py
* ```python signed_promises.py```

### Block Facts
Loops through blocks and prints out block information.
* Set the constants at the top of blockfacts.py
* ```python blockfacts.py```

### Transaction Facts
Loops through blocks and transactions and prints out tx information.
* Uncomment out print lines to print out more facts
* Set the constants at the top of txfacts.py
* ```python txfacts.py```
101 changes: 101 additions & 0 deletions assets/tools/asset_audit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env python3
# Script to audit the assets
# Reads the asset (amount has all issuances)
# Reads the balances in every address for the asset.
# Compares the two numbers to checks that qty of all assets are accounted for

import subprocess
import json


#Set this to your raven-cli program
cli = "raven-cli"

mode = "-testnet"
rpc_port = 18766
#mode = "-regtest"
#rpc_port = 18443

#Set this information in your raven.conf file (in datadir, not testnet3)
rpc_user = 'rpcuser'
rpc_pass = 'rpcpass555'

def listassets(filter):
rpc_connection = get_rpc_connection()
result = rpc_connection.listassets(filter, True)
return(result)

def listaddressesbyasset(asset):
rpc_connection = get_rpc_connection()
result = rpc_connection.listaddressesbyasset(asset)
return(result)

def rpc_call(params):
process = subprocess.Popen([cli, mode, params], stdout=subprocess.PIPE)
out, err = process.communicate()
return(out)

def generate_blocks(n):
rpc_connection = get_rpc_connection()
hashes = rpc_connection.generate(n)
return(hashes)

def get_rpc_connection():
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
connection = "http://%s:%[email protected]:%s"%(rpc_user, rpc_pass, rpc_port)
#print("Connection: " + connection)
rpc_connection = AuthServiceProxy(connection)
return(rpc_connection)

def audit(filter):
assets = listassets(filter)
print("Auditing: " + filter)
#print(assets)
print("Asset count: " + str(len(assets)))
count = 0
max_dist_asset_name = ""
max_dist_address_count = 0
for asset, properties in assets.items():
count=count+1
total_issued = 0
total_for_asset = 0

print("Auditing asset (" + str(count) + "): " + asset)
for key, value in properties.items():
if (key == 'amount'):
total_issued += value
print("Total issued for " + asset + " is: " + str(value))
address_qtys = listaddressesbyasset(asset)

address_count = 0
for address, qty in address_qtys.items():
address_count = address_count + 1
print(address + " -> " + str(qty))
total_for_asset += qty

print("Total in addresses for asset " + asset + " is " + str(total_for_asset))

#Calculate stats
if address_count > max_dist_address_count:
max_dist_asset_name = asset
max_dist_address_count = address_count

if (total_issued == total_for_asset):
print("Audit PASSED for " + asset)
print("")
else:
print("Audit FAILED for " + asset)
exit()

if len(assets) == count:
print("All " + str(len(assets)) + " assets audited.")
print("Stats:")
print(" Max Distribed Asset: " + max_dist_asset_name + " with " + str(max_dist_address_count) + " addresses.")



if mode == "-regtest": #If regtest then mine our own blocks
import os
os.system(cli + " " + mode + " generate 400")

audit("*") #Set to "*" for all.
45 changes: 45 additions & 0 deletions assets/tools/blockfacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#Shows data from the first 1000 blocks

import random
import os
import subprocess
import json


#Set this to your raven-cli program
cli = "raven-cli"

#mode = "-testnet"
mode = ""
rpc_port = 8766
#Set this information in your raven.conf file (in datadir, not testnet3)
rpc_user = 'rpcuser'
rpc_pass = 'rpcpass555'


def rpc_call(params):
process = subprocess.Popen([cli, mode, params], stdout=subprocess.PIPE)
out, err = process.communicate()
return(out)

def get_blockinfo(num):
rpc_connection = get_rpc_connection()
hash = rpc_connection.getblockhash(num)
blockinfo = rpc_connection.getblock(hash)
return(blockinfo)

def get_rpc_connection():
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
connection = "http://%s:%[email protected]:%s"%(rpc_user, rpc_pass, rpc_port)
#print("Connection: " + connection)
rpc_connection = AuthServiceProxy(connection)
return(rpc_connection)

for i in range(1,1000):
dta = get_blockinfo(i)
print("Block #" + str(i))
print(dta.get('hash'))
print(dta.get('difficulty'))
print(dta.get('time'))
print("")

1 change: 1 addition & 0 deletions assets/tools/issuebulk.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# Script to issue assets on the Ravencoin platform
# Reads from a csv file
# Template Google Spreadsheet at:
Expand Down
1 change: 1 addition & 0 deletions assets/tools/signed_promises.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# Script to find signed contract_urls
# Reads from a Ravencoin node - make sure its running
# Runs through the assets looking for ones with meta data
Expand Down
120 changes: 120 additions & 0 deletions assets/tools/txfacts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#Shows data from the transactions

import random
import os
import subprocess
import json


#Set this to your raven-cli program
cli = "raven-cli"

mode = "-testnet"
mode = ""
rpc_port = 18766
#Set this information in your raven.conf file (in datadir, not testnet3)
rpc_user = 'rpcuser'
rpc_pass = 'rpcpass555'

def get_rpc_connection():
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
connection = "http://%s:%[email protected]:%s"%(rpc_user, rpc_pass, rpc_port)
rpc_conn = AuthServiceProxy(connection)
return(rpc_conn)

rpc_connection = get_rpc_connection()

def rpc_call(params):
process = subprocess.Popen([cli, mode, params], stdout=subprocess.PIPE)
out, err = process.communicate()
process.stdout.close()
process.stderr.close()
return(out)

def get_blockinfo(num):
hash = rpc_connection.getblockhash(num)
blockinfo = rpc_connection.getblock(hash)
return(blockinfo)

def get_block(hash):
blockinfo = rpc_connection.getblock(hash)
return(blockinfo)

def get_rawtx(tx):
txinfo = rpc_connection.getrawtransaction(tx)
return(txinfo)

def get_bci():
bci = rpc_connection.getblockchaininfo()
return(bci)

def decode_rawtx(txdata):
#print("decoding: " + txdata)
txjson = rpc_connection.decoderawtransaction(txdata)
return(txjson)

def decode_script(script):
scriptinfo = rpc_connection.decodescript(script)
return(scriptinfo)

def ipfs_add(file):
print("Adding to IPFS")
import ipfsapi
api = ipfsapi.connect('127.0.0.1', 5001)
res = api.add(file)
print(res)
return(res['Hash'])

def ipfs_get(hash):
import ipfsapi
api = ipfsapi.connect('127.0.0.1', 5001)
res = api.get(hash)
return()

def ipfs_pin_add(hash):
import ipfsapi
api = ipfsapi.connect('127.0.0.1', 5001)
res = api.pin_add(hash)
return(res)

def asset_handler(asset_script):
# print("Type: " + asset_script.get('type'))
# print("Asset: " + asset_script.get('asset_name'))
# print(asset_script.get('amount'))
# print(asset_script.get('units'))
# print("Reissuable: " + str(asset_script.get('reissuable')))
# print("Has IPFS: " + str(asset_script.get('hasIPFS')))
if asset_script.get('hasIPFS') == True:
print(asset_script.get('ipfs_hash'))
ipfs_pin_add(asset_script.get('ipfs_hash'))

#Get the blockheight of the chain
blockheight = get_bci().get('blocks')

for i in range(23500,blockheight):
dta = get_blockinfo(i)
print("Block #" + str(i) + " - " + dta.get('hash'))
#print(dta.get('difficulty'))
#print(dta.get('time'))

tx_in_block = get_block(dta.get('hash'))
txs = tx_in_block.get('tx')
#print(txs)
for tx in txs:
tx_info = get_rawtx(tx)
#print("txinfo: " + tx_info)
tx_detail = decode_rawtx(tx_info)
for vout in tx_detail.get('vout'):
#print("vout: " + str(vout.get('value')))
#print(vout.get('scriptPubKey').get('asm'))
if (vout.get('scriptPubKey').get('asm')[86:98] == "OP_RVN_ASSET"):
#print("Found OP_RVN_ASSET")
#print(vout.get('scriptPubKey').get('hex'))
asset_script = decode_script(vout.get('scriptPubKey').get('hex'))
asset_handler(asset_script)
#print(asset_script)
#print("txdecoded: " + tx_detail.get('vout'))


#print("")

6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/clang-format-diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def main():
sys.exit(p.returncode)

if not args.i:
with open(filename) as f:
with open(filename, encoding="utf8") as f:
code = f.readlines()
formatted_code = StringIO.StringIO(stdout).readlines()
diff = difflib.unified_diff(code, formatted_code,
Expand Down
6 changes: 3 additions & 3 deletions contrib/devtools/copyright_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def file_has_without_c_style_copyright_for_holder(contents, holder_name):
################################################################################

def read_file(filename):
return open(os.path.abspath(filename), 'r').read()
return open(os.path.abspath(filename), 'r', encoding="utf8").read()

def gather_file_info(filename):
info = {}
Expand Down Expand Up @@ -324,13 +324,13 @@ def get_most_recent_git_change_year(filename):
################################################################################

def read_file_lines(filename):
f = open(os.path.abspath(filename), 'r')
f = open(os.path.abspath(filename), 'r', encoding="utf8")
file_lines = f.readlines()
f.close()
return file_lines

def write_file_lines(filename, file_lines):
f = open(os.path.abspath(filename), 'w')
f = open(os.path.abspath(filename), 'w', encoding="utf8")
f.write(''.join(file_lines))
f.close()

Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/github-merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def main():
merge_branch = 'pull/'+pull+'/merge'
local_merge_branch = 'pull/'+pull+'/local-merge'

devnull = open(os.devnull,'w')
devnull = open(os.devnull, 'w', encoding="utf8")
try:
subprocess.check_call([GIT,'checkout','-q',branch])
except subprocess.CalledProcessError as e:
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/test-security-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import unittest

def write_testcode(filename):
with open(filename, 'w') as f:
with open(filename, 'w', encoding="utf8") as f:
f.write('''
#include <stdio.h>
int main()
Expand Down
Loading

0 comments on commit 293532c

Please sign in to comment.