Python implementation of NANO currency related functions
Project description
nanopy
nanopy includes C extensions for work generation and signing, and therefore needs a compiler to install.
sudo apt install gcc python3-dev
pip install nanopy
When needed, use the environment variables CC, LDSHARED, CFLAGS, and LDFLAGS to tweak build options. See setuptools documentation for further info.
GPU support can be enabled with USE_OCL=1 and appropriate OpenCL dependencies.
sudo apt install gcc python3-dev ocl-icd-opencl-dev intel/mesa/nvidia/pocl/rocm-opencl-icd
USE_OCL=1 pip install nanopy
- Install
mnemonicto generate mnemonic wallets. - Install
requestsorwebsocket-clientto use http or websocket RPC, respectively.
Usage
# create an account (defaults to NANO network) and set secret key
seed = "0000000...."
acc = npy.Account()
acc.sk = npy.deterministic_key(seed)
# if it is not a new account, set the current state of the account (frontier, raw bal, rep)
acc.state = ("1234....", 1200000000000000, npy.Account(addr="nano_repaddress..."))
# create a receive block and optionally, change rep along with it
_hash = "5678...."
raw_amt = acc.network.to_raw("10")
rep = npy.Account(addr="nano_newrepaddress...")
rb = acc.receive(_hash, raw_amt, rep)
# create a send block
to = npy.Account(addr="nano_sendaddress...")
raw_amt = acc.network.to_raw("1")
sb = acc.send(to, raw_amt)
# broadcast
rpc.process(rb.json)
rpc.process(sb.json)
Wallet
A cli wallet is included with the library
- Configuration is in
~/.config/nanopy.ini
[nano]
nano_1111111111111111111111111111111111111111111111111111hifc8npp
nano_16aj46aj46aj46aj46aj46aj46aj46aj46aj46aj46aj46aj46ajbtsyew7c
rpc = http://localhost:7076
-n,--network. Choose the network to interact with - nano, banano, or beta. The default network is nano.- Checks state of accounts in
~/.config/nanopy.iniby default. - Open a wallet,
nanopy-wallet open FILE KEY.KEYis a seed in a KDBXFILE. Seenanopy-wallet open -hfor options.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file nanopy-28.0.1.post14.tar.gz.
File metadata
- Download URL: nanopy-28.0.1.post14.tar.gz
- Upload date:
- Size: 123.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae8ecd054c0a304d8a976271b540f74de122c5704d14faa016a02a926beed56c
|
|
| MD5 |
e0b329e9cdd616318a781e004aa8064f
|
|
| BLAKE2b-256 |
b5d4c64b1bccd2427b82fdcc9918308bebbab4a29e6562a8faed4956e1c7748f
|
Provenance
The following attestation bundles were made for nanopy-28.0.1.post14.tar.gz:
Publisher:
nanopy.yml on nkr0/nanopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nanopy-28.0.1.post14.tar.gz -
Subject digest:
ae8ecd054c0a304d8a976271b540f74de122c5704d14faa016a02a926beed56c - Sigstore transparency entry: 1288020040
- Sigstore integration time:
-
Permalink:
nkr0/nanopy@d7093999a75fef0cce04d050fff9948c19408e79 -
Branch / Tag:
refs/tags/28.0.1-14 - Owner: https://github.com/nkr0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
nanopy.yml@d7093999a75fef0cce04d050fff9948c19408e79 -
Trigger Event:
push
-
Statement type: