コード例 #1
0
def confirm_request_with_sig(request_id, contract_address, privatekey):
    constructed_sig_obj = sign_confirmation(request_id, contract_address,
                                            privatekey)
    evc = EVCore(verbose=False)
    contract_instance = evc.generate_contract_sdk(contract_address=sys.argv[2],
                                                  app_name='KidMultiSig')
    tx = contract_instance.confirmRequestWithSignature(
        _requestId=request_id, signatureObject=constructed_sig_obj)
    print(tx)
コード例 #2
0
from ethvigil.EVCore import EVCore

evc = EVCore(verbose=False)

# put in a contract address deployed from your EthVigil account
contract_instance = evc.generate_contract_sdk(
    contract_address='0xContractAddress', app_name='microblog')

# calling the blogTitle() function on the contract. This is a 'read' call, does not change state of the contract
print(contract_instance.blogTitle())
コード例 #3
0
import time
from flask import Flask, request, jsonify
from flask_cors import CORS
from redis_conn import provide_redis_conn
import json
import eth_utils
from ethvigil.EVCore import EVCore
from threading import Thread
from constants import *
from email_helper import send_ses_email
import requests

evc = EVCore(verbose=False)

with open('settings.conf.json', 'r') as f:
    settings = json.load(f)

main_contract_instance = evc.generate_contract_sdk(
    contract_address=settings['MAIN_CONTRACT'], app_name='AdabdhaMain')

app = Flask(__name__)
if settings['CORS_ENABLED']:
    CORS(app)


@provide_redis_conn
def get_verification_intent_mode(user_eth_address, redis_conn=None):
    # clear stored verification intent token
    vi_token = redis_conn.get(
        REDIS_ADABDHA_USER_VI_TOKEN.format(user_eth_address))
    if not vi_token:
コード例 #4
0
from ethvigil.EVCore import EVCore

evc = EVCore(verbose=False)
r = evc.deploy(contract_file='microblog.sol',
               contract_name='Microblog',
               inputs={
                   '_ownerName': 'anomit',
                   '_blogTitle': 'TheBlog'
               })

print('Contract Address deployed at')
print(r['contract'])
コード例 #5
0
from ethvigil.EVCore import EVCore
import threading
import random
from functools import wraps
import queue
import asyncio
import time
import signal
import json
from websocket_listener import consumer_contract, EthVigilWSSubscriber
from exceptions import ServiceExit

main_loop = asyncio.get_event_loop()
update_q = queue.Queue()

evc = EVCore(verbose=False)
api_read_key = evc._api_read_key

t = EthVigilWSSubscriber(kwargs={
        'api_read_key': api_read_key,
        'update_q': update_q,
        'ev_loop': main_loop
    })
t.start()

def close_ws_thread():
    t.shutdown_flag.set()
    print('Waiting for Websocket subscriber thread to join (Ctrl-C in case thread is stuck)...')
    t.join()
    print('Websocket subscriber thread exited')