Ethereum: How can I run an Electrum console command from outside Electrum (in Linux)?

Launch Electronic Consoli Consoli-the Electronics is on Linux

Electrum – Popular Library Python Ports with a blockchain Ethereum. In the e com-and electronics, set by the electrome, you’ll be your from python to extend the balance off them Koshah and the second information.

PROPOSE:

  • You Need to instal the Elector in your System.

  • You Need to Enter the Configuration File (for Example, config.json), to reset them. This fillet shuold be includeed in the following:

Password ': Your Email Password

-Sort_url: URL Your Comanda Console Console (For Example, https: // Localhost: 8545)

-rpc_version: RPC version, which you want to use (overpare 4)

  • You Need to set up the Electrum Console Command to run your system.

  • We Need to instal the "Sub -seop" Module in Python, Which Allows You to Enter News Processes and intend with their output.

Blood Instruction:

Shag 1: Summit config

Submit your nameconfig.jsonin Tom Catalog, and your wall conntrum console (for example, GetBalance.py). This fillet is souped to them:

JSON

{

"Password": "Your_electrum_password"

"Server_url": "Https: // Localhost: 8545",

"RPC_VERSION": 4

}

Change " Your_electrum_password "on your email.

Ethereum: How can I run an Electrum console command from outside Electrum (in Linux)?

Stag 2: Install modules Subprocess

You Need to instal a “Sub -project” module in Python. Start the follow -up Commond:

`Bash

PIP Install the Undertaker

`

Shag 3: Setting up the Command Electr

To set up the Commond Electrum Console, you’re unto the way to have distortion of processes of Python, which launches, and the catemu will come out. Here’s thy prints:

Primer 1: Using the Separation Process

Submit your new fille with the name GetBalance.Sh's in Tom Catalog, what python:

Bash

#!/Bin/Bash

Settings Electrome

Password = “Your_electrum_password”

Server_url = “https: // Localhost: 8545”

Run the electronic waters and get the balance

GetBalance = $ (./ Run Electrum.sh “$ Password” “$ Server_url”)

Echo “Balance Koshka: $ GetBalance”

`

Submit your news with the name Run-electrum.sh in Tom Catalo:

`Bash

#!/Bin/Bash

Settings Electrome Settings

Password = “Your_electrum_password”

Start the electronic point and get the balance

GetBalance = $ (./ GetBalance.sh “$ Password”)

Echo “Balance Koshka: $ GetBalance”

`

Start Run Electrum.sh to Start the Process off the electronics, and the python:

Bash

Python getbalance.py

`

Primer 2: Using a single Process

Submit the new fillet with the name GetBalance.py with the following:

`Python

Import Subprostess

Password = "Your_electrum_password"

Server_url = "https: // Localhost: 8545"

Run the electronic waters and get the balance

Subprocess.run (["./ Run Electrum.sh," "$ Password", "$ Server_url"], Check = TRUE, Stdout = Subprocess.Pipe)

GetBalance = Subprocess.check_outPut ("GetBalance" .Plit (), stind = subprocess.pipe) .Decode ()

Pack ("Balance Koska:", GetBalance)

Start with the Processes off them to the balance of your Koshka:

`Bash

Python getbalance.py

`

Call Function GetBalance ()

To Release the Function O GetBalance () Are Electrome, you can be the python:

`Python

Import Subprostess

Password = "Your_electrum_password"

Server_url = "https: // Localhost: 8545"

Constitused Balance, using and the getbalance function

subprocess.run (["./ GetBalance.sh", "$ Password", "Morning Server_url"], Check = TRUE, Stdout = Subprocess.Pipe)

Balance = subprocess.check_outPut ("GetBalance" .plit (), stinine = subprocess.pipe) .Decode ()

Pack (Balance)

Change " Your_electrum_password "on your email.

COVES AND VANIATION

  • You may have Config.json, the use the plumage has been done.

ETHEREUM PRIVATE ADDRESS

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *