blogpost for subspace 1.3
This commit is contained in:
parent
dbd142fb7a
commit
64edc1e051
|
@ -0,0 +1,47 @@
|
|||
title: Subspace 1.3
|
||||
author: richard_ramos
|
||||
summary: "Subspace 1.3 release - new track methods trackBlock, trackBlockNumber, trackGasPrice, trackAverageBlocktime"
|
||||
categories:
|
||||
- announcements
|
||||
- releases
|
||||
- subspace
|
||||
layout: blog-post
|
||||
---
|
||||
|
||||
Subspace 1.3
|
||||
===
|
||||
|
||||
New to subspace? Check out the website at [http://subspace.embarklabs.io/](http://subspace.embarklabs.io/)
|
||||
|
||||
### New methods available to track blocks, gas price and blocktime
|
||||
|
||||
#### `trackBlock()`
|
||||
Returns the block information for any new block as soon as they are mined. It's the reactive equivalent to `web3.eth.getBlock("latest")`.
|
||||
```js
|
||||
subspace.trackBlock().subscribe(block => console.log(block));
|
||||
```
|
||||
|
||||
#### `trackBlockNumber()`
|
||||
Returns the latest block number. It's the reactive equivalent to `web3.eth.getBlockNumber`.
|
||||
```js
|
||||
subspace.trackBlockNumber().subscribe(blockNumber => console.log(blockNumber));
|
||||
```
|
||||
|
||||
#### `trackGasPrice()`
|
||||
Returns the current gas price oracle. It's the reactive equivalent to `web3.eth.getGasPrice`.
|
||||
```js
|
||||
subspace.trackGasPrice().subscribe(gasPrice => console.log(gasPrice));
|
||||
```
|
||||
|
||||
#### `trackAverageBlocktime()`
|
||||
Returns the moving average block time taking in account the latest 10 blocks. The time is returned in milliseconds:
|
||||
```js
|
||||
subspace.trackAverageBlocktime().subscribe(blocktimeMS => console.log(blocktimeMS));
|
||||
```
|
||||
|
||||
### Bug fixes
|
||||
- Web3 subscriptions are reused, which means that calling a track method with the same parameters more than once will not create a duplicate subscription.
|
||||
|
||||
### Contributions
|
||||
|
||||
Subspace and the entire Embark labs organization are open source. As such we welcome contributions and input from the community using the product.
|
Loading…
Reference in New Issue