Skip to content
Snippets Groups Projects
Commit 6c1230e3 authored by Agustin Dorda's avatar Agustin Dorda
Browse files

git ignore de

parents d6af5ee0 94b53cf9
No related branches found
No related tags found
No related merge requests found
...@@ -14,13 +14,11 @@ pip install -r requirements.txt ...@@ -14,13 +14,11 @@ pip install -r requirements.txt
``` ```
- Crear un link simbólico al archivo local_settings.py desde el local settings del entorno en que se encuentre el proyecto - Crear un link simbólico al archivo local_settings.py desde el local settings del entorno en que se encuentre el proyecto
- Ejecutar: - Ejecutar:
- sudo apt-get install libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev memcached - sudo apt-get install libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev
- git clone https://github.com/ethereum/pyethereum/ - git clone https://github.com/ethereum/pyethereum/
- cd pyethereum - cd pyethereum
- python setup.py install - python setup.py install
- Poner en crontab el sig comando reemplazando donde corresponde los directorios
/directorio/del/venv/bin/python /directorio/de/aplicacion/manage.py desatascar_pendientes > /dev/null
### Utilización ### Utilización
- Stamp - Stamp
- Método: POST - Método: POST
......
...@@ -7,9 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY ...@@ -7,9 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
""" """
APP_ROOT = '/opt/project/' APP_ROOT = '/home/python/TsaAPI/'
LOG_ROOT = APP_ROOT + 'logs/'
STATIC_ROOT = APP_ROOT + 'html/' STATIC_ROOT = APP_ROOT + 'html/'
...@@ -17,23 +15,11 @@ ACCOUNT_ADDRESS = '0x25c185dcaed065bac30a0a1cd0688a7aa02896d7' ...@@ -17,23 +15,11 @@ ACCOUNT_ADDRESS = '0x25c185dcaed065bac30a0a1cd0688a7aa02896d7'
HOST_ADDRESS = 'http://10.23.10.72:8501' HOST_ADDRESS = 'http://10.23.10.72:8501'
# Contracts info #Contracts info
CONTRACTS = { CONTRACTS = {
'01': { '01':{
'address': '0x88933138A9Ef6474ee4f255A6395210F4f014d6B', 'address': '0x88933138A9Ef6474ee4f255A6395210F4f014d6B',
'abi': [{"constant": True, "inputs": [{"name": "ots", "type": "string"}], "name": "getHash", 'abi': [{"constant":True,"inputs":[{"name":"ots","type":"string"}],"name":"getHash","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"ots","type":"string"}],"name":"getBlockNumber","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[{"name":"ots","type":"string"},{"name":"file_hash","type":"string"}],"name":"verify","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"ots","type":"string"},{"name":"file_hash","type":"string"}],"name":"stamp","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"}],
"outputs": [{"name": "", "type": "string"}], "payable": False, "stateMutability": "view",
"type": "function"},
{"constant": True, "inputs": [{"name": "ots", "type": "string"}], "name": "getBlockNumber",
"outputs": [{"name": "", "type": "uint256"}], "payable": False, "stateMutability": "view",
"type": "function"}, {"constant": True, "inputs": [{"name": "ots", "type": "string"},
{"name": "file_hash", "type": "string"}],
"name": "verify", "outputs": [{"name": "", "type": "bool"}], "payable": False,
"stateMutability": "view", "type": "function"}, {"constant": False, "inputs": [
{"name": "ots", "type": "string"}, {"name": "file_hash", "type": "string"}], "name": "stamp",
"outputs": [], "payable": False,
"stateMutability": "nonpayable",
"type": "function"}],
}, },
} }
...@@ -47,21 +33,4 @@ PERMANENT_OTS_PREFIX = '1x' ...@@ -47,21 +33,4 @@ PERMANENT_OTS_PREFIX = '1x'
GAS = 250000 GAS = 250000
GAS_PRICE = 1 GAS_PRICE = 1
SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54' SENTRY_URL = 'http://2ec54beaab3b4459a1e5afadea070f98:92aee3f5d91e4e66996a3e0792985541@172.17.30.21:9000/54'
\ No newline at end of file
MEMCACHED_HOST = '172.17.0.1'
MEMCACHED_PORT = 11211 # TIENE QUE SER INT
PENDING_TXS_MEMCACHED_KEY = 'pending_txs'
TEST_MEMCACHED_HOST = MEMCACHED_HOST
TEST_MEMCACHED_PORT = MEMCACHED_PORT
TEST_PENDING_TXS_MEMCACHED_KEY = 'test_pending_txs'
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi-dev',
'SERVER_URL': 'http://10.1.100.67:8200',
'DEBUG': True,
}
...@@ -8,7 +8,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY ...@@ -8,7 +8,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
""" """
APP_ROOT = '/var/www/tsaapi.pp.bfa.local/' APP_ROOT = '/var/www/tsaapi.pp.bfa.local/'
LOG_ROOT = APP_ROOT + 'logs/'
STATIC_ROOT = APP_ROOT + 'html/' STATIC_ROOT = APP_ROOT + 'html/'
STATIC_URL = '/tsa/static/' STATIC_URL = '/tsa/static/'
...@@ -33,10 +32,4 @@ PERMANENT_OTS_PREFIX = '1x' ...@@ -33,10 +32,4 @@ PERMANENT_OTS_PREFIX = '1x'
GAS = 250000 GAS = 250000
GAS_PRICE = 1 GAS_PRICE = 1
SENTRY_URL = 'http://aa30f3ecd3bb4923a7046f197da61e07:47cd9f9ea1e243f6a9f47e2aa40b85c3@10.1.100.118:9000/82' SENTRY_URL = 'http://aa30f3ecd3bb4923a7046f197da61e07:47cd9f9ea1e243f6a9f47e2aa40b85c3@10.1.100.118:9000/82'
\ No newline at end of file
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi-pp',
'SERVER_URL': 'http://10.20.99.87:8200',
'DEBUG': True,
}
...@@ -41,10 +41,4 @@ PERMANENT_OTS_PREFIX = '1x' ...@@ -41,10 +41,4 @@ PERMANENT_OTS_PREFIX = '1x'
GAS = 250000 GAS = 250000
GAS_PRICE = 100000000 GAS_PRICE = 100000000
SENTRY_URL = 'http://36f4f241a007447d8a4441a13055b110:136cb6d1af854b869d13610603fa7321@10.1.100.118:9000/84' SENTRY_URL = 'http://36f4f241a007447d8a4441a13055b110:136cb6d1af854b869d13610603fa7321@10.1.100.118:9000/84'
\ No newline at end of file
ELASTIC_APM = {
'SERVICE_NAME': 'TsaApi',
'SERVER_URL': 'http://10.20.99.87:8200',
'DEBUG': False,
}
...@@ -7,7 +7,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY ...@@ -7,7 +7,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
""" """
import base64
import datetime import datetime
import hashlib import hashlib
import time import time
...@@ -15,7 +14,7 @@ import math ...@@ -15,7 +14,7 @@ import math
from TsaApi.settings import ACCOUNT_ADDRESS, CURRENT_CONTRACT_VERSION, PERMANENT_OTS_PREFIX, TEMPORARY_OTS_PREFIX from TsaApi.settings import ACCOUNT_ADDRESS, CURRENT_CONTRACT_VERSION, PERMANENT_OTS_PREFIX, TEMPORARY_OTS_PREFIX
class Utils: class Utils():
@staticmethod @staticmethod
def sha256_encode(string): def sha256_encode(string):
return hashlib.sha256(string.encode('utf-8')).hexdigest() return hashlib.sha256(string.encode('utf-8')).hexdigest()
...@@ -26,10 +25,8 @@ class Utils: ...@@ -26,10 +25,8 @@ class Utils:
@staticmethod @staticmethod
def get_ots_hash(file_hash): def get_ots_hash(file_hash):
# El ots se genera con los hashes sha256 de (archivo original+timestamp+dirección de la cuenta) + versión del #El ots se genera con los hashes sha256 de (archivo original+timestamp+dirección de la cuenta) + versión del contrato
# contrato return Utils.sha256_encode(str(file_hash + Utils.sha256_encode(str(int(time.time()))) + Utils.sha256_encode(ACCOUNT_ADDRESS))) + CURRENT_CONTRACT_VERSION
return Utils.sha256_encode(str(file_hash + Utils.sha256_encode(str(int(time.time()))) + Utils.sha256_encode(
ACCOUNT_ADDRESS))) + CURRENT_CONTRACT_VERSION
@staticmethod @staticmethod
def decode_contract_call(contract_abi, call_data): def decode_contract_call(contract_abi, call_data):
...@@ -59,9 +56,4 @@ class Utils: ...@@ -59,9 +56,4 @@ class Utils:
@staticmethod @staticmethod
def get_temporary_ots(ots_hash, tx_hash): def get_temporary_ots(ots_hash, tx_hash):
return TEMPORARY_OTS_PREFIX + '-' + ots_hash + '-' + tx_hash return TEMPORARY_OTS_PREFIX + '-' + ots_hash + '-' + tx_hash
\ No newline at end of file
class Base64EncodingService:
def encode(self, stuff):
return base64.b64encode(stuff)
\ No newline at end of file
ipython==7.2.0 asn1crypto==0.24.0
ipython-genutils==0.2.0
pymemcache==2.1.1
elastic-apm==3.0.0
attrdict==2.0.0 attrdict==2.0.0
certifi==2018.4.16 certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4 chardet==3.0.4
coincurve==9.0.0
coreapi==2.3.3 coreapi==2.3.3
coreschema==0.0.4 coreschema==0.0.4
cytoolz==0.9.0.1 cytoolz==0.9.0.1
...@@ -20,6 +19,8 @@ eth-keyfile==0.5.1 ...@@ -20,6 +19,8 @@ eth-keyfile==0.5.1
eth-keys==0.2.0b3 eth-keys==0.2.0b3
eth-rlp==0.1.2 eth-rlp==0.1.2
eth-utils==1.0.3 eth-utils==1.0.3
ethereum==2.3.2
future==0.16.0
hexbytes==0.1.0 hexbytes==0.1.0
idna==2.7 idna==2.7
itypes==1.1.0 itypes==1.1.0
...@@ -28,17 +29,27 @@ lru-dict==1.1.6 ...@@ -28,17 +29,27 @@ lru-dict==1.1.6
MarkupSafe==1.0 MarkupSafe==1.0
openapi-codec==1.3.2 openapi-codec==1.3.2
parsimonious==0.8.0 parsimonious==0.8.0
pbkdf2==1.3
pkg-resources==0.0.0
py-ecc==1.4.3
pycparser==2.18
pycryptodome==3.6.4 pycryptodome==3.6.4
pyethash==0.1.27
PyJWT==1.6.4 PyJWT==1.6.4
pysha3==1.0.2
python-bitcoinlib==0.10.1 python-bitcoinlib==0.10.1
pytz==2018.5 pytz==2018.5
PyYAML==4.2b4
raven==6.9.0 raven==6.9.0
repoze.lru==0.7
requests==2.19.1 requests==2.19.1
rlp==1.0.1 rlp==1.0.1
scrypt==0.8.6
simplejson==3.16.0 simplejson==3.16.0
six==1.11.0 six==1.11.0
toolz==0.9.0 toolz==0.9.0
uritemplate==3.0.0 uritemplate==3.0.0
urllib3==1.23 urllib3==1.23
web3==4.5.0 web3==4.5.0
websockets==5.0.1 websockets==5.0.1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment