Textile Data Wallet (js-wallet)
Table of Contents
Textile provides encrypted, recoverable, schema-based, and cross-application data storage built on IPFS and libp2p. We like to think of it as a decentralized data wallet with built-in protocols for sharing and recovery, or more simply, an open and programmable iCloud.
A Textile 'wallet' is a core component of the Textile system. A wallet is represented by mnemonic phrase, and in practice is a BIP32 Hierarchical Deterministic Wallet based on Stellar's implementation of SLIP-0010. You can learn more about BIP39 mnemonics and more in this really nice interactive webpage. You can think of a wallet as a master key, and the account (see accounts) represent keys specific to a given application or use-case. Any given wallet may create an arbitrary number of accounts. For example, you may use a wallet to provision multiple Textile Photos 'accounts', each with a completely different persona if you so choose. This provides a powerful framework 'partitioning' use cases. It is also the backbone for enabling account backup and recovery. See https://docs.textile.io/concepts/the-wallet/ for more details.
# Run all the unit tests yarn test # Lint everything # NOTE: Linting uses `prettier` to auto-fix styling issues when possible yarn lint
You can also compile the Typescript yourself with:
And even build a nice browser-compatible bundle with:
dist, ready to be used in your next NodeJS, browser, React, Vue, or whatever app!
yarn browser will produce a minified
dist. This can be included in your browser app using something like:
<!DOCTYPE html> <html> ... <script src="./dist/bundle.js"></script> ... </html>
You'll have a global
var wallet variable which gives you access to the Textile Wallet and other exported objects.
The auto-generated documentation can be found at https://textileio.github.io/js-wallet/.
# Re-build the documentation yarn docs
This library is a work in progress. As such, there's a few things you can do right now to help out:
- Check out issue 1 for an up-to-date list (maintained by carsonfarmer) of tasks that could use your help.
- Ask questions! We'll try to help. Be sure to drop a note (on the above issue) if there is anything you'd like to work on and we'll update the issue to let others know. Also get in touch on Slack.
- Log bugs, file issues, submit pull requests!
- Perform code reviews. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
- Take a look at go-textile (which we intend to follow to a point). Contributions here that would be most helpful are top-level comments about how it should look based on our understanding. Again, the more eyes the better.
- Add tests. There can never be enough tests.
- Contribute to the Textile docs with any additions or questions you have about Textile and its various impmenentations. A good example would be asking, "What is an Account". If you don't know a term, odds are someone else doesn't either. Eventually, we should have a good understanding of where we need to improve communications and teaching together to make Textile even better.