Skip to content

Commit

Permalink
Merge pull request #209 from steemit/72-http-socket-support
Browse files Browse the repository at this point in the history
Http socket support
  • Loading branch information
bonustrack committed Jul 13, 2017
2 parents 1883be1 + ee88e81 commit 13a4186
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 363 deletions.
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"transport": "ws",
"websocket": "wss://steemd.steemit.com",
"uri": "https://steemd.steemit.com",
"dev_uri": "https://steemd.steemitdev.com",
"stage_uri": "https://steemd.steemitstage.com",
"address_prefix": "STM",
"chain_id": "0000000000000000000000000000000000000000000000000000000000000000"
}
24 changes: 12 additions & 12 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Install](#install)
- [Browser](#browser)
- [Config](#config)
- [JSON-RPC](#jsonrpc)
- [Database API](#api)
- [Subscriptions](#subscriptions)
- [Tags](#tags)
Expand Down Expand Up @@ -54,6 +55,16 @@ steem.config.set('address_prefix','STM');
steem.config.get('chain_id');
```

## JSON-RPC
Here is how to activate JSON-RPC transport:
```js
steem.api.setOptions({
transport: 'http',
uri: 'https://steemd.steemitdev.com' // Optional, by default https://steemd.steemit.com is used.
});

```

# API

## Subscriptions
Expand Down Expand Up @@ -517,12 +528,6 @@ steem.api.getFollowCount(account, function(err, result) {

## Broadcast API

### Broadcast Transaction
```
steem.api.broadcastTransaction(trx, function(err, result) {
console.log(err, result);
});
```
### Broadcast Transaction Synchronous
```
steem.api.broadcastTransactionSynchronous(trx, function(err, result) {
Expand All @@ -535,12 +540,7 @@ steem.api.broadcastBlock(b, function(err, result) {
console.log(err, result);
});
```
### Broadcast Transaction With Callback
```
steem.api.broadcastTransactionWithCallback(confirmationCallback, trx, function(err, result) {
console.log(err, result);
});
```

# Broadcast

### Account Create
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steem",
"version": "0.5.20",
"version": "0.6.0",
"description": "Steem.js the JavaScript API for Steem blockchain",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -45,9 +45,10 @@
"debug": "^2.6.8",
"detect-node": "^2.0.3",
"ecurve": "^1.0.5",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.16.4",
"secure-random": "^1.1.1",
"ws": "^1.1.1"
"ws": "^3.0.0"
},
"devDependencies": {
"babel-cli": "^6.16.0",
Expand Down
Loading

0 comments on commit 13a4186

Please sign in to comment.