Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'ZK_SYNC_LIBRARY_PATH' #46

Open
JasonBate0401 opened this issue Apr 4, 2022 · 3 comments
Open

KeyError: 'ZK_SYNC_LIBRARY_PATH' #46

JasonBate0401 opened this issue Apr 4, 2022 · 3 comments

Comments

@JasonBate0401
Copy link

JasonBate0401 commented Apr 4, 2022

My code is:
from web3 import Account, Web3, HTTPProvider
from zksync_sdk import ZkSyncProviderV01, HttpJsonRPCTransport, network, ZkSync, EthereumProvider, Wallet, ZkSyncSigner,
EthereumSignerWeb3, ZkSyncLibrary
import asyncio

def main():
# env = TestEnv()

library = ZkSyncLibrary()
provider = ZkSyncProviderV01(provider=HttpJsonRPCTransport(network=network.rinkeby))
account = Account.from_key("XXX")

async def get_contract_address():
    ret = await provider.get_contract_address()
    return ret

loop = asyncio.get_event_loop()
task = loop.create_task(get_contract_address())
loop.run_until_complete(task)
contracts = task.result()

w3 = Web3(HTTPProvider(endpoint_uri="https://rinkeby.infura.io/v3/XXX"))
# Setup zksync contract interactor
zksync = ZkSync(account=account, web3=w3,
                zksync_contract_address=contracts.main_contract)
# Create ethereum provider for interacting with ethereum node
ethereum_provider = EthereumProvider(w3, zksync)
ethereum_signer = EthereumSignerWeb3(account=account)

# Initialize zksync signer, all creating options were described earlier
signer = ZkSyncSigner.from_account(account, library, network.rinkeby.chain_id)
# Initialize Wallet
wallet = Wallet(ethereum_provider=ethereum_provider, zk_signer=signer,
                eth_signer=ethereum_signer, provider=provider)

if name == "main":
main()

however, I get the error.
library_path = os.environ["ZK_SYNC_LIBRARY_PATH"]
File "/usr/lib/python3.8/os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'ZK_SYNC_LIBRARY_PATH'

@adamxyzxyz
Copy link

also getting this issue, anyluck?

@Yakim1429
Copy link

download zks-crypto-aarch64-apple-darwin.dylib
set environ ZK_SYNC_LIBRARY_PATH
os.environ['ZK_SYNC_LIBRARY_PATH'] ='/zks-crypto-aarch64-apple-darwin.dylib'

@ManutdGTA
Copy link

download zks-crypto-aarch64-apple-darwin.dylib set environ ZK_SYNC_LIBRARY_PATH os.environ['ZK_SYNC_LIBRARY_PATH'] ='/zks-crypto-aarch64-apple-darwin.dylib'

I have downloaded zksync-crypto-library,and set env variable ZK_SYNC_LIBRARY_PATH with a path to the downloaded library.but It is still error in ZK_SYNC_LIBRARY_PATH
~ echo $ZK_SYNC_LIBRARY_PATH

......../zks-crypto-aarch64-apple-darwin.a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants