fix: adding react readme.md
This commit is contained in:
parent
0344cb3c93
commit
7160031807
|
@ -28,14 +28,14 @@ const Subspace = require('@embarklabs/subspace');
|
||||||
|
|
||||||
|
|
||||||
### Initializing the library
|
### Initializing the library
|
||||||
To interact with the EVM, Subspace requires web3.js and a valid websockets provider.
|
To interact with the EVM, Subspace requires web3.js
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const subspace = new Subspace(web3.currentProvider);
|
const subspace = new Subspace(web3);
|
||||||
await subspace.init();
|
await subspace.init();
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition to the provider, `Subspace` also accepts an `options` object with settings that can change its behavior:
|
In addition to the web3 object, `Subspace` also accepts an `options` object with settings that can change its behavior:
|
||||||
- `dbFilename` - Name of the database where the information will be stored (default `subspace.db`)
|
- `dbFilename` - Name of the database where the information will be stored (default `subspace.db`)
|
||||||
- `callInterval` - Interval of time in milliseconds to query a contract/address to determine changes in state or balance (default: `undefined`. Obtain data every block).
|
- `callInterval` - Interval of time in milliseconds to query a contract/address to determine changes in state or balance (default: `undefined`. Obtain data every block).
|
||||||
- `refreshLastNBlocks` - Ignores last N blocks (from current block), stored in the local db and refresh them via a web3 subscription. Useful for possible reorgs (default: `12`),
|
- `refreshLastNBlocks` - Ignores last N blocks (from current block), stored in the local db and refresh them via a web3 subscription. Useful for possible reorgs (default: `12`),
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
![Subspace](https://raw.githubusercontent.com/status-im/subspace/master/logo.png?token=AABLEUFLVJ24SL7R6JIRXVS5T2MFI)
|
||||||
|
===
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
`subspace-react` is a set of components that simplifies the use of Subspace within React projects
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
https://subspace.embarklabs.io/react.html
|
||||||
|
|
||||||
|
### Install
|
||||||
|
You can install it through `npm` or `yarn`:
|
||||||
|
```
|
||||||
|
npm install --save @embarklabs/subspace-react web3 rxjs # RxJS and Web3.js are needed peer-dependencies
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!
|
||||||
|
|
||||||
|
If you'd like to contribute to Subspace, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on #embark-status channel to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
|
||||||
|
|
||||||
|
## License
|
||||||
|
MIT
|
Loading…
Reference in New Issue