Package: nanoblocks
NanoBlocksis anunofficialPython package built to ease the access toNANO cryptocurrency. It is intended to give an easy interface for programmers to play with the Nano Network, allowing most Nano common operations which includes creating new wallets and accounts, checking accounts information, making transactions and more.An extensive documentation of the package can be found byreading the docs.InstallationNanoBlockscan be installed through pip:pipinstallnanoblocksGetting startedIt is required to have a Nano node installed and configured in order to release all the functionalities that this package can give; even though it can still work offline for certain operations (like creating wallets, accounts, and building and signing blocks).It is highly encouraged to get access to the node RPC and WebSocket servers. A guide for installation of the node can be foundhere. Furthermore, anano-work-serveraccess for work generation is also recommended to enable transactions.Everything starts with theNanoNodeand theNanoNetworkclasses:>>>fromnanoblocks.nodeimportNanoNode>>>fromnanoblocks.networkimportNanoNetwork>>node=NanoNode("http://localhost:7076","ws://localhost:7078")>>node[Nodehttp://localhost:7076(NanoV21.2)]>>network=NanoNetwork(node)>>network[Nodehttp://localhost:7076(NanoV21.2)](270peers;15362838account)Having aNanoNetworkclass instance, accounts in the network can be accessed as easy as follows:>>>account=network.accounts["nano_39a73oy5ungrhxy5z5oao1xso4zo7dmgpjd4u74xcrx3r1w6rtazuouw6qfi"]>>>accountnano_39a73oy5ungrhxy5z5oao1xso4zo7dmgpjd4u74xcrx3r1w6rtazuouw6qfi(Totalblocks:733Totalbalance:0.000002000000000000000000000002NANOConfirmedbalance:0.000000000000000000000000000000NANOPendingbalance:0.000002000000000000000000000002NANOLastconfirmedpayment:2020-12-0201:30:39+01:00Isvirtual:FalseBlocks can be accessed as follows:>>>block=network.blocks["4FEC4BDD078C741F599221C67C8BE6493C872EF9B30968BBF4991640FFF42DA2"]>>>block[Block#4 from account nano_39a73oy5ungrhxy5z5oao1xso4zo7dmgpjd4u74xcrx3r1w6rtazuouw6qfi]Type:receiveHash:4FEC4BDD078C741F599221C67C8BE6493C872EF9B30968BBF4991640FFF42DA2Sourceaccount:nano_39a73oy5ungrhxy5z5oao1xso4zo7dmgpjd4u74xcrx3r1w6rtazuouw6qfiAmount:0.000040000000000000000000000000Localdate:1970-01-0101:00:00+01:00And wallets can be accessed as follows:# To access an existing wallet by using the 64-Bytes seed:>>>wallet=network.wallets["7F632A80ECCC54A058602CD64A81D23A6B4D7320562E4767C9EB0BBB1151CDF2"]# Alternatively, it can be accessed with the BIP-39 24 words:>>>wallet=network.wallets[['legal','bone','parent','sunset','shed','expand','ghost','airport','stone','favorite','innocent','inquiry','regular','ridge','life','shift','electric','dinner','kiss','blast','rain','pottery','daughter','execute']]# Wallet information can be printed out>>>print(wallet.seed)7F632A80ECCC54A058602CD64A81D23A6B4D7320562E4767C9EB0BBB1151CDF2>>>print(wallet.mnemonic)['legal','bone','parent','sunset','shed','expand','ghost','airport','stone','favorite','innocent','inquiry','regular','ridge','life','shift','electric','dinner','kiss','blast','rain','pottery','daughter','execute']Which allows to access accounts as follows:>>>account_0=wallet.accounts[0]Easy, right? Check all what you can do byreading the docs!LICENSEThis package is license under the MIT license.