README.md in nanook-2.4.0 vs README.md in nanook-2.5.0

- old
+ new

@@ -1,8 +1,8 @@ # Nanook -This is a Ruby library for managing a [nano currency](https://nano.org/) node, including making and receiving payments, using the [nano RPC protocol](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol). Nano is a fee-less, fast, environmentally-friendly cryptocurrency. It's awesome. See [https://nano.org](https://nano.org/). +This is a Ruby library for managing a [nano currency](https://nano.org/) node, including making and receiving payments, using the [nano RPC protocol](https://developers.nano.org/docs/rpc). Nano is a fee-less, fast, environmentally-friendly cryptocurrency. It's awesome. See [https://nano.org](https://nano.org/). [![Gem Version](https://badge.fury.io/rb/nanook.svg)](https://badge.fury.io/rb/nanook) [![CircleCI](https://circleci.com/gh/lukes/nanook/tree/master.svg?style=shield)](https://circleci.com/gh/lukes/nanook/tree/master) @@ -74,21 +74,21 @@ ```ruby wallet = Nanook.new.wallet(wallet_id) wallet.pay(from: your_account_id, to: recipient_account_id, amount: 0.2, id: unique_id) ``` -The `id` can be any string and needs to be unique per payment. It serves an important purpose; it allows you to make this call multiple times with the same `id` and be reassured that you will only ever send that nano payment once. From the [Nano RPC](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create): +The `id` can be any string and needs to be unique per payment. It serves an important purpose; it allows you to make this call multiple times with the same `id` and be reassured that you will only ever send that nano payment once. From the [Nano RPC](https://developers.nano.org/docs/rpc#send): > You can (and should) specify a unique id for each spend to provide idempotency. That means that if you [make the payment call] two times with the same id, the second request won't send any additional Nano. The unit of the `amount` is NANO (which is currently technically Mnano &mdash; see [What are Nano's Units](https://nano.org/en/faq#what-are-nano-units-)). You can pass an amount of raw instead by adding the `unit: :raw` argument: ```ruby account.pay(to: recipient_account_id, amount: 999, unit: :raw, id: unique_id) ``` -Note, there may be a delay in receiving a response due to Proof of Work being done. From the [Nano RPC](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create): +Note, there may be a delay in receiving a response due to Proof of Work being done. From the [Nano RPC](https://developers.nano.org/docs/rpc#send): > Proof of Work is precomputed for one transaction in the background. If it has been a while since your last transaction it will send instantly, the next one will need to wait for Proof of Work to be generated. ### Receiving a payment @@ -118,15 +118,15 @@ wallet.receive(block_id, into: account_id) ``` ## All commands -Below is a quick reference list of commands. See the [full Nanook documentation](https://lukes.github.io/nanook/2.4.0/) for a searchable detailed description of every class and method, what the arguments mean, and example responses (Tip: the classes are listed under the "**Nanook** < Object" item in the sidebar). +Below is a quick reference list of commands. See the [full Nanook documentation](https://lukes.github.io/nanook/2.5.0/) for a searchable detailed description of every class and method, what the arguments mean, and example responses (Tip: the classes are listed under the "**Nanook** < Object" item in the sidebar). ### Wallets -See the [full documentation for Nanook::Wallet](https://lukes.github.io/nanook/2.4.0/Nanook/Wallet.html) for a detailed description of each method and example responses. +See the [full documentation for Nanook::Wallet](https://lukes.github.io/nanook/2.5.0/Nanook/Wallet.html) for a detailed description of each method and example responses. #### Create wallet: ```ruby Nanook.new.wallet.create @@ -157,18 +157,20 @@ wallet.pending(unit: :raw) wallet.receive(into: account_id) wallet.receive(pending_block_id, into: account_id) wallet.account.create +wallet.account.create(5) wallet.accounts wallet.contains?(account_id) wallet.default_representative wallet.change_default_representative(new_representative) wallet.info wallet.info(unit: :raw) wallet.export +wallet.lock wallet.locked? wallet.unlock(password) wallet.change_password(password) wallet.destroy @@ -187,11 +189,11 @@ Nanook.new.wallet(wallet_id).account.create(5) ``` #### Working with a single account: -See the [full documentation for Nanook::WalletAccount](https://lukes.github.io/nanook/2.4.0/Nanook/WalletAccount.html) for a detailed description of each method and example responses. +See the [full documentation for Nanook::WalletAccount](https://lukes.github.io/nanook/2.5.0/Nanook/WalletAccount.html) for a detailed description of each method and example responses. ```ruby account = Nanook.new.wallet(wallet_id).account(account_id) account.balance @@ -227,11 +229,11 @@ account.destroy ``` #### Working with any account (not necessarily in your wallet): -See the [full documentation for Nanook::Account](https://lukes.github.io/nanook/2.4.0/Nanook/Account.html) for a detailed description of each method and example responses. +See the [full documentation for Nanook::Account](https://lukes.github.io/nanook/2.5.0/Nanook/Account.html) for a detailed description of each method and example responses. ```ruby account = Nanook.new.account(account_id) account.balance @@ -260,20 +262,21 @@ account.weight ``` ### Blocks -See the [full documentation for Nanook::Block](https://lukes.github.io/nanook/2.4.0/Nanook/Block.html) for a detailed description of each method and example responses. +See the [full documentation for Nanook::Block](https://lukes.github.io/nanook/2.5.0/Nanook/Block.html) for a detailed description of each method and example responses. ```ruby block = Nanook.new.block(block_id) block.info # Verified blocks in the ledger block.info(allow_unchecked: true) # Verified blocks AND unchecked synchronizing blocks block.account block.chain block.chain(limit: 10) +block.chain(offset: 10) block.confirm block.confirmed_recently? block.history block.history(limit: 10) block.republish @@ -281,30 +284,36 @@ block.republish(destinations: 2) block.pending? block.publish block.successors block.successors(limit: 10) +block.successors(offset: 10) block.generate_work block.generate_work(use_peers: true) block.cancel_work block.is_valid_work?(work_id) ``` ### Managing your nano node -See the [full documentation for Nanook::Node](https://lukes.github.io/nanook/2.4.0/Nanook/Node.html) for a detailed description of each method and example responses. +See the [full documentation for Nanook::Node](https://lukes.github.io/nanook/2.5.0/Nanook/Node.html) for a detailed description of each method and example responses. ```ruby node = Nanook.new.node node.account_count node.block_count node.block_count_by_type -node.bootstrap_any node.bootstrap(address: "::ffff:138.201.94.249", port: 7075) +node.bootstrap_any +node.bootstrap_lazy(block_id) +node.bootstrap_lazy(block_id, force: true) +node.bootstrap_status node.confirmation_history +node.difficulty +node.difficulty(include_trend: true) node.peers node.representatives node.representatives(unit: :raw) node.representatives_online node.synchronizing_blocks @@ -342,16 +351,16 @@ key.info ``` ## Nanook Metal -You can do any call listed in the [Nano RPC](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol) directly through the `rpc` method. The first argument should match the `action` of the RPC call, and then all remaining parameters are passed in as arguments. +You can do any call listed in the [Nano RPC](https://developers.nano.org/docs/rpc) directly through the `rpc` method. The first argument should match the `action` of the RPC call, and then all remaining parameters are passed in as arguments. -E.g., the [accounts_create command](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#accounts-create) can be called like this: +E.g., the [accounts_create command](https://developers.nano.org/docs/rpc#accounts-create) can be called like this: ```ruby -Nano.new.rpc(:accounts_create, wallet: wallet_id, count: 2) +Nanook.new.rpc.call(:accounts_create, wallet: wallet_id, count: 2) ``` ## Contributing Bug reports and pull requests are welcome. Pull requests with passing tests are even better. @@ -368,13 +377,13 @@ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). ## Buy me a nano coffee -This library is totally free to use, but feel free to send some nano [my way](https://www.nanode.co/account/xrb_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j) if you'd like to! +This library is totally free to use, but feel free to send some nano [my way](https://www.nanode.co/account/nano_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j) if you'd like to! - xrb_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j + nano_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j -![alt xrb_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j](https://raw.githubusercontent.com/lukes/nanook/master/img/qr.png) +![alt nano_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j](https://raw.githubusercontent.com/lukes/nanook/master/img/qr.png)