Giter VIP home page Giter VIP logo

bclient's People

Contributors

chjj avatar pinheadmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bclient's Issues

send value is in BTC not satoshis (like curl): send value is multiplied x^8!!!

Because of this line:
https://github.com/bcoin-org/bclient/blob/master/bin/bwallet-cli#L278
...for any send using bwallet-cli send the value is interpreted as WHOLE BTC and is exponentiated by ^8 to get a satoshis value, which is then sent to the actual wallet for composing a transaction.

This is VERY DIFFERENT from using curl:
https://github.com/bcoin-org/bcoin/blob/c7d844ea3785c939cd546ce2fe7ff0e03f27197a/lib/wallet/http.js#L450
...where the value is interpreted literally as satoshis. This is the same behavior when using the Javascript WalletClient from bclient

Currently the documentation does not distinguish between the two formats:
http://localhost:4567/?shell--cli#send-a-transaction

So, when sending a value=1000 from cURL or from Javascript WalletClient, you will send 0.00001000 BTC. If you send the same value=1000 from bwallet-cli you will send 1,000 BTC (1000.00000000) !!

Share websocket connection

Hi there,

I am currently using bcoin in a large scale application and now looking into this wallet rewrite. I am concerned about watching thousands of wallet and the performances problems of having thousands of web sockets connection on the same process.

It seems like the bcurl’s client is not bound to a specific wallet, so we don’t need to have one instance for every wallet (today by inheritance). Instead, we could share one instance, so it also share the web socket connection in same process.

This way, each wallet ask client to register to a wallet id, then the client will receive events for every wallets. It could re-dispatch these events with wallet id in name of event, so each wallet only get event that is is destined to.

socket.on(‘wallet tx’) => this.emit('wallet:walletId tx’)

Do you think this is envisageable ?

Help text for "address command" missing argument for "account"

Version
bclient v0.1.1

Expected

./bin/bwallet-cli --network="regtest"
  ...
  $ account get [account-name]: Get account details.
  $ address [account-name]: Derive new address.
  $ change: Derive new change address.
  ...

Actual

./bin/bwallet-cli --network="regtest"
  ...
  $ account get [account-name]: Get account details.
  $ address: Derive new address.
  $ change: Derive new change address.
  ...

Reproduce

Does not work:

./bin/bwallet-cli --network="regtest" address

Works:

./bin/bwallet-cli --network="regtest" address "default"

bwallet-cli: view fails

» ./bwallet-cli view "77b24a0102054ca6a046e2fb61c59fe274a38a562dabcd2df24ad9e3ed8b2716"
TypeError: this.wallet.fill is not a function
    at CLI.viewTX (/home/vagrant/bcash-interlinker/node_modules/bclient/bin/bwallet-cli:352:34)
    at CLI.handleWallet (/home/vagrant/bcash-interlinker/node_modules/bclient/bin/bwallet-cli:569:20)
    at CLI.open (/home/vagrant/bcash-interlinker/node_modules/bclient/bin/bwallet-cli:682:17)
    at /home/vagrant/bcash-interlinker/node_modules/bclient/bin/bwallet-cli:693:13
    at Object.<anonymous> (/home/vagrant/bcash-interlinker/node_modules/bclient/bin/bwallet-cli:695:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

Should we use bcoin or an ephemeral/test server for testing?

It appears that NodeClient and WalletClient are designed to communicate with servers, since they're subclasses of bcurl's Client.

To test these two modules, should we require bcoin as a dependency and launch its server during testing or should we create a dummy/ephemeral server to use during testing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.