bcoin-org / bclient Goto Github PK
View Code? Open in Web Editor NEWBcoin node and wallet clients
License: Other
Bcoin node and wallet clients
License: Other
It would be really convenient if bcoin-cli
printed off the environmental variables that it works with after running something like:
$ bcoin-cli help
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) !!
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 ?
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 "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)
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.