Nirmata RPC Daemon and RPC Wallet Python Library
Python library to interact with RPC Daemon and RPC Wallet.
All requests are queued. Most functions are async.
The library supports HTTP, HTTPS, and digest authentication.
Digest authentication is activated as soon as a username and a password are supplied during object creation.
Once initialized, simply use the query functions.
pip install nirmata-rpc
from nirmata_rpc_module.rpc_daemon import RPCDaemon
daemon_client = RPCDaemon({
'url': 'http://127.0.0.1:11232'
})
# When using a self-signed certificate with HTTPS, you need to set the function ssl_reject_unauthorized to False.
daemon_client.ssl_reject_unauthorized(False)
from nirmata_rpc_module.rpc_daemon import RPCDaemon
daemon_client = RPCDaemon({
'url': 'http://127.0.0.1:11232',
'username': 'user',
'password': 'pass'
})
# When using a self-signed certificate with HTTPS, you need to set the function ssl_reject_unauthorized to False.
daemon_client.ssl_reject_unauthorized(False)
from nirmata_rpc_module.rpc_wallet import RPCWallet
wallet_client = RPCWallet({
'url': 'http://127.0.0.1:11222'
})
# When using a self-signed certificate with HTTPS, you need to set the function ssl_reject_unauthorized to False.
wallet_client.ssl_reject_unauthorized(False)
from nirmata_rpc_module.rpc_wallet import RPCWallet
wallet_client = RPCWallet({
'url': 'http://127.0.0.1:11222',
'username': 'user',
'password': 'pass'
})
# When using a self-signed certificate with HTTPS, you need to set the function ssl_reject_unauthorized to False.
wallet_client.ssl_reject_unauthorized(False)
make docs
pytest
NOTE: tests can take several minutes to complete while block confirmations occur
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
When instructed, provide the following password for the secured seed
pytest tests/test_wallet_market_place.py
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
Run the market-place tests
pytest tests/test_wallet_market_place.py
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
Run the wallet tests
pytest tests/test_wallet_account.py
NOTE: tests require two wallets and can take several minutes to complete while block confirmations occur
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
coffee rest stand said leg muse defense wild about mighty horse melt really hum sharp seek honest brush depress beyond hundred silly confusion inhale birthday frozen
-
When instructed, provide the following password for the secured seed
123456
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
obviously essence rise wow appear glove veil gain beneath ask suddenly manage thunder near sympathy respect pants led lucky pie rant water deeply mean shift somebody
-
When instructed, provide the following password for the secured seed
123456
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S otherwallet ./simplewallet --wallet-file nwiz.other --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 12234 --daemon-address 0.0.0.0:22022
-
Run the atomic tests ```pytest tests/test_wallet_atomics.py``
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
coffee rest stand said leg muse defense wild about mighty horse melt really hum sharp seek honest brush depress beyond hundred silly confusion inhale birthday frozen
-
When instructed, provide the following password for the secured seed
123456
-
Use Simplewallet console to execute the following to save a watch-only wallet
save_watch_only nwiz.watch 123456
-
Use Console to execute the following command to open a watch-only wallet as a service with screen
screen -S watchwallet ./simplewallet --wallet-file nwiz.watch --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 12235 --daemon-address 0.0.0.0:22022
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
Run the cold-signing tests
pytest tests/test_wallet_cold_signing.py
NOTE: tests require two wallets and can take several minutes to complete while block confirmations occur
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
coffee rest stand said leg muse defense wild about mighty horse melt really hum sharp seek honest brush depress beyond hundred silly confusion inhale birthday frozen
-
When instructed, provide the following password for the secured seed
123456
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S regularwallet ./simplewallet --wallet-file nwiz.test --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 22002 --daemon-address 0.0.0.0:22022
-
Use Console to restore a testnet wallet from seed
./simplewallet --restore-wallet nwiz.test --password 123456
-
When instructed, provide the following seed phrase
obviously essence rise wow appear glove veil gain beneath ask suddenly manage thunder near sympathy respect pants led lucky pie rant water deeply mean shift somebody
-
When instructed, provide the following password for the secured seed
123456
-
Use Console to execute the following command to open a normal wallet as a service with screen
screen -S otherwallet ./simplewallet --wallet-file nwiz.other --password 123456 --rpc-bind-ip 0.0.0.0 --rpc-bind-port 12234 --daemon-address 0.0.0.0:22022
-
Run the contract tests
pytest tests/test_wallet_contract.py