Renames `provider_uri` to `eth_provider_uri`

pull/2871/head
vzotova 2022-02-12 16:56:46 +03:00
parent ede371eede
commit 856abe4892
85 changed files with 510 additions and 510 deletions

View File

@ -71,6 +71,6 @@
become: yes
become_user: nucypher
when: ursula_check.stat.exists == False
command: "docker run -v /home/nucypher:/root/.local/share/ -e NUCYPHER_KEYSTORE_PASSWORD -it {{ nucypher_image | default('nucypher/nucypher:latest') }} nucypher ursula init --provider {{ blockchain_provider }} --worker-address {{active_account.stdout}} --rest-host {{ip_response.content}} --network {{network_name}} {{nucypher_ursula_init_options | default('')}} {{signer_options}}"
command: "docker run -v /home/nucypher:/root/.local/share/ -e NUCYPHER_KEYSTORE_PASSWORD -it {{ nucypher_image | default('nucypher/nucypher:latest') }} nucypher ursula init --eth-provider {{ blockchain_provider }} --worker-address {{active_account.stdout}} --rest-host {{ip_response.content}} --network {{network_name}} {{nucypher_ursula_init_options | default('')}} {{signer_options}}"
environment:
NUCYPHER_KEYSTORE_PASSWORD: "{{runtime_envvars['NUCYPHER_KEYSTORE_PASSWORD']}}"

View File

@ -51,7 +51,7 @@
- name: "update Ursula worker config"
become: yes
become_user: nucypher
command: "docker run -v /home/nucypher:/root/.local/share/ -e NUCYPHER_KEYSTORE_PASSWORD -it {{ nucypher_image | default('nucypher/nucypher:latest') }} nucypher ursula config --provider {{ blockchain_provider }} --worker-address {{active_account.stdout}} --rest-host {{ip_response.content}} --network {{network_name}} {{nucypher_ursula_init_options | default('')}} {{signer_options}} --config-file /root/.local/share/nucypher/ursula.json"
command: "docker run -v /home/nucypher:/root/.local/share/ -e NUCYPHER_KEYSTORE_PASSWORD -it {{ nucypher_image | default('nucypher/nucypher:latest') }} nucypher ursula config --eth-provider {{ blockchain_provider }} --worker-address {{active_account.stdout}} --rest-host {{ip_response.content}} --network {{network_name}} {{nucypher_ursula_init_options | default('')}} {{signer_options}} --config-file /root/.local/share/nucypher/ursula.json"
environment: "{{runtime_envvars}}"
- name: "Backup Worker Nucypher Keystore locally to: {{deployer_config_path}}/remote_worker_backups/"

View File

@ -15,7 +15,7 @@ services:
- .:/code
- ~/.local/share/nucypher:/nucypher
command: ["nucypher", "porter", "run",
"--provider", "${WEB3_PROVIDER_URI}",
"--eth-provider", "${WEB3_PROVIDER_URI}",
"--network", "${NUCYPHER_NETWORK}",
"--allow-origins", "${PORTER_CORS_ALLOW_ORIGINS}"] # empty string if env var not defined which translates to CORS not enabled by default
@ -31,7 +31,7 @@ services:
- ~/.local/share/nucypher:/nucypher
- "${TLS_DIR}:/etc/porter/tls/"
command: [ "nucypher", "porter", "run",
"--provider", "${WEB3_PROVIDER_URI}",
"--eth-provider", "${WEB3_PROVIDER_URI}",
"--network", "${NUCYPHER_NETWORK}",
"--tls-key-filepath", "/etc/porter/tls/key.pem",
"--tls-certificate-filepath", "/etc/porter/tls/cert.pem",
@ -50,7 +50,7 @@ services:
- "${TLS_DIR}:/etc/porter/tls/"
- "${HTPASSWD_FILE}:/etc/porter/auth/htpasswd"
command: [ "nucypher", "porter", "run",
"--provider", "${WEB3_PROVIDER_URI}",
"--eth-provider", "${WEB3_PROVIDER_URI}",
"--network", "${NUCYPHER_NETWORK}",
"--tls-key-filepath", "/etc/porter/tls/key.pem",
"--tls-certificate-filepath", "/etc/porter/tls/cert.pem",

View File

@ -28,7 +28,7 @@ services:
- .:/code
- ~/.local/share/nucypher:/nucypher
command: [ "nucypher", "porter", "run",
"--provider", "${WEB3_PROVIDER_URI}",
"--eth-provider", "${WEB3_PROVIDER_URI}",
"--network", "${NUCYPHER_NETWORK}" ]
environment:
- VIRTUAL_HOST=porter.local

View File

@ -23,12 +23,12 @@ Initialize Testnet Alice and Bob
.. code::
# Create a new Alice
(nucypher)$ nucypher alice init --provider <PROVIDER URI> --signer <SIGNER URI> --network lynx
(nucypher)$ nucypher alice init --eth-provider <ETH PROVIDER URI> --signer <SIGNER URI> --network lynx
# Create a new Bob
(nucypher)$ nucypher bob init --provider <PROVIDER URI> --signer <SIGNER URI> --network lynx
(nucypher)$ nucypher bob init --eth-provider <ETH PROVIDER URI> --signer <SIGNER URI> --network lynx
Replace ``<YOUR PROVIDER URI>`` with a valid node web3 node provider string on the goerli ethereum network, for example:
Replace ``<YOUR ETH PROVIDER URI>`` with a valid node web3 node provider string on the goerli ethereum network, for example:
- ``ipc:///home/<username>/.ethereum/geth.ipc`` - IPC Socket-based JSON-RPC server (Geth)
- ``https://<host>`` - HTTP(S)-based JSON-RPC server

View File

@ -179,11 +179,11 @@ After generating a keystore, any future usage can decrypt the keys from the disk
# Instantiate Alice
alice = Alice(
keystore=keystore, # NuCypher Keystore
known_nodes=[ursula], # Peers (Optional)
signer=signer, # Alice Wallet
provider_uri=<RPC ENDPOINT>, # Ethereum RPC endpoint
domain='lynx' # NuCypher network (mainnet, lynx, ibex)
keystore=keystore, # NuCypher Keystore
known_nodes=[ursula], # Peers (Optional)
signer=signer, # Alice Wallet
eth_provider_uri=<RPC ENDPOINT>, # Ethereum RPC endpoint
domain='lynx' # NuCypher network (mainnet, lynx, ibex)
)
# Alice is identified by her ethereum address
@ -265,7 +265,7 @@ software wallet and an existing keystore:
# Make Alice
alice = Alice(
domain='lynx', # testnet
provider_uri='GOERLI RPC ENDPOINT',
eth_provider_uri='GOERLI RPC ENDPOINT',
keystore=keystore,
signer=wallet,
)

View File

@ -91,7 +91,7 @@ Run Porter within Docker without acquiring or installing the ``nucypher`` codeba
-p 80:9155 \
nucypher/porter:latest \
nucypher porter run \
--provider <YOUR WEB3 PROVIDER URI> \
--eth-provider <YOUR WEB3 PROVIDER URI> \
--network <NETWORK NAME>
For HTTPS service (on default port 443):
@ -107,7 +107,7 @@ Run Porter within Docker without acquiring or installing the ``nucypher`` codeba
-p 443:9155 \
nucypher/porter:latest \
nucypher porter run \
--provider <YOUR WEB3 PROVIDER URI> \
--eth-provider <YOUR WEB3 PROVIDER URI> \
--network <NETWORK NAME> \
--tls-key-filepath /etc/porter/tls/<KEY FILENAME> \
--tls-certificate-filepath /etc/porter/tls/<CERT FILENAME>
@ -123,7 +123,7 @@ Run Porter within Docker without acquiring or installing the ``nucypher`` codeba
-p 443:9155 \
nucypher/porter:latest \
nucypher porter run \
--provider <YOUR WEB3 PROVIDER URI> \
--eth-provider <YOUR WEB3 PROVIDER URI> \
--network <NETWORK NAME> \
--tls-key-filepath /etc/porter/tls/<KEY FILENAME> \
--tls-certificate-filepath /etc/porter/tls/<CERT FILENAME> \
@ -141,7 +141,7 @@ Run Porter within Docker without acquiring or installing the ``nucypher`` codeba
-p 443:9155 \
nucypher/porter:latest \
nucypher porter run \
--provider <YOUR WEB3 PROVIDER URI> \
--eth-provider <YOUR WEB3 PROVIDER URI> \
--network <NETWORK NAME> \
--tls-key-filepath /etc/porter/tls/<KEY FILENAME> \
--tls-certificate-filepath /etc/porter/tls/<CERT FILENAME> \
@ -292,7 +292,7 @@ For a full list of CLI options, run:
.. code:: console
$ nucypher porter run --provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME>
$ nucypher porter run --eth-provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME>
______
@ -314,7 +314,7 @@ For a full list of CLI options, run:
.. code:: console
$ nucypher porter run --provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH>
$ nucypher porter run --eth-provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH>
______
@ -334,7 +334,7 @@ For a full list of CLI options, run:
.. code:: console
$ nucypher porter run --provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH> --allow-origins ".*\.example\.com$"
$ nucypher porter run --eth-provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH> --allow-origins ".*\.example\.com$"
______
@ -355,7 +355,7 @@ For a full list of CLI options, run:
.. code:: console
$ nucypher porter run --provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH> --allow-origins ".*\.example\.com$" --basic-auth-filepath <HTPASSWD FILE>
$ nucypher porter run --eth-provider <YOUR WEB3 PROVIDER URI> --network <NETWORK NAME> --tls-key-filepath <TLS KEY FILEPATH> --tls-certificate-filepath <CERT FILEPATH> --allow-origins ".*\.example\.com$" --basic-auth-filepath <HTPASSWD FILE>
______

View File

@ -45,16 +45,16 @@ Alice and Bob can also be configured to use the lynx testnet using the command l
.. code::
# While creating a new alice
$ nucypher alice init --network lynx --provider <GOERLI PROVIDER URI>
$ nucypher alice init --network lynx --eth-provider <GOERLI PROVIDER URI>
# Update an existing alice
$ nucypher alice config --network lynx --provider <GOERLI PROVIDER URI>
$ nucypher alice config --network lynx --eth-provider <GOERLI PROVIDER URI>
# While creating a new bob
$ nucypher bob init --network lynx --provider <GOERLI PROVIDER URI>
$ nucypher bob init --network lynx --eth-provider <GOERLI PROVIDER URI>
# Update an existing bob
$ nucypher bob config --network lynx --provider <GOERLI PROVIDER URI>
$ nucypher bob config --network lynx --eth-provider <GOERLI PROVIDER URI>

View File

@ -71,7 +71,7 @@ First, configure the demo. Be sure tat alice's address has some Goerli ETH.
.. code::
export DEMO_PROVIDER_URI=<GOERLI RPC ENDPOINT>
export DEMO_ETH_PROVIDER_URI=<GOERLI RPC ENDPOINT>
export DEMO_ALICE_ETH_ADDRESS=<ETH ADDRESS>
export DEMO_SIGNER_URI=keystore://<PATH TO KEYSTORE>

View File

@ -17,7 +17,7 @@ General
* `NUCYPHER_KEYSTORE_PASSWORD`
Password for the `nucypher` Keystore.
* `NUCYPHER_PROVIDER_URI`
* `NUCYPHER_ETH_PROVIDER_URI`
Default Web3 node provider URI.
* `NUCYPHER_STAKING_PROVIDERS_PAGINATION_SIZE`
Default pagination size for the maximum number of active staking providers to retrieve from PREApplication in

View File

@ -29,7 +29,7 @@ For example, to view the staking rewards received by all Stakers in the current
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name StakingEscrow --event-name Minted
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name StakingEscrow --event-name Minted
Reading Latest Chaindata...
Retrieving events from block 11916688 to latest
@ -50,7 +50,7 @@ To view the staking rewards received by all Stakers from block number ``11916685
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name StakingEscrow --event-name Minted --from-block 11916685 --to-block 11916688
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name StakingEscrow --event-name Minted --from-block 11916685 --to-block 11916688
Reading Latest Chaindata...
Retrieving events from block 11916685 to 11916688
@ -69,7 +69,7 @@ To view every PolicyManager smart contract event thus far, run:
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name PolicyManager --from-block 0
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name PolicyManager --from-block 0
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -98,7 +98,7 @@ For example, to view all of the commitments ever made by the Worker associated w
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name StakingEscrow --event-name CommitmentMade --event-filter staker=<STAKING_ADDRESS> --from-block 0
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name StakingEscrow --event-name CommitmentMade --event-filter staker=<STAKING_ADDRESS> --from-block 0
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -116,7 +116,7 @@ To view the commitment made by the Worker associated with a specific Staker in p
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name StakingEscrow --event-name CommitmentMade --event-filter staker=<STAKING_ADDRESS> --event-filter period=18552 --from-block 0
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name StakingEscrow --event-name CommitmentMade --event-filter staker=<STAKING_ADDRESS> --event-filter period=18552 --from-block 0
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -141,7 +141,7 @@ For example,
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name PolicyManager --event-name PolicyCreated --from-block 0 --csv
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name PolicyManager --event-name PolicyCreated --from-block 0 --csv
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -153,7 +153,7 @@ For example,
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name PolicyManager --event-name PolicyCreated --from-block 0 --csv-file ~/Policy_Events.csv
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name PolicyManager --event-name PolicyCreated --from-block 0 --csv-file ~/Policy_Events.csv
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -167,7 +167,7 @@ To write every PolicyManager smart contract event thus far to corresponding CSV
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name PolicyManager --from-block 0 --csv
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name PolicyManager --from-block 0 --csv
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -191,7 +191,7 @@ To write StakingEscrow events for a specific Staker for the current period to co
.. code::
$ nucypher status events --provider <PROVIDER URI> --contract-name StakingEscrow --event-filter staker=<STAKING_ADDRESS> --csv
$ nucypher status events --eth-provider <ETH PROVIDER URI> --contract-name StakingEscrow --event-filter staker=<STAKING_ADDRESS> --csv
Reading Latest Chaindata...
Retrieving events from block 11929449 to latest

View File

@ -144,7 +144,7 @@ Initialize a new Worker
nucypher/nucypher:latest \
nucypher ursula init \
--signer keystore:///root/.ethereum/keystore \
--provider <L1 PROVIDER URI> \
--eth-provider <L1 PROVIDER URI> \
--network <L1 NETWORK NAME> \
--payment-provider <L2 PROVIDER URI> \
--payment-network <L2 NETWORK NAME> \
@ -222,7 +222,7 @@ Instead of using docker, the nucypher worker can be run as a systemd service.
.. code-block::
$(nucypher) nucypher ursula init \
--provider <L1 PROVIDER URI> \
--eth-provider <L1 PROVIDER URI> \
--network <L1 NETWORK NAME> \
--payment-provider <L2 PROVIDER URI> \
--payment-network <L2 NETWORK NAME> \
@ -330,7 +330,7 @@ First initialize a Worker configuration:
.. code-block::
$(nucypher) nucypher ursula init \
--provider <L1 PROVIDER URI> \
--eth-provider <L1 PROVIDER URI> \
--network <L1 NETWORK NAME> \
--payment-provider <L2 PROVIDER URI> \
--payment-network <L2 NETWORK NAME> \
@ -386,7 +386,7 @@ paths, use the ``--config-file <CONFIG PATH>`` parameter.
nucypher ursula config --max-gas-price <GWEI>
# Change the Ethereum provider to use
nucypher ursula config --provider <PROVIDER URI>
nucypher ursula config --eth-provider <ETH PROVIDER URI>
# Accept payments for service using the SubscriptionManager contract on polygon/mumbai
nucypher ursula config --payment-method SubscriptionManager --payment-network mumbai
@ -403,7 +403,7 @@ paths, use the ``--config-file <CONFIG PATH>`` parameter.
nucypher ursula config --config-file <CONFIG PATH>
# Update the max gas price setting of a non-default configuration file path
nucypher ursula config --config-file <CONFIG PATH> --provider <PROVIDER URI>
nucypher ursula config --config-file <CONFIG PATH> --eth-provider <ETH PROVIDER URI>
.. important::

View File

@ -119,7 +119,7 @@ using :ref:`clef-rules`.
$ nucypher stake config --signer clef:///home/<username>/.clef/clef.ipc # Set clef as the default signer
# Create a new stake using inline signer and provider values
$ nucypher stake create --signer clef:///home/<username>/.clef/clef.ipc --provider ~/.ethereum/geth.ipc
$ nucypher stake create --signer clef:///home/<username>/.clef/clef.ipc --eth-provider ~/.ethereum/geth.ipc
3. Configure nucypher for staking
@ -131,7 +131,7 @@ configuration values. No new keys or secrets are created in this step, it is ju
.. code:: bash
(nucypher)$ nucypher stake init-stakeholder --signer <SIGNER URI> --provider <PROVIDER>
(nucypher)$ nucypher stake init-stakeholder --signer <SIGNER URI> --eth-provider <PROVIDER>
.. note:: If you are using NuCypher's Ibex testnet, passing the network name is required ``--network ibex``.

View File

@ -45,7 +45,7 @@ For example, to view all of the staking rewards received by the Staker thus far,
.. code::
$ nucypher stake events --staking-address <STAKER ADDRESS> --provider <PROVIDER URI> --event-name Minted
$ nucypher stake events --staking-address <STAKER ADDRESS> --eth-provider <ETH PROVIDER URI> --event-name Minted
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -64,7 +64,7 @@ To view staking rewards received by the Staker from block number 11070000 to blo
.. code::
$ nucypher stake events --staking-address <STAKER ADDRESS> --provider <PROVIDER URI> --event-name Minted --from-block 11070000 --to-block 11916688
$ nucypher stake events --staking-address <STAKER ADDRESS> --eth-provider <ETH PROVIDER URI> --event-name Minted --from-block 11070000 --to-block 11916688
Reading Latest Chaindata...
Retrieving events from block 11070000 to 11916688
@ -93,7 +93,7 @@ For example,
.. code::
$ nucypher stake events --staking-address <STAKER ADDRESS> --provider <PROVIDER URI> --event-name Minted --csv
$ nucypher stake events --staking-address <STAKER ADDRESS> --eth-provider <ETH PROVIDER URI> --event-name Minted --csv
Reading Latest Chaindata...
Retrieving events from block 0 to latest
@ -105,7 +105,7 @@ For example,
.. code::
$ nucypher stake events --staking-address <STAKER ADDRESS> --provider <PROVIDER URI> --event-name Minted --csv-file ~/Minted_Events.csv
$ nucypher stake events --staking-address <STAKER ADDRESS> --eth-provider <ETH PROVIDER URI> --event-name Minted --csv-file ~/Minted_Events.csv
Reading Latest Chaindata...
Retrieving events from block 0 to latest

View File

@ -19,16 +19,16 @@ Stakers and Workers can be configured to use the Ibex testnet using the command
.. code::
# While creating a new staker
$ nucypher stake init-stakeholder --network ibex --provider <RINKEBY PROVIDER URI>
$ nucypher stake init-stakeholder --network ibex --eth-provider <RINKEBY PROVIDER URI>
# Update an existing staker
$ nucypher stake config --network ibex --provider <RINKEBY PROVIDER URI>
$ nucypher stake config --network ibex --eth-provider <RINKEBY PROVIDER URI>
# While creating a new worker
$ nucypher ursula init --network ibex --provider <RINKEBY PROVIDER URI>
$ nucypher ursula init --network ibex --eth-provider <RINKEBY PROVIDER URI>
# Update an existing worker
$ nucypher ursula config --network ibex --provider <RINKEBY PROVIDER URI>
$ nucypher ursula config --network ibex --eth-provider <RINKEBY PROVIDER URI>
Deployments

View File

@ -229,7 +229,7 @@ This is **ONLY** a heuristic to ensure that your node is running correctly, it d
#. Run the following command and ensure that the various settings are correct::
nucypher status stakers
> --provider <YOUR PROVIDER URI>
> --eth-provider <YOUR ETH PROVIDER URI>
> --network <NETWORK>
> --staking-address <YOUR STAKER ADDRESS>
@ -253,7 +253,7 @@ Q: How can I check for currently available staking rewards?
Run::
nucypher status stakers
> --provider <YOUR PROVIDER URI>
> --eth-provider <YOUR ETH PROVIDER URI>
> --network <NETWORK>
> --staking-address <YOUR STAKER ADDRESS>
@ -272,7 +272,7 @@ Q: How can I observe the settings (re-staking, winding down) for my stake?
Run::
nucypher status stakers
> --provider <YOUR PROVIDER URI>
> --eth-provider <YOUR ETH PROVIDER URI>
> --network <NETWORK>
> --staking-address <YOUR STAKER ADDRESS>
@ -318,7 +318,7 @@ Q: The status of my node on the status monitor seems incorrect?
Check when last your node made a commitment by running::
nucypher status stakers
> --provider <YOUR PROVIDER URI>
> --eth-provider <YOUR ETH PROVIDER URI>
> --network <NETWORK>
> --staking-address <YOUR STAKER ADDRESS>

View File

@ -115,4 +115,4 @@ and to update values
.. code:: bash
nucypher stake config --signer <SIGNER PATH> --provider <YOUR PROVIDER URI>
nucypher stake config --signer <SIGNER PATH> --eth-provider <YOUR ETH PROVIDER URI>

View File

@ -26,7 +26,7 @@ Then run the demo:
First, configure the demo. Be sure tat alice's address has some Goerli ETH.
```bash
export DEMO_PROVIDER_URI=<GOERLI RPC ENDPOINT>
export DEMO_ETH_PROVIDER_URI=<GOERLI RPC ENDPOINT>
export DEMO_ALICE_ETH_ADDRESS=<ETH ADDRESS>
export DEMO_SIGNER_URI=keystore://<PATH TO KEYSTORE>
```

View File

@ -82,8 +82,8 @@ encrypting_key = bob.public_keys(DecryptingPower)
######################################
# Connect to the ethereum provider.
connect_web3_provider(provider_uri=L1_PROVIDER)
connect_web3_provider(provider_uri=L2_PROVIDER)
connect_web3_provider(eth_provider_uri=L1_PROVIDER)
connect_web3_provider(eth_provider_uri=L2_PROVIDER)
# Setup and unlock alice's ethereum wallet.
# WARNING: Never give your mainnet password or mnemonic phrase to anyone.
@ -99,7 +99,7 @@ alice = Alice(
domain=L1_TESTNET,
payment_network=L2_TESTNET,
payment_provider=L2_PROVIDER,
provider_uri=L1_PROVIDER,
eth_provider_uri=L1_PROVIDER,
)
# Alice puts her public key somewhere for Bob to find later...

View File

@ -44,7 +44,7 @@ BOOK_PATH = Path('finnegans-wake-excerpt.txt')
try:
# Replace with ethereum RPC endpoint
PROVIDER_URI = os.environ['DEMO_PROVIDER_URI']
ETH_PROVIDER_URI = os.environ['DEMO_ETH_PROVIDER_URI']
# Replace with wallet filepath.
WALLET_FILEPATH = os.environ['DEMO_WALLET_FILEPATH']
@ -80,7 +80,7 @@ encrypting_key = bob.public_keys(DecryptingPower)
######################################
# Connect to the ethereum provider.
connect_web3_provider(provider_uri=PROVIDER_URI)
connect_web3_provider(eth_provider_uri=ETH_PROVIDER_URI)
# Setup and unlock alice's ethereum wallet.
# WARNING: Never give your mainnet password or mnemonic phrase to anyone.
@ -90,7 +90,7 @@ password = os.environ.get('DEMO_ALICE_PASSWORD') or getpass(f"Enter password to
wallet.unlock_account(account=ALICE_ADDRESS, password=password)
# This is Alice.
alice = Alice(checksum_address=ALICE_ADDRESS, signer=wallet, domain=TESTNET, provider_uri=PROVIDER_URI)
alice = Alice(checksum_address=ALICE_ADDRESS, signer=wallet, domain=TESTNET, eth_provider_uri=ETH_PROVIDER_URI)
# Alice puts her public key somewhere for Bob to find later...
alice_verifying_key = bytes(alice.stamp)

View File

@ -109,20 +109,20 @@ class EconomicsFactory:
__economics = dict()
@classmethod
def get_economics(cls, registry: BaseContractRegistry, provider_uri: Optional[str] = None) -> Economics:
def get_economics(cls, registry: BaseContractRegistry, eth_provider_uri: Optional[str] = None) -> Economics:
registry_id = registry.id
try:
return cls.__economics[registry_id]
except KeyError:
economics = EconomicsFactory.retrieve_from_blockchain(registry=registry, provider_uri=provider_uri)
economics = EconomicsFactory.retrieve_from_blockchain(registry=registry, eth_provider_uri=eth_provider_uri)
cls.__economics[registry_id] = economics
return economics
@staticmethod
def retrieve_from_blockchain(registry: BaseContractRegistry, provider_uri: Optional[str] = None) -> Economics:
def retrieve_from_blockchain(registry: BaseContractRegistry, eth_provider_uri: Optional[str] = None) -> Economics:
# Agents
application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=registry, provider_uri=provider_uri)
application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=registry, eth_provider_uri=eth_provider_uri)
# PRE Application
min_authorization = application_agent.get_min_authorization()

View File

@ -47,8 +47,8 @@ from nucypher.blockchain.eth.events import ContractEvents
from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory
from nucypher.blockchain.eth.registry import BaseContractRegistry
from nucypher.config.constants import (
NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE,
NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE
NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE,
NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE
)
from nucypher.crypto.powers import TransactingPower
from nucypher.crypto.utils import sha256_digest
@ -94,14 +94,14 @@ class EthereumContractAgent:
def __init__(self,
registry: BaseContractRegistry = None, # TODO: Consider make it non-optional again. See comment in InstanceAgent.
provider_uri: Optional[str] = None,
eth_provider_uri: Optional[str] = None,
contract: Optional[Contract] = None,
transaction_gas: Optional[Wei] = None):
self.log = Logger(self.__class__.__name__)
self.registry_str = str(registry)
self.blockchain = BlockchainInterfaceFactory.get_or_create_interface(provider_uri=provider_uri)
self.blockchain = BlockchainInterfaceFactory.get_or_create_interface(eth_provider_uri=eth_provider_uri)
if not contract: # Fetch the contract
contract = self.blockchain.get_contract_by_name(
@ -119,7 +119,7 @@ class EthereumContractAgent:
self.log.info("Initialized new {} for {} with {} and {}".format(self.__class__.__name__,
self.contract.address,
self.blockchain.provider_uri,
self.blockchain.eth_provider_uri,
self.registry_str))
def __repr__(self) -> str:
@ -248,9 +248,9 @@ class StakingEscrowAgent(EthereumContractAgent):
)
DEFAULT_STAKER_PAGINATION_SIZE_LIGHT_NODE: int = int(os.environ.get(
NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE, default=30))
NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE, default=30))
DEFAULT_STAKER_PAGINATION_SIZE: int = int(os.environ.get(NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE, default=1000))
DEFAULT_STAKER_PAGINATION_SIZE: int = int(os.environ.get(NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE, default=1000))
class NotEnoughStakers(Exception):
"""Raised when the are not enough stakers available to complete an operation"""
@ -952,8 +952,8 @@ class PREApplicationAgent(EthereumContractAgent):
contract_name: str = PRE_APPLICATION_CONTRACT_NAME
DEFAULT_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE = int(os.environ.get(NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE, default=30))
DEFAULT_PROVIDERS_PAGINATION_SIZE = int(os.environ.get(NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE, default=1000))
DEFAULT_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE = int(os.environ.get(NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE, default=30))
DEFAULT_PROVIDERS_PAGINATION_SIZE = int(os.environ.get(NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE, default=1000))
class NotEnoughStakingProviders(Exception):
pass
@ -1141,7 +1141,7 @@ class ContractAgency:
def get_agent(cls,
agent_class: Type[Agent],
registry: Optional[BaseContractRegistry] = None,
provider_uri: Optional[str] = None
eth_provider_uri: Optional[str] = None
) -> Agent:
if not issubclass(agent_class, EthereumContractAgent):
@ -1157,7 +1157,7 @@ class ContractAgency:
try:
return cast(Agent, cls.__agents[registry_id][agent_class])
except KeyError:
agent = cast(Agent, agent_class(registry=registry, provider_uri=provider_uri))
agent = cast(Agent, agent_class(registry=registry, eth_provider_uri=eth_provider_uri))
cls.__agents[registry_id] = cls.__agents.get(registry_id, dict())
cls.__agents[registry_id][agent_class] = agent
return agent
@ -1174,12 +1174,12 @@ class ContractAgency:
def get_agent_by_contract_name(cls,
contract_name: str,
registry: BaseContractRegistry,
provider_uri: Optional[str] = None
eth_provider_uri: Optional[str] = None
) -> EthereumContractAgent:
agent_name: str = cls._contract_name_to_agent_name(name=contract_name)
agents_module = sys.modules[__name__]
agent_class: Type[EthereumContractAgent] = getattr(agents_module, agent_name)
agent: EthereumContractAgent = cls.get_agent(agent_class=agent_class, registry=registry, provider_uri=provider_uri)
agent: EthereumContractAgent = cls.get_agent(agent_class=agent_class, registry=registry, eth_provider_uri=eth_provider_uri)
return agent

View File

@ -164,8 +164,8 @@ class BlockchainInterface:
emitter=None, # TODO # 1754
poa: bool = None,
light: bool = False,
provider_uri: str = NO_BLOCKCHAIN_CONNECTION,
provider: BaseProvider = NO_BLOCKCHAIN_CONNECTION,
eth_provider_uri: str = NO_BLOCKCHAIN_CONNECTION,
eth_provider: BaseProvider = NO_BLOCKCHAIN_CONNECTION,
gas_strategy: Optional[Union[str, Callable]] = None,
max_gas_price: Optional[int] = None):
@ -234,8 +234,8 @@ class BlockchainInterface:
self.log = Logger('Blockchain')
self.poa = poa
self.provider_uri = provider_uri
self._provider = provider
self.eth_provider_uri = eth_provider_uri
self._eth_provider = eth_provider
self.w3 = NO_BLOCKCHAIN_CONNECTION
self.client = NO_BLOCKCHAIN_CONNECTION
self.is_light = light
@ -247,7 +247,7 @@ class BlockchainInterface:
self.max_gas_price = max_gas_price
def __repr__(self):
r = '{name}({uri})'.format(name=self.__class__.__name__, uri=self.provider_uri)
r = '{name}({uri})'.format(name=self.__class__.__name__, uri=self.eth_provider_uri)
return r
def get_blocktime(self):
@ -323,23 +323,23 @@ class BlockchainInterface:
def connect(self):
provider_uri = self.provider_uri
self.log.info(f"Using external Web3 Provider '{self.provider_uri}'")
eth_provider_uri = self.eth_provider_uri
self.log.info(f"Using external Web3 Provider '{self.eth_provider_uri}'")
# Attach Provider
self._attach_provider(provider=self._provider, provider_uri=provider_uri)
self.log.info("Connecting to {}".format(self.provider_uri))
if self._provider is NO_BLOCKCHAIN_CONNECTION:
self._attach_eth_provider(eth_provider=self._eth_provider, eth_provider_uri=eth_provider_uri)
self.log.info("Connecting to {}".format(self.eth_provider_uri))
if self._eth_provider is NO_BLOCKCHAIN_CONNECTION:
raise self.NoProvider("There are no configured blockchain providers")
# Connect if not connected
try:
self.w3 = self.Web3(provider=self._provider)
self.w3 = self.Web3(provider=self._eth_provider)
self.client = EthereumClient.from_w3(w3=self.w3)
except requests.ConnectionError: # RPC
raise self.ConnectionFailed(f'Connection Failed - {str(self.provider_uri)} - is RPC enabled?')
raise self.ConnectionFailed(f'Connection Failed - {str(self.eth_provider_uri)} - is RPC enabled?')
except FileNotFoundError: # IPC File Protocol
raise self.ConnectionFailed(f'Connection Failed - {str(self.provider_uri)} - is IPC enabled?')
raise self.ConnectionFailed(f'Connection Failed - {str(self.eth_provider_uri)} - is IPC enabled?')
else:
self.attach_middleware()
@ -347,20 +347,20 @@ class BlockchainInterface:
@property
def provider(self) -> BaseProvider:
return self._provider
return self._eth_provider
def _attach_provider(self,
provider: Optional[BaseProvider] = None,
provider_uri: str = None) -> None:
def _attach_eth_provider(self,
eth_provider: Optional[BaseProvider] = None,
eth_provider_uri: str = None) -> None:
"""
https://web3py.readthedocs.io/en/latest/providers.html#providers
"""
if not provider_uri and not provider:
if not eth_provider_uri and not eth_provider:
raise self.NoProvider("No URI or provider instances supplied.")
if provider_uri and not provider:
uri_breakdown = urlparse(provider_uri)
if eth_provider_uri and not eth_provider:
uri_breakdown = urlparse(eth_provider_uri)
if uri_breakdown.scheme == 'tester':
providers = {
@ -383,19 +383,19 @@ class BlockchainInterface:
# auto-detect for file based ipc
if not provider_scheme:
if Path(provider_uri).is_file():
if Path(eth_provider_uri).is_file():
# file is available - assume ipc/file scheme
provider_scheme = 'file'
self.log.info(f"Auto-detected provider scheme as 'file://' for provider {provider_uri}")
self.log.info(f"Auto-detected provider scheme as 'file://' for provider {eth_provider_uri}")
try:
self._provider = providers[provider_scheme](provider_uri)
self._eth_provider = providers[provider_scheme](eth_provider_uri)
except KeyError:
raise self.UnsupportedProvider(f"{provider_uri} is an invalid or unsupported blockchain provider URI")
raise self.UnsupportedProvider(f"{eth_provider_uri} is an invalid or unsupported blockchain provider URI")
else:
self.provider_uri = provider_uri or NO_BLOCKCHAIN_CONNECTION
self.eth_provider_uri = eth_provider_uri or NO_BLOCKCHAIN_CONNECTION
else:
self._provider = provider
self._eth_provider = eth_provider
@classmethod
def _handle_failed_transaction(cls,
@ -1014,11 +1014,11 @@ class BlockchainInterfaceFactory:
return cls._instance
@classmethod
def is_interface_initialized(cls, provider_uri: str) -> bool:
def is_interface_initialized(cls, eth_provider_uri: str) -> bool:
"""
Returns True if there is an existing connection with an equal provider_uri.
Returns True if there is an existing connection with an equal eth_provider_uri.
"""
return bool(cls._interfaces.get(provider_uri, False))
return bool(cls._interfaces.get(eth_provider_uri, False))
@classmethod
def register_interface(cls,
@ -1027,47 +1027,47 @@ class BlockchainInterfaceFactory:
force: bool = False
) -> None:
provider_uri = interface.provider_uri
if (provider_uri in cls._interfaces) and not force:
raise cls.InterfaceAlreadyInitialized(f"A connection already exists for {provider_uri}. "
eth_provider_uri = interface.eth_provider_uri
if (eth_provider_uri in cls._interfaces) and not force:
raise cls.InterfaceAlreadyInitialized(f"A connection already exists for {eth_provider_uri}. "
"Use .get_interface instead.")
cached = cls.CachedInterface(interface=interface, emitter=emitter)
cls._interfaces[provider_uri] = cached
cls._interfaces[eth_provider_uri] = cached
@classmethod
def initialize_interface(cls,
provider_uri: str,
eth_provider_uri: str,
emitter=None,
interface_class: Interfaces = None,
*interface_args,
**interface_kwargs
) -> None:
if not provider_uri:
if not eth_provider_uri:
# Prevent empty strings and Falsy
raise BlockchainInterface.UnsupportedProvider(f"'{provider_uri}' is not a valid provider URI")
raise BlockchainInterface.UnsupportedProvider(f"'{eth_provider_uri}' is not a valid provider URI")
if provider_uri in cls._interfaces:
raise cls.InterfaceAlreadyInitialized(f"A connection already exists for {provider_uri}. "
if eth_provider_uri in cls._interfaces:
raise cls.InterfaceAlreadyInitialized(f"A connection already exists for {eth_provider_uri}. "
f"Use .get_interface instead.")
# Interface does not exist, initialize a new one.
if not interface_class:
interface_class = cls._default_interface_class
interface = interface_class(provider_uri=provider_uri,
interface = interface_class(eth_provider_uri=eth_provider_uri,
*interface_args,
**interface_kwargs)
cls._interfaces[provider_uri] = cls.CachedInterface(interface=interface, emitter=emitter)
cls._interfaces[eth_provider_uri] = cls.CachedInterface(interface=interface, emitter=emitter)
@classmethod
def get_interface(cls, provider_uri: str = None) -> Interfaces:
def get_interface(cls, eth_provider_uri: str = None) -> Interfaces:
# Try to get an existing cached interface.
if provider_uri:
if eth_provider_uri:
try:
cached_interface = cls._interfaces[provider_uri]
cached_interface = cls._interfaces[eth_provider_uri]
except KeyError:
raise cls.InterfaceNotInitialized(f"There is no connection for {provider_uri}. "
raise cls.InterfaceNotInitialized(f"There is no connection for {eth_provider_uri}. "
f"Call .initialize_connection, then try again.")
# Try to use the most recently created interface by default.
@ -1085,13 +1085,13 @@ class BlockchainInterfaceFactory:
@classmethod
def get_or_create_interface(cls,
provider_uri: str,
eth_provider_uri: str,
*interface_args,
**interface_kwargs
) -> BlockchainInterface:
try:
interface = cls.get_interface(provider_uri=provider_uri)
interface = cls.get_interface(eth_provider_uri=eth_provider_uri)
except (cls.InterfaceNotInitialized, cls.NoRegisteredInterfaces):
cls.initialize_interface(provider_uri=provider_uri, *interface_args, **interface_kwargs)
interface = cls.get_interface(provider_uri=provider_uri)
cls.initialize_interface(eth_provider_uri=eth_provider_uri, *interface_args, **interface_kwargs)
interface = cls.get_interface(eth_provider_uri=eth_provider_uri)
return interface

View File

@ -31,25 +31,25 @@ class ProviderError(Exception):
pass
def _get_IPC_provider(provider_uri) -> BaseProvider:
uri_breakdown = urlparse(provider_uri)
def _get_IPC_provider(eth_provider_uri) -> BaseProvider:
uri_breakdown = urlparse(eth_provider_uri)
from nucypher.blockchain.eth.interfaces import BlockchainInterface
return IPCProvider(ipc_path=uri_breakdown.path,
timeout=BlockchainInterface.TIMEOUT,
request_kwargs={'timeout': BlockchainInterface.TIMEOUT})
def _get_HTTP_provider(provider_uri) -> BaseProvider:
def _get_HTTP_provider(eth_provider_uri) -> BaseProvider:
from nucypher.blockchain.eth.interfaces import BlockchainInterface
return HTTPProvider(endpoint_uri=provider_uri, request_kwargs={'timeout': BlockchainInterface.TIMEOUT})
return HTTPProvider(endpoint_uri=eth_provider_uri, request_kwargs={'timeout': BlockchainInterface.TIMEOUT})
def _get_websocket_provider(provider_uri) -> BaseProvider:
def _get_websocket_provider(eth_provider_uri) -> BaseProvider:
from nucypher.blockchain.eth.interfaces import BlockchainInterface
return WebsocketProvider(endpoint_uri=provider_uri, websocket_kwargs={'timeout': BlockchainInterface.TIMEOUT})
return WebsocketProvider(endpoint_uri=eth_provider_uri, websocket_kwargs={'timeout': BlockchainInterface.TIMEOUT})
def _get_auto_provider(provider_uri) -> BaseProvider:
def _get_auto_provider(eth_provider_uri) -> BaseProvider:
from web3.auto import w3
# how-automated-detection-works: https://web3py.readthedocs.io/en/latest/providers.html
connected = w3.isConnected()
@ -78,7 +78,7 @@ def _get_ethereum_tester(test_backend: Union[PyEVMBackend, MockBackend]) -> Ethe
return provider
def _get_pyevm_test_provider(provider_uri) -> BaseProvider:
def _get_pyevm_test_provider(eth_provider_uri) -> BaseProvider:
""" Test provider entry-point"""
# https://github.com/ethereum/eth-tester#pyevm-experimental
pyevm_eth_tester = _get_pyevm_test_backend()
@ -86,13 +86,13 @@ def _get_pyevm_test_provider(provider_uri) -> BaseProvider:
return provider
def _get_mock_test_provider(provider_uri) -> BaseProvider:
def _get_mock_test_provider(eth_provider_uri) -> BaseProvider:
# https://github.com/ethereum/eth-tester#mockbackend
mock_backend = MockBackend()
provider = _get_ethereum_tester(test_backend=mock_backend)
return provider
def _get_tester_ganache(provider_uri=None) -> BaseProvider:
endpoint_uri = provider_uri or 'http://localhost:7545'
def _get_tester_ganache(eth_provider_uri=None) -> BaseProvider:
endpoint_uri = eth_provider_uri or 'http://localhost:7545'
return HTTPProvider(endpoint_uri=endpoint_uri)

View File

@ -51,7 +51,7 @@ class Web3Signer(Signer):
def from_signer_uri(cls, uri: str, testnet: bool = False) -> 'Web3Signer':
from nucypher.blockchain.eth.interfaces import BlockchainInterface, BlockchainInterfaceFactory
try:
blockchain = BlockchainInterfaceFactory.get_or_create_interface(provider_uri=uri)
blockchain = BlockchainInterfaceFactory.get_or_create_interface(eth_provider_uri=uri)
except BlockchainInterface.UnsupportedProvider:
raise cls.InvalidSignerURI(uri)
signer = cls(client=blockchain.client)

View File

@ -71,7 +71,7 @@ class Character(Learner):
keystore: Keystore = None,
crypto_power: CryptoPower = None,
crypto_power_ups: List[CryptoPowerUp] = None,
provider_uri: str = None,
eth_provider_uri: str = None,
signer: Signer = None,
registry: BaseContractRegistry = None,
include_self_in_the_state: bool = False,
@ -120,8 +120,8 @@ class Character(Learner):
federated_only = known_node_class._federated_only_instances
if federated_only:
if registry or provider_uri:
raise ValueError(f"Cannot init federated-only character with {registry or provider_uri}.")
if registry or eth_provider_uri:
raise ValueError(f"Cannot init federated-only character with {registry or eth_provider_uri}.")
self.federated_only: bool = federated_only
##########################################
@ -164,14 +164,14 @@ class Character(Learner):
# Blockchainy
if not self.federated_only:
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
self.registry = registry or InMemoryContractRegistry.from_latest_publication(network=domain) # See #1580
else:
self.registry = NO_BLOCKCHAIN_CONNECTION.bool_value(False)
# REST
self.network_middleware = network_middleware or RestMiddleware(registry=self.registry,
provider_uri=provider_uri)
eth_provider_uri=eth_provider_uri)
# Learner
Learner.__init__(self,

View File

@ -107,7 +107,7 @@ class Alice(Character, BlockchainPolicyAuthor):
# Mode
is_me: bool = True,
federated_only: bool = False,
provider_uri: str = None,
eth_provider_uri: str = None,
signer=None,
# Ownership
@ -153,16 +153,16 @@ class Alice(Character, BlockchainPolicyAuthor):
known_node_class=Ursula,
is_me=is_me,
federated_only=federated_only,
provider_uri=provider_uri,
eth_provider_uri=eth_provider_uri,
checksum_address=checksum_address,
network_middleware=network_middleware,
*args, **kwargs)
if is_me and not federated_only: # TODO: #289
if not provider_uri:
raise ValueError('Provider URI is required to init a decentralized character.')
if not eth_provider_uri:
raise ValueError('ETH Provider URI is required to init a decentralized character.')
blockchain = BlockchainInterfaceFactory.get_interface(provider_uri=self.provider_uri)
blockchain = BlockchainInterfaceFactory.get_interface(eth_provider_uri=self.eth_provider_uri)
signer = signer or Web3Signer(blockchain.client) # fallback to web3 provider by default for Alice.
self.transacting_power = TransactingPower(account=self.checksum_address, signer=signer)
self._crypto_power.consume_power_up(self.transacting_power)
@ -515,14 +515,14 @@ class Bob(Character):
is_me: bool = True,
controller: bool = True,
verify_node_bonding: bool = False,
provider_uri: str = None,
eth_provider_uri: str = None,
*args, **kwargs) -> None:
Character.__init__(self,
is_me=is_me,
known_node_class=Ursula,
verify_node_bonding=verify_node_bonding,
provider_uri=provider_uri,
eth_provider_uri=eth_provider_uri,
*args, **kwargs)
if controller:
@ -704,7 +704,7 @@ class Ursula(Teacher, Character, Operator):
client_password: str = None,
decentralized_identity_evidence=NOT_SIGNED,
provider_uri: str = None,
eth_provider_uri: str = None,
payment_method: PaymentMethod = None,
# Character
@ -726,7 +726,7 @@ class Ursula(Teacher, Character, Operator):
domain=domain,
known_node_class=Ursula,
include_self_in_the_state=True,
provider_uri=provider_uri,
eth_provider_uri=eth_provider_uri,
**character_kwargs)
if is_me:
@ -752,8 +752,8 @@ class Ursula(Teacher, Character, Operator):
# Decentralized Operator
if not federated_only:
if not provider_uri:
raise ValueError('Provider URI is required to init a decentralized character.')
if not eth_provider_uri:
raise ValueError('ETH Provider URI is required to init a decentralized character.')
if not payment_method:
raise ValueError('Payment method is required to init a decentralized character.')
@ -878,8 +878,8 @@ class Ursula(Teacher, Character, Operator):
# Connect to Provider
if not self.federated_only:
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=self.provider_uri):
BlockchainInterfaceFactory.initialize_interface(provider_uri=self.provider_uri)
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=self.eth_provider_uri):
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=self.eth_provider_uri)
if preflight:
self.__preflight()

View File

@ -80,7 +80,7 @@ class Vladimir(Ursula):
checksum_address=cls.fraud_address,
operator_address=cls.fraud_address,
signer=Web3Signer(blockchain.client),
provider_uri=blockchain.provider_uri,
eth_provider_uri=blockchain.eth_provider_uri,
payment_method=FreeReencryptions(), # Vladimir does not care about money.
)

View File

@ -80,7 +80,7 @@ def select_stake(staker: Staker,
def select_client_account(emitter,
provider_uri: str = None,
eth_provider_uri: str = None,
signer: Signer = None,
signer_uri: str = None,
prompt: str = None,
@ -101,17 +101,17 @@ def select_client_account(emitter,
if signer and signer_uri:
raise ValueError('Pass either signer or signer_uri but not both.')
if not any((provider_uri, signer_uri, signer)):
if not any((eth_provider_uri, signer_uri, signer)):
raise ValueError("At least a provider URI, signer URI or signer must be provided to select an account")
if provider_uri:
if eth_provider_uri:
# Connect to the blockchain in order to select an account
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=provider_uri):
BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri, poa=poa, emitter=emitter)
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=eth_provider_uri):
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=eth_provider_uri, poa=poa, emitter=emitter)
if not signer_uri:
signer_uri = provider_uri
signer_uri = eth_provider_uri
blockchain = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
blockchain = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
if signer_uri and not signer:
testnet = network != NetworksInventory.MAINNET

View File

@ -49,7 +49,7 @@ from nucypher.cli.options import (
option_network,
option_shares,
option_poa,
option_provider_uri,
option_eth_provider_uri,
option_registry_filepath,
option_signer_uri,
option_teacher_uri,
@ -79,7 +79,7 @@ class AliceConfigOptions:
def __init__(self,
dev: bool,
network: str,
provider_uri: str,
eth_provider_uri: str,
federated_only: bool,
discovery_port: int,
pay_with: str,
@ -96,7 +96,7 @@ class AliceConfigOptions:
self.dev = dev
self.domain = network
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
self.signer_uri = signer_uri
self.gas_strategy = gas_strategy
self.max_gas_price = max_gas_price
@ -126,7 +126,7 @@ class AliceConfigOptions:
dev_mode=True,
network_middleware=self.middleware,
domain=TEMPORARY_DOMAIN,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -148,7 +148,7 @@ class AliceConfigOptions:
dev_mode=False,
network_middleware=self.middleware,
domain=self.domain,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -172,7 +172,7 @@ group_config_options = group_options(
AliceConfigOptions,
dev=option_dev,
network=option_network(),
provider_uri=option_provider_uri(),
eth_provider_uri=option_eth_provider_uri(),
signer_uri=option_signer_uri,
gas_strategy=option_gas_strategy,
max_gas_price=option_max_gas_price,
@ -207,15 +207,15 @@ class AliceFullConfigOptions:
if opts.dev:
raise click.BadArgumentUsage("Cannot create a persistent development character")
if not opts.provider_uri and not opts.federated_only:
if not opts.eth_provider_uri and not opts.federated_only:
raise click.BadOptionUsage(
option_name='--provider',
message="--provider is required to create a new decentralized alice.")
option_name='--eth-network-provider',
message="--eth-network-provider is required to create a new decentralized alice.")
pay_with = opts.pay_with
if not pay_with and not opts.federated_only:
pay_with = select_client_account(emitter=emitter,
provider_uri=opts.provider_uri,
eth_provider_uri=opts.eth_provider_uri,
signer_uri=opts.signer_uri,
show_eth_balance=True,
network=opts.domain)
@ -227,7 +227,7 @@ class AliceFullConfigOptions:
checksum_address=pay_with,
domain=opts.domain,
federated_only=opts.federated_only,
provider_uri=opts.provider_uri,
eth_provider_uri=opts.eth_provider_uri,
signer_uri=opts.signer_uri,
registry_filepath=opts.registry_filepath,
poa=self.poa,
@ -245,7 +245,7 @@ class AliceFullConfigOptions:
payload = dict(checksum_address=opts.pay_with,
domain=opts.domain,
federated_only=opts.federated_only,
provider_uri=opts.provider_uri,
eth_provider_uri=opts.eth_provider_uri,
signer_uri=opts.signer_uri,
registry_filepath=opts.registry_filepath,
poa=self.poa,

View File

@ -48,7 +48,7 @@ from nucypher.cli.options import (
option_middleware,
option_min_stake,
option_network,
option_provider_uri,
option_eth_provider_uri,
option_registry_filepath,
option_signer_uri,
option_teacher_uri,
@ -70,8 +70,8 @@ class BobConfigOptions:
__option_name__ = 'config_options'
def __init__(self,
provider_uri: str,
def __init__(self,
eth_provider_uri: str,
network: str,
registry_filepath: Path,
checksum_address: str,
@ -85,7 +85,7 @@ class BobConfigOptions:
lonely: bool
):
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
self.signer_uri = signer_uri
self.gas_strategy = gas_strategy
self.max_gas_price = max_gas_price
@ -104,7 +104,7 @@ class BobConfigOptions:
emitter=emitter,
dev_mode=True,
domain=TEMPORARY_DOMAIN,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
signer_uri=self.signer_uri,
@ -125,7 +125,7 @@ class BobConfigOptions:
domain=self.domain,
checksum_address=self.checksum_address,
rest_port=self.discovery_port,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -143,7 +143,7 @@ class BobConfigOptions:
if not checksum_address and not self.federated_only:
checksum_address = select_client_account(emitter=emitter,
signer_uri=self.signer_uri,
provider_uri=self.provider_uri) # TODO: See #1888
eth_provider_uri=self.eth_provider_uri) # TODO: See #1888
return BobConfiguration.generate(
password=get_nucypher_password(emitter=emitter, confirm=True),
@ -153,7 +153,7 @@ class BobConfigOptions:
domain=self.domain,
federated_only=self.federated_only,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -165,7 +165,7 @@ class BobConfigOptions:
domain=self.domain,
federated_only=self.federated_only,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -178,7 +178,7 @@ class BobConfigOptions:
group_config_options = group_options(
BobConfigOptions,
provider_uri=option_provider_uri(),
eth_provider_uri=option_eth_provider_uri(),
gas_strategy=option_gas_strategy,
max_gas_price=option_max_gas_price,
signer_uri=option_signer_uri,

View File

@ -40,7 +40,7 @@ from nucypher.cli.literature import (
from nucypher.cli.options import (
option_registry_filepath,
option_signer_uri,
option_provider_uri,
option_eth_provider_uri,
option_network,
option_staking_provider,
option_operator_address,
@ -81,13 +81,13 @@ def check_bonding_requirements(emitter, agent: PREApplicationAgent, staking_prov
@click.command('bond')
@option_registry_filepath
@option_provider_uri(required=True)
@option_eth_provider_uri(required=True)
@option_signer_uri
@option_operator_address
@option_staking_provider
@option_network(required=True)
@option_force
def bond(registry_filepath, provider_uri, signer_uri, operator_address, staking_provider, network, force):
def bond(registry_filepath, eth_provider_uri, signer_uri, operator_address, staking_provider, network, force):
"""
Bond an operator to a staking provider.
The staking provider must be authorized to use the PREApplication.
@ -98,7 +98,7 @@ def bond(registry_filepath, provider_uri, signer_uri, operator_address, staking_
#
emitter = StdoutEmitter()
connect_to_blockchain(provider_uri=provider_uri, emitter=emitter)
connect_to_blockchain(eth_provider_uri=eth_provider_uri, emitter=emitter)
if not signer_uri:
emitter.message('--signer is required', color='red')
raise click.Abort()
@ -150,12 +150,12 @@ def bond(registry_filepath, provider_uri, signer_uri, operator_address, staking_
@click.command('unbond')
@option_registry_filepath
@option_provider_uri(required=True)
@option_eth_provider_uri(required=True)
@option_signer_uri
@option_staking_provider
@option_network()
@option_force
def unbond(registry_filepath, provider_uri, signer_uri, staking_provider, network, force):
def unbond(registry_filepath, eth_provider_uri, signer_uri, staking_provider, network, force):
"""Unbonds an operator from an authorized staking provider."""
#
@ -169,7 +169,7 @@ def unbond(registry_filepath, provider_uri, signer_uri, staking_provider, networ
if not network:
network = select_network(emitter=emitter)
connect_to_blockchain(provider_uri=provider_uri, emitter=emitter)
connect_to_blockchain(eth_provider_uri=eth_provider_uri, emitter=emitter)
registry = get_registry(network=network, registry_filepath=registry_filepath)
agent = ContractAgency.get_agent(PREApplicationAgent, registry=registry)
signer = Signer.from_signer_uri(signer_uri)

View File

@ -78,7 +78,7 @@ from nucypher.cli.options import (
option_hw_wallet,
option_network,
option_poa,
option_provider_uri,
option_eth_provider_uri,
option_signer_uri,
option_parameters, option_gas_strategy, option_max_gas_price)
from nucypher.cli.painting.deployment import (
@ -113,7 +113,7 @@ class ActorOptions:
__option_name__ = 'actor_options'
def __init__(self,
provider_uri: str,
eth_provider_uri: str,
deployer_address: str,
contract_name: str,
registry_infile: Path,
@ -131,7 +131,7 @@ class ActorOptions:
network: str
):
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
self.signer_uri = signer_uri
self.gas_strategy = gas_strategy
self.max_gas_price = max_gas_price
@ -154,7 +154,7 @@ class ActorOptions:
ensure_config_root(self.config_root)
deployer_interface = initialize_deployer_interface(poa=self.poa,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
emitter=emitter,
ignore_solidity_check=self.ignore_solidity_check,
gas_strategy=self.gas_strategy,
@ -185,7 +185,7 @@ class ActorOptions:
deployer_address = select_client_account(emitter=emitter,
prompt=SELECT_DEPLOYER_ACCOUNT,
registry=local_registry,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer=signer,
show_eth_balance=True)
@ -218,7 +218,7 @@ class ActorOptions:
group_actor_options = group_options(
ActorOptions,
provider_uri=option_provider_uri(),
eth_provider_uri=option_eth_provider_uri(),
gas_strategy=option_gas_strategy,
max_gas_price=option_max_gas_price,
signer_uri=option_signer_uri,
@ -282,20 +282,20 @@ def download_registry(general_config, config_root, registry_outfile, network, fo
@deploy.command()
@group_general_config
@option_provider_uri(required=True)
@option_eth_provider_uri(required=True)
@option_config_root
@option_registry_infile
@option_deployer_address
@option_poa
@option_network(required=False, default=NetworksInventory.DEFAULT)
@option_ignore_solidity_version
def inspect(general_config, provider_uri, config_root, registry_infile, deployer_address,
def inspect(general_config, eth_provider_uri, config_root, registry_infile, deployer_address,
poa, ignore_solidity_check, network):
"""Echo owner information and bare contract metadata."""
emitter = general_config.emitter
ensure_config_root(config_root)
initialize_deployer_interface(poa=poa,
provider_uri=provider_uri,
eth_provider_uri=eth_provider_uri,
emitter=emitter,
ignore_solidity_check=ignore_solidity_check)
download_required = not bool(registry_infile)

View File

@ -30,7 +30,7 @@ from nucypher.cli.literature import (
)
from nucypher.cli.options import (
option_network,
option_provider_uri,
option_eth_provider_uri,
option_federated_only,
option_teacher_uri,
option_registry_filepath,
@ -53,7 +53,7 @@ def porter():
@porter.command()
@group_general_config
@option_network(default=NetworksInventory.DEFAULT, validate=True, required=False)
@option_provider_uri(required=False)
@option_eth_provider_uri(required=False)
@option_federated_only
@option_teacher_uri
@option_registry_filepath
@ -67,7 +67,7 @@ def porter():
@click.option('--eager', help="Start learning and scraping the network before starting up other services", is_flag=True, default=True)
def run(general_config,
network,
provider_uri,
eth_provider_uri,
federated_only,
teacher_uri,
registry_filepath,
@ -109,9 +109,9 @@ def run(general_config,
federated_only=True)
else:
# decentralized/blockchain
if not provider_uri:
raise click.BadOptionUsage(option_name='--provider',
message="--provider is required for decentralized porter.")
if not eth_provider_uri:
raise click.BadOptionUsage(option_name='--eth-network-provider',
message="--eth-network-provider is required for decentralized porter.")
if not network:
# should never happen - network defaults to 'mainnet' if not specified
raise click.BadOptionUsage(option_name='--network',
@ -129,7 +129,7 @@ def run(general_config,
known_nodes={teacher} if teacher else None,
registry=registry,
start_learning_now=eager,
provider_uri=provider_uri)
eth_provider_uri=eth_provider_uri)
# RPC
if general_config.json_ipc:
@ -140,7 +140,7 @@ def run(general_config,
emitter.message(f"Network: {PORTER.domain.capitalize()}", color='green')
if not federated_only:
emitter.message(f"Provider: {provider_uri}", color='green')
emitter.message(f"Provider: {eth_provider_uri}", color='green')
# firm up falsy status (i.e. change specified empty string to None)
allow_origins = allow_origins if allow_origins else None

View File

@ -108,7 +108,7 @@ from nucypher.cli.options import (
option_light,
option_network,
option_poa,
option_provider_uri,
option_eth_provider_uri,
option_registry_filepath,
option_signer_uri,
option_staking_address,
@ -162,8 +162,8 @@ class StakeHolderConfigOptions:
__option_name__ = 'config_options'
def __init__(self, provider_uri, poa, light, registry_filepath, network, signer_uri):
self.provider_uri = provider_uri
def __init__(self, eth_provider_uri, poa, light, registry_filepath, network, signer_uri):
self.eth_provider_uri = eth_provider_uri
self.signer_uri = signer_uri
self.poa = poa
self.light = light
@ -175,7 +175,7 @@ class StakeHolderConfigOptions:
return StakeHolderConfiguration.from_configuration_file(
emitter=emitter,
filepath=config_file,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
poa=self.poa,
light=self.light,
@ -190,10 +190,10 @@ class StakeHolderConfigOptions:
def generate_config(self, config_root):
if self.provider_uri is None:
if self.eth_provider_uri is None:
raise click.BadOptionUsage(
option_name="--provider",
message="--provider must be specified to create a new stakeholder")
option_name="--eth-network-provider",
message="--eth-network-provider must be specified to create a new stakeholder")
if self.network is None:
raise click.BadOptionUsage(
@ -202,7 +202,7 @@ class StakeHolderConfigOptions:
return StakeHolderConfiguration.generate(
config_root=config_root,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
poa=self.poa,
light=self.light,
@ -211,7 +211,7 @@ class StakeHolderConfigOptions:
)
def get_updates(self) -> dict:
payload = dict(provider_uri=self.provider_uri,
payload = dict(eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
poa=self.poa,
light=self.light,
@ -224,7 +224,7 @@ class StakeHolderConfigOptions:
group_config_options = group_options(
StakeHolderConfigOptions,
provider_uri=option_provider_uri(),
eth_provider_uri=option_eth_provider_uri(),
poa=option_poa,
light=option_light,
registry_filepath=option_registry_filepath,
@ -248,7 +248,7 @@ class StakerOptions:
return stakeholder_config.produce(initial_address=initial_address, *args, **kwargs)
def get_blockchain(self):
return BlockchainInterfaceFactory.get_interface(provider_uri=self.config_options.provider_uri) # Eager connection
return BlockchainInterfaceFactory.get_interface(eth_provider_uri=self.config_options.eth_provider_uri) # Eager connection
group_staker_options = group_options(

View File

@ -35,7 +35,7 @@ from nucypher.cli.options import (
option_light,
option_network,
option_poa,
option_provider_uri,
option_eth_provider_uri,
option_registry_filepath,
option_staking_address,
)
@ -48,7 +48,7 @@ from nucypher.cli.utils import (
retrieve_events,
parse_event_filters_into_argument_filters
)
from nucypher.config.constants import NUCYPHER_ENVVAR_PROVIDER_URI
from nucypher.config.constants import NUCYPHER_ENVVAR_ETH_PROVIDER_URI
from nucypher.utilities.events import generate_events_csv_filepath
@ -56,8 +56,8 @@ class RegistryOptions:
__option_name__ = 'registry_options'
def __init__(self, provider_uri, poa, registry_filepath, light, network):
self.provider_uri = provider_uri
def __init__(self, eth_provider_uri, poa, registry_filepath, light, network):
self.eth_provider_uri = eth_provider_uri
self.poa = poa
self.registry_filepath = registry_filepath
self.light = light
@ -66,7 +66,7 @@ class RegistryOptions:
def setup(self, general_config) -> tuple:
emitter = setup_emitter(general_config)
registry = get_registry(network=self.network, registry_filepath=self.registry_filepath)
blockchain = connect_to_blockchain(emitter=emitter, provider_uri=self.provider_uri)
blockchain = connect_to_blockchain(emitter=emitter, eth_provider_uri=self.eth_provider_uri)
return emitter, registry, blockchain
@ -76,7 +76,7 @@ group_registry_options = group_options(
light=option_light,
registry_filepath=option_registry_filepath,
network=option_network(default=NetworksInventory.DEFAULT, validate=True), # TODO: See 2214
provider_uri=option_provider_uri(default=os.environ.get(NUCYPHER_ENVVAR_PROVIDER_URI)),
eth_provider_uri=option_eth_provider_uri(default=os.environ.get(NUCYPHER_ENVVAR_ETH_PROVIDER_URI)),
)
option_csv = click.option('--csv',

View File

@ -48,7 +48,7 @@ from nucypher.cli.options import (
option_min_stake,
option_network,
option_poa,
option_provider_uri,
option_eth_provider_uri,
option_registry_filepath,
option_signer_uri,
option_teacher_uri,
@ -72,7 +72,7 @@ class UrsulaConfigOptions:
__option_name__ = 'config_options'
def __init__(self,
provider_uri: str,
eth_provider_uri: str,
operator_address: str,
federated_only: bool,
rest_host: str,
@ -98,7 +98,7 @@ class UrsulaConfigOptions:
raise click.BadOptionUsage(option_name="--registry-filepath",
message=f"--registry-filepath cannot be used in federated mode.")
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
self.signer_uri = signer_uri
self.operator_address = operator_address
self.federated_only = federated_only
@ -127,7 +127,7 @@ class UrsulaConfigOptions:
poa=self.poa,
light=self.light,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -152,7 +152,7 @@ class UrsulaConfigOptions:
filepath=config_file,
domain=self.domain,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -183,7 +183,7 @@ class UrsulaConfigOptions:
prompt = "Select operator account"
self.operator_address = select_client_account(emitter=emitter,
prompt=prompt,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri)
# Resolve rest host
@ -200,7 +200,7 @@ class UrsulaConfigOptions:
federated_only=self.federated_only,
operator_address=self.operator_address,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -220,7 +220,7 @@ class UrsulaConfigOptions:
federated_only=self.federated_only,
operator_address=self.operator_address,
registry_filepath=self.registry_filepath,
provider_uri=self.provider_uri,
eth_provider_uri=self.eth_provider_uri,
signer_uri=self.signer_uri,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price,
@ -230,7 +230,7 @@ class UrsulaConfigOptions:
payment_method=self.payment_method,
payment_provider=self.payment_provider,
payment_network=self.payment_network
)
)
# Depends on defaults being set on Configuration classes, filtrates None values
updates = {k: v for k, v in payload.items() if v is not None}
return updates
@ -239,7 +239,7 @@ class UrsulaConfigOptions:
group_config_options = group_options(
# NOTE: Don't set defaults here or they will be applied to config updates. Use the Config API.
UrsulaConfigOptions,
provider_uri=option_provider_uri(),
eth_provider_uri=option_eth_provider_uri(),
signer_uri=option_signer_uri,
gas_strategy=option_gas_strategy,
max_gas_price=option_max_gas_price,
@ -326,8 +326,8 @@ def init(general_config, config_options, force, config_root, key_material):
_pre_launch_warnings(emitter, dev=None, force=force)
if not config_root:
config_root = general_config.config_root
if not config_options.federated_only and not config_options.provider_uri:
raise click.BadOptionUsage('--provider', message="--provider is required to initialize a new ursula.")
if not config_options.federated_only and not config_options.eth_provider_uri:
raise click.BadOptionUsage('--eth-network-provider', message="--eth-network-provider is required to initialize a new ursula.")
if not config_options.federated_only and not config_options.domain:
config_options.domain = select_network(emitter, message="Select Staking Network")
if not config_options.federated_only and not config_options.payment_network:

View File

@ -58,7 +58,7 @@ option_min_stake = click.option('--min-stake', help="The minimum stake the teach
option_operator_address = click.option('--operator-address', help="Address to bond as an operator", type=EIP55_CHECKSUM_ADDRESS, required=True)
option_parameters = click.option('--parameters', help="Filepath to a JSON file containing additional parameters", type=EXISTING_READABLE_FILE)
option_participant_address = click.option('--participant-address', help="Participant's checksum address.", type=EIP55_CHECKSUM_ADDRESS)
option_payment_provider = click.option('--payment-provider', help="Connection URL for payment method", type=click.STRING, required=False)
option_payment_provider = click.option('--payment-network-provider', '--payment-provider', 'payment_provider', help="Connection URL for payment method", type=click.STRING, required=False)
option_payment_network = click.option('--payment-network', help="Payment network name", type=click.STRING, required=False) # TODO: Choices
option_payment_method = click.option('--payment-method', help="Payment method name", type=PAYMENT_METHOD_CHOICES, required=False)
option_poa = click.option('--poa/--disable-poa', help="Inject POA middleware", is_flag=True, default=None)
@ -150,9 +150,9 @@ def option_policy_encrypting_key(required: bool = False):
required=required)
def option_provider_uri(default=None, required: bool = False):
def option_eth_provider_uri(default=None, required: bool = False):
return click.option(
'--provider', 'provider_uri',
'--eth-network-provider', '--eth-provider', 'eth_provider_uri',
help="Blockchain provider's URI i.e. 'file:///path/to/geth.ipc'",
type=click.STRING,
required=required,

View File

@ -38,7 +38,7 @@ def paint_staged_deployment(emitter, deployer_interface, administrator) -> None:
emitter.clear()
emitter.banner(NU_BANNER)
emitter.echo(f"Current Time ........ {maya.now().iso8601()}")
emitter.echo(f"Web3 Provider ....... {deployer_interface.provider_uri}")
emitter.echo(f"Web3 Provider ....... {deployer_interface.eth_provider_uri}")
emitter.echo(f"Block ............... {deployer_interface.client.block_number}")
emitter.echo(f"Gas Price ........... {deployer_interface.client.gas_price}")
emitter.echo(f"Deployer Address .... {administrator.checksum_address}")
@ -101,7 +101,7 @@ def paint_deployer_contract_inspection(emitter, registry, deployer_address) -> N
* Web3 Provider
====================================================================
Provider URI ............. {blockchain.provider_uri}
Provider URI ............. {blockchain.eth_provider_uri}
Registry ................ {registry.filepath}
* Standard Deployments

View File

@ -55,7 +55,7 @@ def paint_contract_status(registry, emitter):
blockchain = f"""
| '{blockchain.client.chain_name}' Blockchain Network |
Gas Price ................ {Web3.fromWei(blockchain.client.gas_price, 'gwei')} Gwei
Provider URI ............. {blockchain.provider_uri}
ETH Provider URI ......... {blockchain.eth_provider_uri}
Registry ................. {registry.filepath}
"""

View File

@ -30,7 +30,7 @@ def paint_decoded_transaction(emitter, proposal, contract, registry):
emitter.echo()
def paint_receipt_summary(emitter, receipt, chain_name: str = None, transaction_type=None, provider_uri: str = None):
def paint_receipt_summary(emitter, receipt, chain_name: str = None, transaction_type=None, eth_provider_uri: str = None):
tx_hash = receipt['transactionHash'].hex()
emitter.echo("OK", color='green', nl=False, bold=True)
if transaction_type:
@ -41,7 +41,7 @@ def paint_receipt_summary(emitter, receipt, chain_name: str = None, transaction_
emitter.echo(f"Block #{receipt['blockNumber']} | {receipt['blockHash'].hex()}")
if not chain_name:
blockchain = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
blockchain = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
chain_name = blockchain.client.chain_name
try:
url = etherscan_url(item=tx_hash, network=chain_name)

View File

@ -174,18 +174,18 @@ def get_registry(network: str, registry_filepath: Optional[Path] = None) -> Base
def connect_to_blockchain(emitter: StdoutEmitter,
provider_uri: str,
eth_provider_uri: str,
debug: bool = False,
light: bool = False
) -> BlockchainInterface:
try:
# Note: Conditional for test compatibility.
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=provider_uri):
BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri,
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=eth_provider_uri):
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=eth_provider_uri,
light=light,
emitter=emitter)
emitter.echo(message=CONNECTING_TO_BLOCKCHAIN)
blockchain = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
blockchain = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
return blockchain
except Exception as e:
if debug:
@ -196,19 +196,19 @@ def connect_to_blockchain(emitter: StdoutEmitter,
def initialize_deployer_interface(emitter: StdoutEmitter,
poa: bool,
provider_uri,
eth_provider_uri,
ignore_solidity_check: bool,
gas_strategy: str = None,
max_gas_price: int = None
) -> BlockchainDeployerInterface:
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=provider_uri):
deployer_interface = BlockchainDeployerInterface(provider_uri=provider_uri,
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=eth_provider_uri):
deployer_interface = BlockchainDeployerInterface(eth_provider_uri=eth_provider_uri,
poa=poa,
gas_strategy=gas_strategy,
max_gas_price=max_gas_price)
BlockchainInterfaceFactory.register_interface(interface=deployer_interface, emitter=emitter)
else:
deployer_interface = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
deployer_interface = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
deployer_interface.connect(ignore_solidity_check=ignore_solidity_check)
return deployer_interface

View File

@ -397,11 +397,11 @@ class CharacterConfiguration(BaseConfiguration):
# Blockchain
poa: bool = None,
light: bool = False,
provider_uri: str = None,
eth_provider_uri: str = None,
gas_strategy: Union[Callable, str] = DEFAULT_GAS_STRATEGY,
max_gas_price: Optional[int] = None,
signer_uri: str = None,
# Payments
# TODO: Resolve code prefixing below, possibly with the use of nested configuration fields
payment_method: str = None,
@ -447,7 +447,7 @@ class CharacterConfiguration(BaseConfiguration):
# Blockchain
self.poa = poa
self.is_light = light
self.provider_uri = provider_uri or NO_BLOCKCHAIN_CONNECTION
self.eth_provider_uri = eth_provider_uri or NO_BLOCKCHAIN_CONNECTION
self.signer_uri = signer_uri or None
# Learner
@ -481,7 +481,7 @@ class CharacterConfiguration(BaseConfiguration):
# Check for incompatible values
blockchain_args = {'filepath': registry_filepath,
'poa': poa,
'provider_uri': provider_uri,
'eth_provider_uri': eth_provider_uri,
'gas_strategy': gas_strategy,
'max_gas_price': max_gas_price}
if any(blockchain_args.values()):
@ -493,7 +493,7 @@ class CharacterConfiguration(BaseConfiguration):
# federated configuration.
self.poa = False
self.is_light = False
self.provider_uri = None
self.eth_provider_uri = None
self.registry_filepath = None
self.gas_strategy = None
self.max_gas_price = None
@ -510,16 +510,16 @@ class CharacterConfiguration(BaseConfiguration):
else:
self.gas_strategy = gas_strategy
self.max_gas_price = max_gas_price # gwei
is_initialized = BlockchainInterfaceFactory.is_interface_initialized(provider_uri=self.provider_uri)
if not is_initialized and provider_uri:
BlockchainInterfaceFactory.initialize_interface(provider_uri=self.provider_uri,
is_initialized = BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=self.eth_provider_uri)
if not is_initialized and eth_provider_uri:
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=self.eth_provider_uri,
poa=self.poa,
light=self.is_light,
emitter=emitter,
gas_strategy=self.gas_strategy,
max_gas_price=self.max_gas_price)
else:
self.log.warn(f"Using existing blockchain interface connection ({self.provider_uri}).")
self.log.warn(f"Using existing blockchain interface connection ({self.eth_provider_uri}).")
if not self.registry:
# TODO: These two code blocks are untested.
@ -539,7 +539,7 @@ class CharacterConfiguration(BaseConfiguration):
# raise self.ConfigurationError("payment provider is required.")
self.payment_method = payment_method or self.DEFAULT_PAYMENT_METHOD
self.payment_network = payment_network or self.DEFAULT_PAYMENT_NETWORK
self.payment_provider = payment_provider or (self.provider_uri or None) # default to L1 payments
self.payment_provider = payment_provider or (self.eth_provider_uri or None) # default to L1 payments
if dev_mode:
self.__temp_dir = UNINITIALIZED_CONFIGURATION
@ -720,10 +720,10 @@ class CharacterConfiguration(BaseConfiguration):
# Optional values (mode)
if not self.federated_only:
if self.provider_uri:
if self.eth_provider_uri:
if not self.signer_uri:
self.signer_uri = self.provider_uri
payload.update(dict(provider_uri=self.provider_uri,
self.signer_uri = self.eth_provider_uri
payload.update(dict(eth_provider_uri=self.eth_provider_uri,
poa=self.poa,
light=self.is_light,
signer_uri=self.signer_uri))

View File

@ -267,7 +267,7 @@ class StakeHolderConfiguration(CharacterConfiguration):
_CONFIG_FIELDS = (
*CharacterConfiguration._CONFIG_FIELDS,
'provider_uri'
'eth_provider_uri'
)
def __init__(self, checksum_addresses: set = None, *args, **kwargs):
@ -277,8 +277,8 @@ class StakeHolderConfiguration(CharacterConfiguration):
def static_payload(self) -> dict:
"""Values to read/write from stakeholder JSON configuration files"""
if not self.signer_uri:
self.signer_uri = self.provider_uri
payload = dict(provider_uri=self.provider_uri,
self.signer_uri = self.eth_provider_uri
payload = dict(eth_provider_uri=self.eth_provider_uri,
poa=self.poa,
light=self.is_light,
domain=self.domain,

View File

@ -33,10 +33,10 @@ NUCYPHER_ENVVAR_OPERATOR_ETH_PASSWORD = "NUCYPHER_WORKER_ETH_PASSWORD"
NUCYPHER_ENVVAR_STAKING_PROVIDER_ETH_PASSWORD = "NUCYPHER_STAKING_PROVIDER_ETH_PASSWORD"
NUCYPHER_ENVVAR_ALICE_ETH_PASSWORD = "NUCYPHER_ALICE_ETH_PASSWORD"
NUCYPHER_ENVVAR_BOB_ETH_PASSWORD = "NUCYPHER_BOB_ETH_PASSWORD"
NUCYPHER_ENVVAR_PROVIDER_URI = "NUCYPHER_PROVIDER_URI"
NUCYPHER_ENVVAR_ETH_PROVIDER_URI = "NUCYPHER_ETH_PROVIDER_URI"
NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE = "NUCYPHER_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE"
NUCYPHER_ENVVAR_PROVIDERS_PAGINATION_SIZE = "NUCYPHER_PROVIDERS_PAGINATION_SIZE"
NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE = "NUCYPHER_STAKING_PROVIDERS_PAGINATION_SIZE_LIGHT_NODE"
NUCYPHER_ENVVAR_STAKING_PROVIDERS_PAGINATION_SIZE = "NUCYPHER_STAKING_PROVIDERS_PAGINATION_SIZE"
# Base Filepaths
NUCYPHER_PACKAGE = Path(nucypher.__file__).parent.resolve()

View File

@ -38,9 +38,9 @@ class NucypherMiddlewareClient:
library = requests
timeout = 1.2
def __init__(self, registry=None, provider_uri: str = None, *args, **kwargs):
def __init__(self, registry=None, eth_provider_uri: str = None, *args, **kwargs):
self.registry = registry
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
@staticmethod
def response_cleaner(response):
@ -56,7 +56,7 @@ class NucypherMiddlewareClient:
if node_or_sprout:
if node_or_sprout is not EXEMPT_FROM_VERIFICATION:
node = node_or_sprout.mature() # Morph into a node.
node.verify_node(network_middleware_client=self, registry=self.registry, provider_uri=self.provider_uri)
node.verify_node(network_middleware_client=self, registry=self.registry, eth_provider_uri=self.eth_provider_uri)
return self.parse_node_or_host_and_port(node_or_sprout, host, port)
def parse_node_or_host_and_port(self, node, host, port):
@ -176,8 +176,8 @@ class RestMiddleware:
def __init__(self, *args, **kwargs):
super().__init__(status=HTTPStatus.FORBIDDEN, *args, **kwargs)
def __init__(self, registry=None, provider_uri: str = None):
self.client = self._client_class(registry=registry, provider_uri=provider_uri)
def __init__(self, registry=None, eth_provider_uri: str = None):
self.client = self._client_class(registry=registry, eth_provider_uri=eth_provider_uri)
def get_certificate(self, host, port, timeout=3, retry_attempts: int = 3, retry_rate: int = 2,
current_attempt: int = 0):

View File

@ -1066,16 +1066,16 @@ class Teacher:
raise self.UnbondedOperator(f"Operator {self.operator_address} is not bonded")
return staking_provider_address == self.checksum_address
def _staking_provider_is_really_staking(self, registry: BaseContractRegistry, provider_uri: Optional[str] = None) -> bool:
def _staking_provider_is_really_staking(self, registry: BaseContractRegistry, eth_provider_uri: Optional[str] = None) -> bool:
"""
This method assumes the stamp's signature is valid and accurate.
As a follow-up, this checks that the staking provider is, indeed, staking.
"""
application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=registry, provider_uri=provider_uri) # type: PREApplicationAgent
application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=registry, eth_provider_uri=eth_provider_uri) # type: PREApplicationAgent
is_staking = application_agent.is_authorized(staking_provider=self.checksum_address) # checksum address here is staking provider
return is_staking
def validate_worker(self, registry: BaseContractRegistry = None, provider_uri: Optional[str] = None) -> None:
def validate_worker(self, registry: BaseContractRegistry = None, eth_provider_uri: Optional[str] = None) -> None:
# Federated
if self.federated_only:
@ -1100,7 +1100,7 @@ class Teacher:
self.log.debug(message)
raise self.UnbondedOperator(message)
if self._staking_provider_is_really_staking(registry=registry, provider_uri=provider_uri): # <-- Blockchain CALL
if self._staking_provider_is_really_staking(registry=registry, eth_provider_uri=eth_provider_uri): # <-- Blockchain CALL
self.verified_worker = True
else:
raise self.NotStaking(f"{self.checksum_address} is not staking")
@ -1116,7 +1116,7 @@ class Teacher:
else:
raise self.InvalidNode("Metadata signature is invalid")
def validate_metadata(self, registry: BaseContractRegistry = None, provider_uri: Optional[str] = None):
def validate_metadata(self, registry: BaseContractRegistry = None, eth_provider_uri: Optional[str] = None):
# Verify the metadata signature
if not self.verified_metadata:
@ -1128,7 +1128,7 @@ class Teacher:
# Offline check of valid stamp signature by worker
try:
self.validate_worker(registry=registry, provider_uri=provider_uri)
self.validate_worker(registry=registry, eth_provider_uri=eth_provider_uri)
except self.WrongMode:
if bool(registry):
raise
@ -1136,7 +1136,7 @@ class Teacher:
def verify_node(self,
network_middleware_client,
registry: BaseContractRegistry = None,
provider_uri: Optional[str] = None,
eth_provider_uri: Optional[str] = None,
certificate_filepath: Optional[Path] = None,
force: bool = False
) -> bool:
@ -1168,7 +1168,7 @@ class Teacher:
"on-chain Staking verification will not be performed.")
# This is both the stamp's client signature and interface metadata check; May raise InvalidNode
self.validate_metadata(registry=registry, provider_uri=provider_uri)
self.validate_metadata(registry=registry, eth_provider_uri=eth_provider_uri)
# The node's metadata is valid; let's be sure the interface is in order.
if not certificate_filepath:

View File

@ -103,7 +103,7 @@ class ContractPayment(PaymentMethod, ABC):
"""Returns an instance of the agent used to carry out contract payments."""
if self.__agent:
return self.__agent # get cache
agent = self._AGENT(provider_uri=self.provider, registry=self.registry)
agent = self._AGENT(eth_provider_uri=self.provider, registry=self.registry)
self.__agent = agent
return self.__agent # set cache

View File

@ -63,7 +63,7 @@ def encode_constructor_arguments(web3: Web3,
return data
def connect_web3_provider(provider_uri: str) -> None:
def connect_web3_provider(eth_provider_uri: str) -> None:
"""
Convenience function for connecting to an ethereum provider now.
This may be used to optimize the startup time of some applications by
@ -71,7 +71,7 @@ def connect_web3_provider(provider_uri: str) -> None:
"""
from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=provider_uri):
BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri)
interface = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=eth_provider_uri):
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=eth_provider_uri)
interface = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
interface.connect()

View File

@ -84,16 +84,16 @@ the Pipe for nucypher network operations
controller: bool = True,
federated_only: bool = False,
node_class: object = Ursula,
provider_uri: str = None,
eth_provider_uri: str = None,
*args, **kwargs):
self.federated_only = federated_only
if not self.federated_only:
if not provider_uri:
raise ValueError('Provider URI is required for decentralized Porter.')
if not eth_provider_uri:
raise ValueError('ETH Provider URI is required for decentralized Porter.')
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=provider_uri):
BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri)
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=eth_provider_uri):
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=eth_provider_uri)
self.registry = registry or InMemoryContractRegistry.from_latest_publication(network=domain)
self.application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=self.registry)

View File

@ -135,7 +135,7 @@ class UrsulaInfoMetricsCollector(BaseMetricsCollector):
if not self.ursula.federated_only:
application_agent = ContractAgency.get_agent(PREApplicationAgent, registry=self.ursula.registry)
authorized = application_agent.get_authorized_stake(staking_provider=self.ursula.checksum_address)
decentralized_payload = {'provider': str(self.ursula.provider_uri),
decentralized_payload = {'provider': str(self.ursula.eth_provider_uri),
'active_stake': str(authorized)}
base_payload.update(decentralized_payload)
@ -148,9 +148,9 @@ class UrsulaInfoMetricsCollector(BaseMetricsCollector):
class BlockchainMetricsCollector(BaseMetricsCollector):
"""Collector for Blockchain specific metrics."""
def __init__(self, provider_uri: str):
def __init__(self, eth_provider_uri: str):
super().__init__()
self.provider_uri = provider_uri
self.eth_provider_uri = eth_provider_uri
def initialize(self, metrics_prefix: str, registry: CollectorRegistry) -> None:
self.metrics = {
@ -160,7 +160,7 @@ class BlockchainMetricsCollector(BaseMetricsCollector):
}
def _collect_internal(self) -> None:
blockchain = BlockchainInterfaceFactory.get_or_create_interface(provider_uri=self.provider_uri)
blockchain = BlockchainInterfaceFactory.get_or_create_interface(eth_provider_uri=self.eth_provider_uri)
self.metrics["current_eth_block_number"].set(blockchain.client.block_number)

View File

@ -183,7 +183,7 @@ def create_metrics_collectors(ursula: 'Ursula', metrics_prefix: str) -> List[Met
if not ursula.federated_only:
# Blockchain prometheus
collectors.append(BlockchainMetricsCollector(provider_uri=ursula.provider_uri))
collectors.append(BlockchainMetricsCollector(eth_provider_uri=ursula.eth_provider_uri))
# Staker prometheus
collectors.append(StakerMetricsCollector(domain=ursula.domain,

View File

@ -16,13 +16,13 @@
"""
# Get an interactive Python session with all the NuCypher agents loaded by running:
# python -i scripts/hooks/nucypher_agents.py <NETWORK> <PROVIDER_URI>
# python -i scripts/hooks/nucypher_agents.py <NETWORK> <ETH_PROVIDER_URI>
import sys
import os
from nucypher.blockchain.eth.agents import ContractAgency, StakingEscrowAgent, PolicyManagerAgent, NucypherTokenAgent
from nucypher.config.constants import NUCYPHER_ENVVAR_PROVIDER_URI
from nucypher.config.constants import NUCYPHER_ENVVAR_ETH_PROVIDER_URI
from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory
from nucypher.blockchain.eth.registry import InMemoryContractRegistry
@ -40,10 +40,10 @@ GlobalLoggerSettings.start_console_logging()
emitter = StdoutEmitter(verbosity=2)
try:
provider_uri = sys.argv[2]
eth_provider_uri = sys.argv[2]
except IndexError:
provider_uri = os.getenv(NUCYPHER_ENVVAR_PROVIDER_URI)
if not provider_uri:
eth_provider_uri = os.getenv(NUCYPHER_ENVVAR_ETH_PROVIDER_URI)
if not eth_provider_uri:
emitter.message("You have to pass a provider URI", color='red')
sys.exit(-1)
@ -53,11 +53,11 @@ except IndexError:
network = "ibex"
BlockchainInterfaceFactory.initialize_interface(provider_uri=provider_uri,
BlockchainInterfaceFactory.initialize_interface(eth_provider_uri=eth_provider_uri,
light=False,
emitter=emitter)
blockchain = BlockchainInterfaceFactory.get_interface(provider_uri=provider_uri)
blockchain = BlockchainInterfaceFactory.get_interface(eth_provider_uri=eth_provider_uri)
emitter.echo(message="Reading Latest Chaindata...")
blockchain.connect()

View File

@ -45,7 +45,7 @@ def test_deployer_interface_multiversion_contract():
# Prepare chain
BlockchainInterfaceFactory._interfaces.clear()
blockchain_interface = BlockchainDeployerInterface(provider_uri='tester://pyevm', gas_strategy='free')
blockchain_interface = BlockchainDeployerInterface(eth_provider_uri='tester://pyevm', gas_strategy='free')
blockchain_interface.connect()
BlockchainInterfaceFactory.register_interface(interface=blockchain_interface) # Lets this test run in isolation

View File

@ -50,7 +50,7 @@ def test_testerchain_creation(testerchain, another_testerchain):
for chain in chains:
# Ensure we are testing on the correct network...
assert 'tester' in chain.provider_uri
assert 'tester' in chain.eth_provider_uri
# ... and that there are already some blocks mined
chain.w3.eth.web3.testing.mine(1)
@ -107,7 +107,7 @@ def test_multiversion_contract():
BlockchainDeployerInterface.GAS_STRATEGIES = {**BlockchainDeployerInterface.GAS_STRATEGIES,
'free': free_gas_price_strategy}
blockchain_interface = BlockchainDeployerInterface(provider_uri='tester://pyevm/2', gas_strategy='free')
blockchain_interface = BlockchainDeployerInterface(eth_provider_uri='tester://pyevm/2', gas_strategy='free')
blockchain_interface.connect(compile_now=False)
blockchain_interface._raw_contract_cache = compiled_contracts

View File

@ -24,7 +24,7 @@ from nucypher_core import EncryptedKeyFrag
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.policy.payment import SubscriptionManagerPayment
from tests.constants import TEST_PROVIDER_URI
from tests.constants import TEST_ETH_PROVIDER_URI
shares = 3
policy_end_datetime = maya.now() + datetime.timedelta(days=35)
@ -47,7 +47,7 @@ def check(policy, bob, ursulas):
def test_decentralized_grant_subscription_manager(blockchain_alice, blockchain_bob, blockchain_ursulas):
payment_method = SubscriptionManagerPayment(provider=TEST_PROVIDER_URI, network=TEMPORARY_DOMAIN)
payment_method = SubscriptionManagerPayment(provider=TEST_ETH_PROVIDER_URI, network=TEMPORARY_DOMAIN)
blockchain_alice.payment_method = payment_method
policy = blockchain_alice.grant(bob=blockchain_bob,
label=os.urandom(16),

View File

@ -25,7 +25,7 @@ from nucypher.characters.lawful import Enrico, Ursula
from nucypher.characters.unlawful import Amonia
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.policy.payment import SubscriptionManagerPayment
from tests.constants import TEST_PROVIDER_URI
from tests.constants import TEST_ETH_PROVIDER_URI
def test_try_to_post_free_service_by_hacking_enact(blockchain_ursulas,
@ -67,7 +67,7 @@ def test_pay_a_flunky_instead_of_the_arranged_ursula(blockchain_alice,
testerchain):
# This test only applies to the PolicyManager payment method.
payment_method = SubscriptionManagerPayment(provider=TEST_PROVIDER_URI, network=TEMPORARY_DOMAIN)
payment_method = SubscriptionManagerPayment(provider=TEST_ETH_PROVIDER_URI, network=TEMPORARY_DOMAIN)
blockchain_alice.payment_method = payment_method
amonia = Amonia.from_lawful_alice(blockchain_alice)

View File

@ -23,7 +23,7 @@ from nucypher.blockchain.eth.signers.software import Web3Signer
from nucypher.characters.lawful import Character
from nucypher.crypto.utils import verify_eip_191
from nucypher.crypto.powers import (TransactingPower)
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_PROVIDER_URI
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_ETH_PROVIDER_URI
def test_character_transacting_power_signing(testerchain, agency, test_registry):
@ -31,7 +31,7 @@ def test_character_transacting_power_signing(testerchain, agency, test_registry)
# Pretend to be a character.
eth_address = testerchain.etherbase_account
signer = Character(is_me=True,
provider_uri=MOCK_PROVIDER_URI,
eth_provider_uri=MOCK_ETH_PROVIDER_URI,
registry=test_registry,
checksum_address=eth_address)

View File

@ -31,7 +31,7 @@ from nucypher.blockchain.eth.signers import Signer
from nucypher.blockchain.eth.sol import SOLIDITY_COMPILER_VERSION
from nucypher.cli.commands.deploy import deploy
from nucypher.config.constants import TEMPORARY_DOMAIN
from tests.constants import TEST_PROVIDER_URI, YES_ENTER
from tests.constants import TEST_ETH_PROVIDER_URI, YES_ENTER
PLANNED_UPGRADES = 4
CONTRACTS_TO_UPGRADE = ('StakingEscrow', 'PolicyManager', 'Adjudicator', 'StakingInterface')
@ -48,8 +48,8 @@ def test_deploy_single_contract(click_runner, tempfile_path):
command = ['contracts',
'--contract-name', 'SubscriptionManager',
'--registry-infile', str(tempfile_path.absolute()),
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--debug']
@ -65,8 +65,8 @@ def test_deploy_signer_uri_testnet_check(click_runner, mocker, tempfile_path):
command = ['contracts',
'--contract-name', NucypherTokenAgent.contract_name,
'--registry-infile', str(tempfile_path.absolute()),
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--debug']
@ -75,13 +75,13 @@ def test_deploy_signer_uri_testnet_check(click_runner, mocker, tempfile_path):
# fail trying to deploy contract to testnet since ETH balance is 0, signer will already have been initialized
result = click_runner.invoke(deploy, command, input=user_input, catch_exceptions=False)
assert result.exit_code != 0, result.output # expected failure given eth balance is 0
spy_from_signer_uri.assert_called_with(TEST_PROVIDER_URI, testnet=True)
spy_from_signer_uri.assert_called_with(TEST_ETH_PROVIDER_URI, testnet=True)
# fail trying to deploy contract to mainnet (:-o) since ETH balance is 0, signer will already have been initialized
with patch('nucypher.blockchain.eth.clients.EthereumTesterClient.chain_name', PropertyMock(return_value='Mainnet')):
result = click_runner.invoke(deploy, command, input=user_input, catch_exceptions=False)
assert result.exit_code != 0, result.output # expected failure given invalid contract name
spy_from_signer_uri.assert_called_with(TEST_PROVIDER_URI, testnet=False) # the "real" deal
spy_from_signer_uri.assert_called_with(TEST_ETH_PROVIDER_URI, testnet=False) # the "real" deal
@pytest.mark.skip()
@ -108,8 +108,8 @@ def test_upgrade_contracts(click_runner, test_registry_source_manager, test_regi
cli_action = 'upgrade'
base_command = ('--registry-infile', str(registry_filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--confirmations', 1,
'--network', TEMPORARY_DOMAIN,
'--force' # skip registry preflight check for tests
@ -239,8 +239,8 @@ def test_rollback(click_runner, testerchain, registry_filepath, agency):
'--contract-name', contract_name,
'--registry-infile', str(registry_filepath.absolute()),
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI
)
user_input = '0\n' + YES_ENTER

View File

@ -39,7 +39,7 @@ from nucypher.cli.commands.deploy import deploy
from nucypher.config.constants import TEMPORARY_DOMAIN
from tests.constants import (
INSECURE_DEVELOPMENT_PASSWORD,
TEST_PROVIDER_URI,
TEST_ETH_PROVIDER_URI,
YES_ENTER
)
@ -50,7 +50,7 @@ ALTERNATE_REGISTRY_FILEPATH_2 = Path('/tmp/nucypher-test-registry-alternate-2.js
def test_nucypher_deploy_inspect_no_deployments(click_runner, testerchain, new_local_registry):
status_command = ('inspect',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-infile', str(new_local_registry.filepath.absolute()))
result = click_runner.invoke(deploy, status_command, catch_exceptions=False)
@ -67,7 +67,7 @@ def test_nucypher_deploy_inspect_fully_deployed(click_runner, agency_local_regis
status_command = ('inspect',
'--registry-infile', str(agency_local_registry.filepath.absolute()),
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI)
'--eth-provider', TEST_ETH_PROVIDER_URI)
result = click_runner.invoke(deploy,
status_command,
@ -97,8 +97,8 @@ def test_transfer_ownership(click_runner, testerchain, agency_local_registry):
ownership_command = ('transfer-ownership',
'--registry-infile', str(agency_local_registry.filepath.absolute()),
'--contract-name', STAKING_ESCROW_CONTRACT_NAME,
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--target-address', maclane)
@ -121,8 +121,8 @@ def test_transfer_ownership(click_runner, testerchain, agency_local_registry):
'--deployer-address', maclane,
'--contract-name', STAKING_ESCROW_CONTRACT_NAME,
'--registry-infile', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--target-address', michwill)
@ -148,8 +148,8 @@ def test_bare_contract_deployment_to_alternate_registry(click_runner, agency_loc
command = ('contracts',
'--contract-name', SubscriptionManagerDeployer.contract_name, # FIXME
# '--mode', 'bare', # FIXME
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--registry-infile', str(agency_local_registry.filepath.absolute()),
'--registry-outfile', str(ALTERNATE_REGISTRY_FILEPATH.absolute()),
'--network', TEMPORARY_DOMAIN,
@ -194,8 +194,8 @@ def test_manual_proxy_retargeting(monkeypatch, testerchain, click_runner, applic
'--deployer-address', michwill,
'--contract-name', StakingEscrowDeployer.contract_name,
'--target-address', untargeted_deployment.address,
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH.absolute()),
'--confirmations', 4,
'--network', TEMPORARY_DOMAIN)
@ -224,9 +224,9 @@ def test_manual_deployment_of_idle_network(click_runner):
# 1. Deploy NuCypherToken
command = ('contracts',
'--contract-name', NUCYPHER_TOKEN_CONTRACT_NAME,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--signer', TEST_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH_2.absolute()))
result = click_runner.invoke(deploy, command, input=user_input, catch_exceptions=False)
@ -242,8 +242,8 @@ def test_manual_deployment_of_idle_network(click_runner):
command = ('contracts',
'--contract-name', STAKING_ESCROW_CONTRACT_NAME,
'--mode', 'init',
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH_2.absolute()))
@ -256,8 +256,8 @@ def test_manual_deployment_of_idle_network(click_runner):
# 4. Deploy Adjudicator
command = ('contracts',
'--contract-name', ADJUDICATOR_CONTRACT_NAME,
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH_2.absolute()))
@ -271,8 +271,8 @@ def test_manual_deployment_of_idle_network(click_runner):
command = ('contracts',
'--contract-name', STAKING_ESCROW_CONTRACT_NAME,
'--mode', 'idle',
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH_2.absolute()))
@ -286,8 +286,8 @@ def test_manual_deployment_of_idle_network(click_runner):
command = ('contracts',
'--contract-name', STAKING_ESCROW_CONTRACT_NAME,
'--activate',
'--provider', TEST_PROVIDER_URI,
'--signer', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--registry-infile', str(ALTERNATE_REGISTRY_FILEPATH_2.absolute()))

View File

@ -36,7 +36,7 @@ from nucypher.config.characters import AliceConfiguration, BobConfiguration
from nucypher.config.constants import NUCYPHER_ENVVAR_KEYSTORE_PASSWORD, TEMPORARY_DOMAIN, \
NUCYPHER_ENVVAR_ALICE_ETH_PASSWORD, NUCYPHER_ENVVAR_BOB_ETH_PASSWORD
from nucypher.utilities.logging import GlobalLoggerSettings
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, TEST_PROVIDER_URI
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, TEST_ETH_PROVIDER_URI
PLAINTEXT = "I'm bereaved, not a sap!"
@ -137,7 +137,7 @@ def run_entire_cli_lifecycle(click_runner,
if federated:
alice_init_args += ('--federated-only',)
else:
alice_init_args += ('--provider', TEST_PROVIDER_URI,
alice_init_args += ('--eth-provider', TEST_ETH_PROVIDER_URI,
'--pay-with', testerchain.alice_account,
'--payment-network', TEMPORARY_DOMAIN,
'--registry-filepath', str(registry_filepath.absolute()))
@ -181,7 +181,7 @@ def run_entire_cli_lifecycle(click_runner,
if federated:
bob_init_args += ('--federated-only',)
else:
bob_init_args += ('--provider', TEST_PROVIDER_URI,
bob_init_args += ('--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', str(registry_filepath.absolute()),
'--checksum-address', testerchain.bob_account)
@ -331,7 +331,7 @@ def run_entire_cli_lifecycle(click_runner,
if federated:
grant_args += ('--federated-only',)
else:
grant_args += ('--provider', TEST_PROVIDER_URI,
grant_args += ('--eth-provider', TEST_ETH_PROVIDER_URI,
'--value', Web3.toWei(9, 'gwei'))
grant_result = click_runner.invoke(nucypher_cli, grant_args, catch_exceptions=False, env=envvars)

View File

@ -31,7 +31,7 @@ from tests.constants import (
INSECURE_DEVELOPMENT_PASSWORD,
MOCK_CUSTOM_INSTALLATION_PATH,
MOCK_IP_ADDRESS,
TEST_PROVIDER_URI,
TEST_ETH_PROVIDER_URI,
YES
)
@ -96,14 +96,14 @@ def test_reconfigure_via_cli(click_runner, custom_filepath: Path, config_class,
# Read pre-edit state
config = config_class.from_configuration_file(custom_config_filepath)
assert config.federated_only
assert config.provider_uri != TEST_PROVIDER_URI
assert config.eth_provider_uri != TEST_ETH_PROVIDER_URI
del config
# Write
view_args = (config_class.CHARACTER_CLASS.__name__.lower(), 'config',
'--config-file', str(custom_config_filepath.absolute()),
'--decentralized',
'--provider', TEST_PROVIDER_URI)
'--eth-provider', TEST_ETH_PROVIDER_URI)
result = click_runner.invoke(nucypher_cli, view_args, env=ENV)
assert result.exit_code == 0
@ -116,4 +116,4 @@ def test_reconfigure_via_cli(click_runner, custom_filepath: Path, config_class,
# After editing the fields have been updated
assert not config.federated_only
assert config.provider_uri == TEST_PROVIDER_URI
assert config.eth_provider_uri == TEST_ETH_PROVIDER_URI

View File

@ -37,7 +37,7 @@ from tests.constants import (
MOCK_CUSTOM_INSTALLATION_PATH,
MOCK_IP_ADDRESS,
MOCK_IP_ADDRESS_2,
TEST_PROVIDER_URI
TEST_ETH_PROVIDER_URI
)
@ -113,7 +113,7 @@ def test_coexisting_configurations(click_runner,
alice_init_args = ('alice', 'init',
'--network', TEMPORARY_DOMAIN,
'--payment-network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--pay-with', alice,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--config-root', str(custom_filepath.absolute()))
@ -128,7 +128,7 @@ def test_coexisting_configurations(click_runner,
init_args = ('ursula', 'init',
'--network', TEMPORARY_DOMAIN,
'--payment-network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--operator-address', ursula,
'--rest-host', MOCK_IP_ADDRESS,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
@ -151,7 +151,7 @@ def test_coexisting_configurations(click_runner,
'--operator-address', another_ursula,
'--rest-host', MOCK_IP_ADDRESS_2,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--config-root', str(custom_filepath.absolute()))
result = click_runner.invoke(nucypher_cli, init_args, catch_exceptions=False, env=envvars)
@ -238,7 +238,7 @@ def test_corrupted_configuration(click_runner,
#
init_args = ('ursula', 'init',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--operator-address', another_ursula,
'--network', TEMPORARY_DOMAIN,
'--payment-network', TEMPORARY_DOMAIN,
@ -269,7 +269,7 @@ def test_corrupted_configuration(click_runner,
init_args = ('ursula', 'init',
'--network', TEMPORARY_DOMAIN,
'--payment-network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--operator-address', another_ursula,
'--rest-host', MOCK_IP_ADDRESS,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),

View File

@ -30,7 +30,7 @@ from nucypher.cli.literature import (
from nucypher.cli.main import nucypher_cli
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.utilities.porter.porter import Porter
from tests.constants import TEST_PROVIDER_URI
from tests.constants import TEST_ETH_PROVIDER_URI
from tests.utils.ursula import select_test_port
@ -237,14 +237,14 @@ def test_blockchain_porter_cli_run_simple(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri)
result = click_runner.invoke(nucypher_cli, porter_run_command, catch_exceptions=False)
assert result.exit_code == 0
output = result.output
assert f"Network: {TEMPORARY_DOMAIN}" in output
assert f"Provider: {TEST_PROVIDER_URI}" in output
assert f"Provider: {TEST_ETH_PROVIDER_URI}" in output
assert PORTER_RUN_MESSAGE.format(http_scheme="http", http_port=Porter.DEFAULT_PORT) in output
# Non-default port
@ -252,7 +252,7 @@ def test_blockchain_porter_cli_run_simple(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--http-port', non_default_port,
'--teacher', blockchain_teacher_uri)
@ -260,7 +260,7 @@ def test_blockchain_porter_cli_run_simple(click_runner,
assert result.exit_code == 0
output = result.output
assert f"Network: {TEMPORARY_DOMAIN}" in output
assert f"Provider: {TEST_PROVIDER_URI}" in output
assert f"Provider: {TEST_ETH_PROVIDER_URI}" in output
assert PORTER_RUN_MESSAGE.format(http_scheme="http", http_port=non_default_port) in output
@ -278,7 +278,7 @@ def test_blockchain_porter_cli_run_provider_required(click_runner,
result = click_runner.invoke(nucypher_cli, porter_run_command, catch_exceptions=False)
assert result.exit_code != 0
assert "--provider is required" in result.output
assert "--eth-network-provider is required" in result.output
def test_blockchain_porter_cli_run_network_defaults_to_mainnet(click_runner,
@ -288,7 +288,7 @@ def test_blockchain_porter_cli_run_network_defaults_to_mainnet(click_runner,
blockchain_teacher_uri):
porter_run_command = ('porter', 'run',
'--dry-run',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri)
@ -313,7 +313,7 @@ def test_blockchain_porter_cli_run_https(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri,
'--tls-key-filepath', tls_key_path,
@ -342,7 +342,7 @@ def test_blockchain_porter_cli_run_https_with_cors_origin(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri,
'--tls-key-filepath', tls_key_path,
@ -372,7 +372,7 @@ def test_blockchain_porter_cli_run_https_basic_auth(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri,
'--basic-auth-filepath', basic_auth_file)
@ -385,7 +385,7 @@ def test_blockchain_porter_cli_run_https_basic_auth(click_runner,
porter_run_command = ('porter', 'run',
'--dry-run',
'--network', TEMPORARY_DOMAIN,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', agency_local_registry.filepath,
'--teacher', blockchain_teacher_uri,
'--tls-key-filepath', tls_key_path,

View File

@ -20,7 +20,7 @@ from eth_typing import ChecksumAddress
from nucypher.cli.commands.bond import bond, unbond
from nucypher.config.constants import TEMPORARY_DOMAIN
from tests.constants import TEST_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
from tests.constants import TEST_ETH_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
@pytest.fixture(scope='module')
@ -53,9 +53,9 @@ def authorized_staking_provider(testerchain, threshold_staking, staking_provider
def exec_bond(click_runner, operator_address: ChecksumAddress, staking_provider_address: ChecksumAddress):
command = ('--operator-address', operator_address,
'--staking-provider', staking_provider_address,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--signer', TEST_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--force')
result = click_runner.invoke(bond,
command,
@ -66,9 +66,9 @@ def exec_bond(click_runner, operator_address: ChecksumAddress, staking_provider_
def exec_unbond(click_runner, staking_provider_address: ChecksumAddress):
command = ('--staking-provider', staking_provider_address,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--signer', TEST_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--force')
result = click_runner.invoke(unbond,
command,

View File

@ -31,7 +31,7 @@ from nucypher.blockchain.eth.agents import (
from nucypher.blockchain.eth.token import NU
from nucypher.cli.commands.status import status
from nucypher.config.constants import TEMPORARY_DOMAIN
from tests.constants import FEE_RATE_RANGE, TEST_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
from tests.constants import FEE_RATE_RANGE, TEST_ETH_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
@pytest.mark.skip()
@ -39,7 +39,7 @@ def test_nucypher_status_network(click_runner, testerchain, agency_local_registr
network_command = ('network',
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
result = click_runner.invoke(status, network_command, catch_exceptions=False)
@ -54,7 +54,7 @@ def test_nucypher_status_network(click_runner, testerchain, agency_local_registr
contract_regex = f"^{agent.contract_name} \\.+ {agent.contract_address}"
assert re.search(contract_regex, result.output, re.MULTILINE)
assert re.search(f"^Provider URI \\.+ {TEST_PROVIDER_URI}", result.output, re.MULTILINE)
assert re.search(f"^Provider URI \\.+ {TEST_ETH_PROVIDER_URI}", result.output, re.MULTILINE)
assert re.search(f"^Current Period \\.+ {staking_agent.get_current_period()}", result.output, re.MULTILINE)
@ -64,7 +64,7 @@ def test_nucypher_status_stakers(click_runner, agency_local_registry, staking_pr
# Get all stakers info
stakers_command = ('stakers',
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
result = click_runner.invoke(status, stakers_command, catch_exceptions=False)
@ -82,7 +82,7 @@ def test_nucypher_status_stakers(click_runner, agency_local_registry, staking_pr
staking_address = some_dude.checksum_address
stakers_command = ('stakers', '--staking-address', staking_address,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
result = click_runner.invoke(status, stakers_command, catch_exceptions=False)
@ -107,7 +107,7 @@ def test_nucypher_status_fee_range(click_runner, agency_local_registry, staking_
# Get information about global fee range (minimum rate, default rate, maximum rate)
stakers_command = ('fee-range',
'--registry-filepath', str(agency_local_registry.filepath),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
result = click_runner.invoke(status, stakers_command, catch_exceptions=False)
@ -132,7 +132,7 @@ def test_nucypher_status_locked_tokens(click_runner, testerchain, agency_local_r
periods = 2
status_command = ('locked-tokens',
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--periods', periods)
light_parameter = [False, True]
@ -165,7 +165,7 @@ def test_nucypher_status_events(click_runner, testerchain, agency_local_registry
# CLI output
#
status_command = ('events',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--event-name', 'CommitmentMade',
'--contract-name', 'StakingEscrow',
@ -177,7 +177,7 @@ def test_nucypher_status_events(click_runner, testerchain, agency_local_registry
# event filter output
first_staker = staking_providers[0]
filter_status_command = ('events',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--event-name', 'CommitmentMade',
'--contract-name', 'StakingEscrow',
@ -194,7 +194,7 @@ def test_nucypher_status_events(click_runner, testerchain, agency_local_registry
#
csv_file = temp_dir_path / 'status_events_output.csv'
csv_status_command = ('events',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--event-name', 'CommitmentMade',
'--contract-name', 'StakingEscrow',

View File

@ -38,7 +38,7 @@ from nucypher.config.constants import (
from nucypher.crypto.powers import TransactingPower
from tests.constants import (
MOCK_IP_ADDRESS,
TEST_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
TEST_ETH_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
)
from tests.utils.ursula import select_test_port
@ -107,7 +107,7 @@ def test_ursula_and_local_keystore_signer_integration(click_runner,
'--payment-network', TEMPORARY_DOMAIN,
'--operator-address', worker_account.address,
'--config-root', str(config_root_path.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--rest-host', MOCK_IP_ADDRESS,
'--rest-port', deploy_port,

View File

@ -33,7 +33,7 @@ from tests.constants import (
FAKE_PASSWORD_CONFIRMED,
INSECURE_DEVELOPMENT_PASSWORD,
MOCK_IP_ADDRESS,
TEST_PROVIDER_URI,
TEST_ETH_PROVIDER_URI,
YES_ENTER
)
from tests.utils.ursula import select_test_port, start_pytest_ursula_services
@ -176,7 +176,7 @@ def test_persistent_node_storage_integration(click_runner,
another_ursula_configuration_file_location = custom_filepath / filename
init_args = ('ursula', 'init',
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--operator-address', another_ursula,
'--network', TEMPORARY_DOMAIN,
'--payment-network', TEMPORARY_DOMAIN,

View File

@ -46,7 +46,7 @@ from tests.constants import (
FEE_RATE_RANGE,
INSECURE_DEVELOPMENT_PASSWORD,
MOCK_IP_ADDRESS,
TEST_PROVIDER_URI,
TEST_ETH_PROVIDER_URI,
YES_ENTER
)
from tests.utils.middleware import MockRestMiddleware
@ -70,7 +70,7 @@ def test_new_stakeholder(click_runner,
init_args = ('stake', 'init-stakeholder',
'--config-root', str(custom_filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--registry-filepath', str(agency_local_registry.filepath.absolute()))
@ -86,7 +86,7 @@ def test_new_stakeholder(click_runner,
with open(custom_config_filepath, 'r') as config_file:
raw_config_data = config_file.read()
config_data = json.loads(raw_config_data)
assert config_data['provider_uri'] == TEST_PROVIDER_URI
assert config_data['eth_provider_uri'] == TEST_ETH_PROVIDER_URI
@pytest.mark.skip()
@ -378,7 +378,7 @@ def test_ursula_init(click_runner,
'--payment-network', TEMPORARY_DOMAIN,
'--worker-address', manual_worker,
'--config-root', str(custom_filepath.absolute()),
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--registry-filepath', str(agency_local_registry.filepath.absolute()),
'--rest-host', MOCK_IP_ADDRESS,
'--rest-port', deploy_port)
@ -400,7 +400,7 @@ def test_ursula_init(click_runner,
with open(custom_config_filepath, 'r') as config_file:
raw_config_data = config_file.read()
config_data = json.loads(raw_config_data)
assert config_data['provider_uri'] == TEST_PROVIDER_URI
assert config_data['eth_provider_uri'] == TEST_ETH_PROVIDER_URI
assert config_data['worker_address'] == manual_worker
assert TEMPORARY_DOMAIN == config_data['domain']
@ -597,7 +597,7 @@ def test_collect_rewards_integration(click_runner,
assert staker.worker_address == worker_address
# TODO: Test for SubscriptionManager?
payment_method = SubscriptionManagerPayment(provider=TEST_PROVIDER_URI, network=TEMPORARY_DOMAIN)
payment_method = SubscriptionManagerPayment(provider=TEST_ETH_PROVIDER_URI, network=TEMPORARY_DOMAIN)
ursula_port = select_test_port()
ursula = Ursula(is_me=True,
@ -607,7 +607,7 @@ def test_collect_rewards_integration(click_runner,
registry=agency_local_registry,
rest_host=LOOPBACK_ADDRESS,
rest_port=ursula_port,
provider_uri=TEST_PROVIDER_URI,
eth_provider_uri=TEST_ETH_PROVIDER_URI,
network_middleware=MockRestMiddleware(),
db_filepath=tempfile.mkdtemp(),
domain=TEMPORARY_DOMAIN,

View File

@ -23,7 +23,7 @@ import pytest
from nucypher.blockchain.eth.signers.software import Web3Signer
from nucypher.crypto.powers import TransactingPower
from tests.constants import TEST_PROVIDER_URI
from tests.constants import TEST_ETH_PROVIDER_URI
from tests.utils.blockchain import TesterBlockchain
try:
@ -79,7 +79,7 @@ def test_ursula_info_metrics_collector(test_registry,
@pytest.mark.skipif(condition=(not PROMETHEUS_INSTALLED), reason="prometheus_client is required for test")
def test_blockchain_metrics_collector(testerchain):
collector = BlockchainMetricsCollector(provider_uri=TEST_PROVIDER_URI)
collector = BlockchainMetricsCollector(eth_provider_uri=TEST_ETH_PROVIDER_URI)
collector_registry = CollectorRegistry()
prefix = 'test_blockchain_metrics_collector'

View File

@ -98,9 +98,9 @@ GETH_DEV_URI = f'ipc://{BASE_TEMP_DIR}/geth.ipc' # Standard IPC path for `geth
PYEVM_DEV_URI = "tester://pyevm"
TEST_PROVIDER_URI = PYEVM_DEV_URI # TODO: Pytest flag entry point?
TEST_ETH_PROVIDER_URI = PYEVM_DEV_URI # TODO: Pytest flag entry point?
MOCK_PROVIDER_URI = 'tester://mock'
MOCK_ETH_PROVIDER_URI = 'tester://mock'
#
# Node Configuration

View File

@ -20,7 +20,7 @@ import pytest
from web3.contract import Contract
from tests.constants import (
TEST_PROVIDER_URI,
TEST_ETH_PROVIDER_URI,
)
from tests.utils.ursula import MOCK_URSULA_STARTING_PORT
from tests.utils.config import make_ursula_test_configuration

View File

@ -183,10 +183,10 @@ def test_upgradeability(temp_dir_path):
SourceBundle(base_path=Path(temp_dir_path))
]
provider_uri = 'tester://pyevm/2' # TODO: Testerchain caching Issues
eth_provider_uri = 'tester://pyevm/2' # TODO: Testerchain caching Issues
try:
blockchain_interface = TesterBlockchain(gas_strategy='free')
blockchain_interface.provider_uri = provider_uri
blockchain_interface.eth_provider_uri = eth_provider_uri
blockchain_interface.connect()
origin = blockchain_interface.client.accounts[0]
BlockchainInterfaceFactory.register_interface(interface=blockchain_interface)
@ -233,4 +233,4 @@ def test_upgradeability(temp_dir_path):
finally:
# Unregister interface # TODO: Move to method?
with contextlib.suppress(KeyError):
del BlockchainInterfaceFactory._interfaces[provider_uri]
del BlockchainInterfaceFactory._interfaces[eth_provider_uri]

View File

@ -76,7 +76,7 @@ from tests.constants import (
MOCK_REGISTRY_FILEPATH,
NUMBER_OF_URSULAS_IN_DEVELOPMENT_NETWORK,
TEST_GAS_LIMIT,
TEST_PROVIDER_URI
TEST_ETH_PROVIDER_URI
)
from tests.mock.interfaces import MockBlockchain, mock_registry_source_manager
from tests.mock.performance_mocks import (
@ -174,8 +174,8 @@ def bob_federated_test_config():
@pytest.fixture(scope="module")
def ursula_decentralized_test_config(test_registry, temp_dir_path):
config = make_ursula_test_configuration(federated=False,
provider_uri=TEST_PROVIDER_URI,
payment_provider=TEST_PROVIDER_URI,
eth_provider_uri=TEST_ETH_PROVIDER_URI,
payment_provider=TEST_ETH_PROVIDER_URI,
test_registry=test_registry,
rest_port=MOCK_URSULA_STARTING_PORT)
yield config
@ -187,8 +187,8 @@ def ursula_decentralized_test_config(test_registry, temp_dir_path):
@pytest.fixture(scope="module")
def alice_blockchain_test_config(blockchain_ursulas, testerchain, test_registry):
config = make_alice_test_configuration(federated=False,
provider_uri=TEST_PROVIDER_URI,
payment_provider=TEST_PROVIDER_URI,
eth_provider_uri=TEST_ETH_PROVIDER_URI,
payment_provider=TEST_ETH_PROVIDER_URI,
known_nodes=blockchain_ursulas,
checksum_address=testerchain.alice_account,
test_registry=test_registry)
@ -199,7 +199,7 @@ def alice_blockchain_test_config(blockchain_ursulas, testerchain, test_registry)
@pytest.fixture(scope="module")
def bob_blockchain_test_config(testerchain, test_registry):
config = make_bob_test_configuration(federated=False,
provider_uri=TEST_PROVIDER_URI,
eth_provider_uri=TEST_ETH_PROVIDER_URI,
test_registry=test_registry,
checksum_address=testerchain.bob_account)
yield config
@ -467,7 +467,7 @@ def blockchain_porter(blockchain_ursulas, testerchain, test_registry):
abort_on_learning_error=True,
start_learning_now=True,
known_nodes=blockchain_ursulas,
provider_uri=TEST_PROVIDER_URI,
eth_provider_uri=TEST_ETH_PROVIDER_URI,
registry=test_registry,
network_middleware=MockRestMiddleware())
yield porter
@ -802,7 +802,7 @@ def software_stakeholder(testerchain, agency, stakeholder_config_file_location,
@pytest.fixture(scope="module")
def stakeholder_configuration(testerchain, agency_local_registry):
config = StakeHolderConfiguration(provider_uri=testerchain.provider_uri,
config = StakeHolderConfiguration(eth_provider_uri=testerchain.eth_provider_uri,
registry_filepath=agency_local_registry.filepath)
return config

View File

@ -34,7 +34,7 @@ from nucypher.cli.literature import (
)
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.types import SubStakeInfo
from tests.constants import MOCK_PROVIDER_URI, MOCK_SIGNER_URI, NUMBER_OF_ETH_TEST_ACCOUNTS
from tests.constants import MOCK_ETH_PROVIDER_URI, MOCK_SIGNER_URI, NUMBER_OF_ETH_TEST_ACCOUNTS
@pytest.mark.parametrize('selection', range(NUMBER_OF_ETH_TEST_ACCOUNTS))
@ -44,7 +44,7 @@ def test_select_client_account(mock_stdin, test_emitter, mock_testerchain, selec
expected_account = mock_testerchain.client.accounts[selection]
selected_account = select_client_account(emitter=test_emitter,
signer=Web3Signer(mock_testerchain.client),
provider_uri=MOCK_PROVIDER_URI)
eth_provider_uri=MOCK_ETH_PROVIDER_URI)
assert selected_account, "Account selection returned Falsy instead of an address"
assert isinstance(selected_account, str), "Selection is not a str"
assert is_checksum_address(selected_account), "Selection is not a valid checksum address"
@ -63,7 +63,7 @@ def test_select_client_account_with_no_accounts(mocker,
with pytest.raises(click.Abort):
select_client_account(emitter=test_emitter,
signer=Web3Signer(mock_testerchain.client),
provider_uri=MOCK_PROVIDER_URI)
eth_provider_uri=MOCK_ETH_PROVIDER_URI)
captured = capsys.readouterr()
assert NO_ETH_ACCOUNTS in captured.out
@ -119,7 +119,7 @@ def test_select_client_account_valid_sources(mocker,
# From pre-initialized Provider
mock_stdin.line(str(selection))
expected_account = mock_testerchain.client.accounts[selection]
selected_account = select_client_account(emitter=test_emitter, provider_uri=MOCK_PROVIDER_URI)
selected_account = select_client_account(emitter=test_emitter, eth_provider_uri=MOCK_ETH_PROVIDER_URI)
assert selected_account == expected_account
assert mock_stdin.empty()
captured = capsys.readouterr()
@ -130,7 +130,7 @@ def test_select_client_account_valid_sources(mocker,
mocker.patch.object(BlockchainInterfaceFactory, 'is_interface_initialized', return_value=False)
mocker.patch.object(BlockchainInterfaceFactory, '_interfaces', return_value={})
mocker.patch.object(BlockchainInterfaceFactory, 'get_interface', return_value=mock_testerchain)
selected_account = select_client_account(emitter=test_emitter, provider_uri=MOCK_PROVIDER_URI)
selected_account = select_client_account(emitter=test_emitter, eth_provider_uri=MOCK_ETH_PROVIDER_URI)
assert selected_account == expected_account
assert mock_stdin.empty()
captured = capsys.readouterr()
@ -173,7 +173,7 @@ def test_select_client_account_with_balance_display(mock_stdin,
show_eth_balance=show_eth,
show_nu_balance=show_tokens,
show_staking=show_staking,
provider_uri=MOCK_PROVIDER_URI)
eth_provider_uri=MOCK_ETH_PROVIDER_URI)
# Good selection
mock_stdin.line(str(selection))
@ -182,7 +182,7 @@ def test_select_client_account_with_balance_display(mock_stdin,
show_eth_balance=show_eth,
show_nu_balance=show_tokens,
show_staking=show_staking,
provider_uri=MOCK_PROVIDER_URI)
eth_provider_uri=MOCK_ETH_PROVIDER_URI)
# check for accurate selection consistency with client index
assert selected_account == mock_testerchain.client.accounts[selection]

View File

@ -28,7 +28,7 @@ from nucypher.config.constants import (
)
from nucypher.crypto.powers import TransactingPower
from nucypher.types import StakingProviderInfo
from tests.constants import TEST_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
from tests.constants import TEST_ETH_PROVIDER_URI, INSECURE_DEVELOPMENT_PASSWORD
cli_env = {NUCYPHER_ENVVAR_STAKING_PROVIDER_ETH_PASSWORD: INSECURE_DEVELOPMENT_PASSWORD}
@ -58,9 +58,9 @@ def test_nucypher_bond_help(click_runner, mock_testerchain):
def exec_bond(click_runner, operator_address: ChecksumAddress, staking_provider_address: ChecksumAddress):
command = ('--operator-address', operator_address,
'--staking-provider', staking_provider_address,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--signer', TEST_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--force' # non-interactive only
)
result = click_runner.invoke(bond, command, catch_exceptions=False, env=cli_env)
@ -69,9 +69,9 @@ def exec_bond(click_runner, operator_address: ChecksumAddress, staking_provider_
def exec_unbond(click_runner, staking_provider_address: ChecksumAddress):
command = ('--staking-provider', staking_provider_address,
'--provider', TEST_PROVIDER_URI,
'--eth-provider', TEST_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--signer', TEST_PROVIDER_URI,
'--signer', TEST_ETH_PROVIDER_URI,
'--force' # non-interactive only
)
result = click_runner.invoke(unbond, command, catch_exceptions=False, env=cli_env)

View File

@ -81,7 +81,7 @@ from nucypher.cli.painting.staking import REWARDS_TABLE_COLUMNS, TOKEN_DECIMAL_P
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.crypto.powers import TransactingPower
from nucypher.types import StakerInfo, SubStakeInfo
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_PROVIDER_URI, YES
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_ETH_PROVIDER_URI, YES
@pytest.fixture()
@ -174,7 +174,7 @@ def surrogate_stakes(mock_staking_agent, application_economics, surrogate_staker
@pytest.mark.usefixtures("test_registry_source_manager", "patch_stakeholder_configuration")
def test_stakeholder_configuration(test_emitter, test_registry, mock_testerchain, mock_staking_agent):
stakeholder_config_options = StakeHolderConfigOptions(provider_uri=MOCK_PROVIDER_URI,
stakeholder_config_options = StakeHolderConfigOptions(eth_provider_uri=MOCK_ETH_PROVIDER_URI,
poa=None,
light=None,
registry_filepath=None,
@ -226,7 +226,7 @@ def test_no_token_reward(click_runner, surrogate_stakers, mock_staking_agent):
'withdraw',
'--no-fees',
'--tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -255,7 +255,7 @@ def test_collecting_token_reward(click_runner, surrogate_stakers, mock_staking_a
'withdraw',
'--no-fees',
'--tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -288,7 +288,7 @@ def test_collecting_whole_reward_with_warning(click_runner, surrogate_stakers, m
'withdraw',
'--no-fees',
'--tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -324,7 +324,7 @@ def test_collecting_whole_reward_without_warning(click_runner, surrogate_stakers
'withdraw',
'--no-fees',
'--tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -353,7 +353,7 @@ def test_no_policy_fee(click_runner, surrogate_stakers, mock_policy_manager_agen
'withdraw',
'--fees',
'--no-tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -377,7 +377,7 @@ def test_collecting_fee(click_runner, surrogate_stakers, mock_policy_manager_age
'withdraw',
'--fees',
'--no-tokens',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -399,7 +399,7 @@ def test_nothing_to_mint(click_runner, surrogate_stakers, mock_staking_agent, mo
mock_staking_agent.get_next_committed_period.return_value = 0
mint_command = ('mint',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -426,7 +426,7 @@ def test_mint_with_warning(click_runner, surrogate_stakers, mock_staking_agent,
mock_staking_agent.non_withdrawable_stake.return_value = NU(1, 'NU').to_units()
mint_command = ('mint',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -454,7 +454,7 @@ def test_mint_without_warning(click_runner, surrogate_stakers, mock_staking_agen
mock_staking_agent.non_withdrawable_stake.return_value = 0
mint_command = ('mint',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -490,7 +490,7 @@ def test_prolong_interactive(click_runner,
final_period = surrogate_stakes[selected_index][sub_stake_index][1]
command = ('prolong',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
user_input = '\n'.join((str(selected_index),
@ -534,7 +534,7 @@ def test_prolong_non_interactive(click_runner,
final_period = surrogate_stakes[selected_index][sub_stake_index][1]
command = ('prolong',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0],
'--index', sub_stake_index,
@ -581,7 +581,7 @@ def test_divide_interactive(click_runner,
mock_staking_agent.get_worker_from_staker.return_value = NULL_ADDRESS
command = ('divide',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
user_input = '\n'.join((str(selected_index),
@ -630,7 +630,7 @@ def test_divide_non_interactive(click_runner,
mock_staking_agent.get_worker_from_staker.return_value = surrogate_stakers[0]
command = ('divide',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0],
'--index', sub_stake_index,
@ -679,7 +679,7 @@ def test_increase_interactive(click_runner,
mock_token_agent.get_balance.return_value = 0
command = ('increase',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
user_input = '\n'.join((str(selected_index),
@ -759,7 +759,7 @@ def test_increase_non_interactive(click_runner,
mock_token_agent.get_allowance.return_value = current_allowance
command = ('increase',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0],
'--index', sub_stake_index,
@ -813,7 +813,7 @@ def test_increase_lock_interactive(click_runner,
mock_staking_agent.calculate_staking_reward.return_value = 0
command = ('increase',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--from-unlocked')
@ -886,7 +886,7 @@ def test_increase_lock_non_interactive(click_runner,
mock_staking_agent.calculate_staking_reward.return_value = unlocked_tokens
command = ('increase',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[selected_index],
'--index', sub_stake_index,
@ -934,7 +934,7 @@ def test_create_interactive(click_runner,
value = NU.from_units(application_economics.min_authorization * 11 + 12345)
command = ('create',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
user_input = '\n'.join((str(selected_index),
@ -1046,7 +1046,7 @@ def test_create_non_interactive(click_runner,
mock_token_agent.get_balance.return_value = application_economics.maximum_allowed_locked
command = ('create',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[selected_index],
'--lock-periods', lock_periods,
@ -1105,7 +1105,7 @@ def test_create_lock_interactive(click_runner,
mock_staking_agent.calculate_staking_reward.return_value = application_economics.min_authorization - 1
command = ('create',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--from-unlocked')
@ -1187,7 +1187,7 @@ def test_create_lock_non_interactive(click_runner,
mock_staking_agent.calculate_staking_reward.return_value = unlocked_tokens
command = ('create',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[selected_index],
'--lock-periods', lock_periods,
@ -1242,7 +1242,7 @@ def test_merge_interactive(click_runner,
sub_stake_index_2 = 2
command = ('merge',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN)
user_input = '\n'.join((str(selected_index),
@ -1287,7 +1287,7 @@ def test_merge_partially_interactive(click_runner,
sub_stake_index_2 = 2
base_command = ('merge',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[selected_index])
user_input = '\n'.join((str(sub_stake_index_2),
@ -1344,7 +1344,7 @@ def test_merge_non_interactive(click_runner,
mock_staking_agent.calculate_staking_reward.return_value = unlocked_tokens
command = ('merge',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[selected_index],
'--index-1', sub_stake_index_1,
@ -1379,7 +1379,7 @@ def test_stake_list_active(click_runner,
get_random_checksum_address):
command = ('list',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,)
user_input = None
@ -1446,7 +1446,7 @@ def test_stake_list_all(click_runner,
command = ('list',
'--all',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,)
user_input = None
@ -1509,7 +1509,7 @@ def test_show_rewards(click_runner, surrogate_stakers, mock_staking_agent):
command = ('rewards',
'show',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0])
@ -1557,7 +1557,7 @@ def test_show_rewards_for_period(click_runner, surrogate_stakers, mock_staking_a
command = ('rewards',
'show',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0],
'--periods', periods)
@ -1590,7 +1590,7 @@ def test_show_rewards_not_found(click_runner, surrogate_stakers, mock_staking_ag
command = ('rewards',
'show',
'--provider', MOCK_PROVIDER_URI,
'--eth-provider', MOCK_ETH_PROVIDER_URI,
'--network', TEMPORARY_DOMAIN,
'--staking-address', surrogate_stakers[0],
'--periods', 10)

View File

@ -66,11 +66,11 @@ def test_ursula_init_with_local_keystore_signer(click_runner,
# Layer 1
'--network', TEMPORARY_DOMAIN,
'--provider', mock_testerchain.provider_uri,
'--eth-provider', mock_testerchain.eth_provider_uri,
# Layer 2
'--payment-network', TEMPORARY_DOMAIN,
'--payment-provider', mock_testerchain.provider_uri,
'--payment-provider', mock_testerchain.eth_provider_uri,
'--rest-host', MOCK_IP_ADDRESS,
'--rest-port', deploy_port,

View File

@ -36,7 +36,7 @@ from nucypher.config.characters import (
from nucypher.config.constants import TEMPORARY_DOMAIN
from nucypher.config.storages import ForgetfulNodeStorage
from nucypher.crypto.keystore import Keystore
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_PROVIDER_URI
from tests.constants import INSECURE_DEVELOPMENT_PASSWORD, MOCK_ETH_PROVIDER_URI
from tests.constants import MOCK_IP_ADDRESS
# Main Cast
@ -64,7 +64,7 @@ def test_federated_development_character_configurations(character, configuration
assert config.is_me is True
assert config.dev_mode is True
assert config.keystore == NO_KEYSTORE_ATTACHED
assert config.provider_uri is None
assert config.eth_provider_uri is None
# Production
thing_one = config()
@ -120,7 +120,7 @@ def test_default_character_configuration_preservation(configuration_class, teste
if configuration_class == StakeHolderConfiguration:
# special case for defaults
character_config = StakeHolderConfiguration(provider_uri=testerchain.provider_uri, domain=network)
character_config = StakeHolderConfiguration(eth_provider_uri=testerchain.eth_provider_uri, domain=network)
elif configuration_class == UrsulaConfiguration:
# special case for rest_host & dev mode
@ -130,7 +130,7 @@ def test_default_character_configuration_preservation(configuration_class, teste
character_config = configuration_class(checksum_address=fake_address,
domain=network,
rest_host=MOCK_IP_ADDRESS,
payment_provider=MOCK_PROVIDER_URI,
payment_provider=MOCK_ETH_PROVIDER_URI,
keystore=keystore)
else:

View File

@ -33,7 +33,7 @@ from nucypher.config.characters import StakeHolderConfiguration, UrsulaConfigura
from tests.constants import (
KEYFILE_NAME_TEMPLATE,
MOCK_KEYSTORE_PATH,
MOCK_PROVIDER_URI,
MOCK_ETH_PROVIDER_URI,
NUMBER_OF_MOCK_KEYSTORE_ACCOUNTS
)
from tests.mock.agents import MockContractAgency, MockContractAgent
@ -225,7 +225,7 @@ def mock_keystore(mocker):
@pytest.fixture(scope="module")
def alice_blockchain_test_config(mock_testerchain, test_registry):
config = make_alice_test_configuration(federated=False,
provider_uri=MOCK_PROVIDER_URI,
eth_provider_uri=MOCK_ETH_PROVIDER_URI,
test_registry=test_registry,
checksum_address=mock_testerchain.alice_account)
yield config
@ -235,7 +235,7 @@ def alice_blockchain_test_config(mock_testerchain, test_registry):
@pytest.fixture(scope="module")
def bob_blockchain_test_config(mock_testerchain, test_registry):
config = make_bob_test_configuration(federated=False,
provider_uri=MOCK_PROVIDER_URI,
eth_provider_uri=MOCK_ETH_PROVIDER_URI,
test_registry=test_registry,
checksum_address=mock_testerchain.bob_account)
yield config
@ -245,8 +245,8 @@ def bob_blockchain_test_config(mock_testerchain, test_registry):
@pytest.fixture(scope="module")
def ursula_decentralized_test_config(mock_testerchain, test_registry):
config = make_ursula_test_configuration(federated=False,
provider_uri=MOCK_PROVIDER_URI, # L1
payment_provider=MOCK_PROVIDER_URI, # L1/L2
eth_provider_uri=MOCK_ETH_PROVIDER_URI, # L1
payment_provider=MOCK_ETH_PROVIDER_URI, # L1/L2
test_registry=test_registry,
rest_port=MOCK_URSULA_STARTING_PORT,
checksum_address=mock_testerchain.ursula_account(index=0))

View File

@ -26,12 +26,12 @@ from nucypher.blockchain.eth import agents
from nucypher.blockchain.eth.agents import Agent, ContractAgency, EthereumContractAgent
from nucypher.blockchain.eth.constants import NULL_ADDRESS
from nucypher.blockchain.eth.interfaces import BlockchainInterfaceFactory
from tests.constants import MOCK_PROVIDER_URI
from tests.constants import MOCK_ETH_PROVIDER_URI
from tests.mock.interfaces import MockBlockchain
MOCK_TESTERCHAIN = MockBlockchain()
CACHED_MOCK_TESTERCHAIN = BlockchainInterfaceFactory.CachedInterface(interface=MOCK_TESTERCHAIN, emitter=None)
BlockchainInterfaceFactory._interfaces[MOCK_PROVIDER_URI] = CACHED_MOCK_TESTERCHAIN
BlockchainInterfaceFactory._interfaces[MOCK_ETH_PROVIDER_URI] = CACHED_MOCK_TESTERCHAIN
CURRENT_BLOCK = MOCK_TESTERCHAIN.w3.eth.getBlock('latest')

View File

@ -29,7 +29,7 @@ from nucypher.blockchain.eth.registry import (
RegistrySourceManager
)
from nucypher.config.constants import TEMPORARY_DOMAIN
from tests.constants import MOCK_PROVIDER_URI
from tests.constants import MOCK_ETH_PROVIDER_URI
from tests.utils.blockchain import TesterBlockchain
@ -67,7 +67,7 @@ def mock_registry_source_manager(test_registry):
class MockBlockchain(TesterBlockchain):
PROVIDER_URI = MOCK_PROVIDER_URI
ETH_PROVIDER_URI = MOCK_ETH_PROVIDER_URI
def __init__(self):
super().__init__(compile_now=False)

View File

@ -154,43 +154,43 @@ class ProviderTypeTestClient(BlockchainInterfaceTestBase):
self.expected_provider_class = expected_provider_class
self.test_provider_to_attach = actual_provider_to_attach
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(*args, **kwargs)
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(*args, **kwargs)
# check type
assert isinstance(self.provider, self.expected_provider_class)
super()._attach_provider(provider=self.test_provider_to_attach)
super()._attach_eth_provider(eth_provider=self.test_provider_to_attach)
class InfuraTestClient(BlockchainInterfaceTestBase):
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(provider=MockInfuraProvider())
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(eth_provider=MockInfuraProvider())
class AlchemyTestClient(BlockchainInterfaceTestBase):
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(provider=MockAlchemyProvider())
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(eth_provider=MockAlchemyProvider())
class GethClientTestBlockchain(BlockchainInterfaceTestBase):
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(provider=MockGethProvider())
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(eth_provider=MockGethProvider())
class ParityClientTestInterface(BlockchainInterfaceTestBase):
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(provider=MockParityProvider())
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(eth_provider=MockParityProvider())
class GanacheClientTestInterface(BlockchainInterfaceTestBase):
def _attach_provider(self, *args, **kwargs) -> None:
super()._attach_provider(provider=MockGanacheProvider())
def _attach_eth_provider(self, *args, **kwargs) -> None:
super()._attach_eth_provider(eth_provider=MockGanacheProvider())
def test_client_no_provider():
@ -200,7 +200,7 @@ def test_client_no_provider():
def test_geth_web3_client():
interface = GethClientTestBlockchain(provider_uri='file:///ipc.geth')
interface = GethClientTestBlockchain(eth_provider_uri='file:///ipc.geth')
interface.connect()
assert isinstance(interface.client, GethClient)
@ -215,7 +215,7 @@ def test_geth_web3_client():
def test_autodetect_provider_type_file(tempfile_path):
interface = ProviderTypeTestClient(provider_uri=str(tempfile_path), # existing file for test
interface = ProviderTypeTestClient(eth_provider_uri=str(tempfile_path), # existing file for test
expected_provider_class=IPCProvider,
actual_provider_to_attach=MockGethProvider())
interface.connect()
@ -224,12 +224,12 @@ def test_autodetect_provider_type_file(tempfile_path):
def test_autodetect_provider_type_file_none_existent():
with pytest.raises(BlockchainInterface.UnsupportedProvider) as e:
interface = BlockchainInterfaceTestBase(provider_uri='/none_existent.ipc.geth')
interface = BlockchainInterfaceTestBase(eth_provider_uri='/none_existent.ipc.geth')
interface.connect()
def test_detect_provider_type_file():
interface = ProviderTypeTestClient(provider_uri='file:///ipc.geth',
interface = ProviderTypeTestClient(eth_provider_uri='file:///ipc.geth',
expected_provider_class=IPCProvider,
actual_provider_to_attach=MockGethProvider())
interface.connect()
@ -237,7 +237,7 @@ def test_detect_provider_type_file():
def test_detect_provider_type_ipc():
interface = ProviderTypeTestClient(provider_uri='ipc:///ipc.geth',
interface = ProviderTypeTestClient(eth_provider_uri='ipc:///ipc.geth',
expected_provider_class=IPCProvider,
actual_provider_to_attach=MockGethProvider())
interface.connect()
@ -245,7 +245,7 @@ def test_detect_provider_type_ipc():
def test_detect_provider_type_http():
interface = ProviderTypeTestClient(provider_uri='http://ganache:8445',
interface = ProviderTypeTestClient(eth_provider_uri='http://ganache:8445',
expected_provider_class=HTTPProvider,
actual_provider_to_attach=MockGanacheProvider())
interface.connect()
@ -253,7 +253,7 @@ def test_detect_provider_type_http():
def test_detect_provider_type_https():
interface = ProviderTypeTestClient(provider_uri='https://ganache:8445',
interface = ProviderTypeTestClient(eth_provider_uri='https://ganache:8445',
expected_provider_class=HTTPProvider,
actual_provider_to_attach=MockGanacheProvider())
interface.connect()
@ -261,7 +261,7 @@ def test_detect_provider_type_https():
def test_detect_provider_type_ws():
interface = ProviderTypeTestClient(provider_uri=f'ws://{LOOPBACK_ADDRESS}:8546',
interface = ProviderTypeTestClient(eth_provider_uri=f'ws://{LOOPBACK_ADDRESS}:8546',
expected_provider_class=WebsocketProvider,
actual_provider_to_attach=MockWebSocketProvider())
interface.connect()
@ -269,7 +269,7 @@ def test_detect_provider_type_ws():
def test_infura_web3_client():
interface = InfuraTestClient(provider_uri='wss://:@goerli.infura.io/ws/v3/1234567890987654321abcdef')
interface = InfuraTestClient(eth_provider_uri='wss://:@goerli.infura.io/ws/v3/1234567890987654321abcdef')
interface.connect()
assert isinstance(interface.client, InfuraClient)
@ -285,7 +285,7 @@ def test_infura_web3_client():
def test_alchemy_web3_client():
interface = AlchemyTestClient(provider_uri='https://eth-rinkeby.alchemyapi.io/v2/1234567890987654321abcdef')
interface = AlchemyTestClient(eth_provider_uri='https://eth-rinkeby.alchemyapi.io/v2/1234567890987654321abcdef')
interface.connect()
assert isinstance(interface.client, AlchemyClient)
@ -297,7 +297,7 @@ def test_alchemy_web3_client():
def test_parity_web3_client():
interface = ParityClientTestInterface(provider_uri='file:///ipc.parity')
interface = ParityClientTestInterface(eth_provider_uri='file:///ipc.parity')
interface.connect()
assert isinstance(interface.client, ParityClient)
@ -308,7 +308,7 @@ def test_parity_web3_client():
def test_ganache_web3_client():
interface = GanacheClientTestInterface(provider_uri='http://ganache:8445')
interface = GanacheClientTestInterface(eth_provider_uri='http://ganache:8445')
interface.connect()
assert isinstance(interface.client, GanacheClient)

View File

@ -89,7 +89,7 @@ class TesterBlockchain(BlockchainDeployerInterface):
# Web3
GAS_STRATEGIES = {**BlockchainDeployerInterface.GAS_STRATEGIES, 'free': free_gas_price_strategy}
PROVIDER_URI = PYEVM_DEV_URI
ETH_PROVIDER_URI = PYEVM_DEV_URI
DEFAULT_GAS_STRATEGY = 'free'
# Reserved addresses
@ -120,7 +120,7 @@ class TesterBlockchain(BlockchainDeployerInterface):
EXPECTED_CONFIRMATION_TIME_IN_SECONDS['free'] = 5 # Just some upper-limit
super().__init__(provider_uri=self.PROVIDER_URI,
super().__init__(eth_provider_uri=self.ETH_PROVIDER_URI,
poa=poa,
light=light,
*args, **kwargs)
@ -224,7 +224,7 @@ class TesterBlockchain(BlockchainDeployerInterface):
if registry is None:
registry = InMemoryContractRegistry()
testerchain = cls()
if not BlockchainInterfaceFactory.is_interface_initialized(provider_uri=testerchain.provider_uri):
if not BlockchainInterfaceFactory.is_interface_initialized(eth_provider_uri=testerchain.eth_provider_uri):
BlockchainInterfaceFactory.register_interface(interface=testerchain)
# Produce actor

View File

@ -35,14 +35,14 @@ TEST_CHARACTER_CONFIG_BASE_PARAMS = dict(
def assemble(federated: bool,
checksum_address: str = None,
provider_uri: str = None,
eth_provider_uri: str = None,
test_registry: BaseContractRegistry = None,
known_nodes: List[Ursula] = None) -> dict:
"""Assemble a dictionary of keyword arguments to use when constructing a test configuration."""
# Validate input
blockchain_params = all((provider_uri, test_registry))
blockchain_params = all((eth_provider_uri, test_registry))
if not federated and not blockchain_params:
dev_help = "Cannot make test configuration: Provider URI and test registry must be passed in decentralized mode."
raise ValueError(dev_help)
@ -52,7 +52,7 @@ def assemble(federated: bool,
# Generate runtime config params
runtime_params = dict(federated_only=federated,
provider_uri=provider_uri if not federated else None,
eth_provider_uri=eth_provider_uri if not federated else None,
registry=test_registry if not federated else None,
network_middleware=MockRestMiddleware(),
known_nodes=known_nodes,