Skip to content
Snippets Groups Projects
Commit ccc8bdcf authored by inertia's avatar inertia
Browse files

#56 switched broadcast examples to testnets

parent 97724569
No related branches found
No related tags found
1 merge request!114Restoring Master
Showing
with 33 additions and 4 deletions
You can launch a local testnet, with port 8090 mapped locally to the docker container:
```bash
docker run -d -p 8090:8090 inertia/tintoy:latest
```
For details on running a local testnet, see: [Setting Up a Testnet]({{ '/nodeop/setting-up-a-testnet.html' | relative_url }})
...@@ -33,6 +33,8 @@ As stated earlier, you will need to change `broadcast` to `true`. You can also ...@@ -33,6 +33,8 @@ As stated earlier, you will need to change `broadcast` to `true`. You can also
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository): First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository):
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/12_edit_content_patching cd devportal/tutorials/ruby/12_edit_content_patching
......
...@@ -63,6 +63,8 @@ We also specify `blog` to tell the API method that we're looking for followed, n ...@@ -63,6 +63,8 @@ We also specify `blog` to tell the API method that we're looking for followed, n
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository): First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository):
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/18_follow_another_user cd devportal/tutorials/ruby/18_follow_another_user
......
...@@ -286,6 +286,8 @@ Broadcasting a `custom_json` operation will require the following fields: ...@@ -286,6 +286,8 @@ Broadcasting a `custom_json` operation will require the following fields:
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository): First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository):
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/14_reblogging_post cd devportal/tutorials/ruby/14_reblogging_post
......
...@@ -34,6 +34,8 @@ You should change `wif` to the posting key that matches your `author`. This scr ...@@ -34,6 +34,8 @@ You should change `wif` to the posting key that matches your `author`. This scr
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository): First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository):
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/11_submit_comment_reply cd devportal/tutorials/ruby/11_submit_comment_reply
......
...@@ -30,6 +30,8 @@ You should change `wif` to the posting key that matches your `author`. This scr ...@@ -30,6 +30,8 @@ You should change `wif` to the posting key that matches your `author`. This scr
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository): First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository):
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/10_submit_post cd devportal/tutorials/ruby/10_submit_post
......
...@@ -203,6 +203,8 @@ Broadcasting a `vote` operation will require the following fields: ...@@ -203,6 +203,8 @@ Broadcasting a `vote` operation will require the following fields:
First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository) with the following arguments: First, set up your workstation using the steps provided in [Getting Started]({{ '/tutorials-ruby/getting_started.html' | relative_url }}). Then you can create and execute the script (or clone from this repository) with the following arguments:
{% include local-testnet.html %}
```bash ```bash
git clone https://gitlab.syncad.com/hive/devportal.git git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/17_vote_on_content cd devportal/tutorials/ruby/17_vote_on_content
......
...@@ -4,6 +4,7 @@ require 'bundler/setup' ...@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require Bundler.require
options = { options = {
url = 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
} }
tx = Radiator::Transaction.new(options) tx = Radiator::Transaction.new(options)
......
...@@ -4,6 +4,7 @@ require 'bundler/setup' ...@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require Bundler.require
options = { options = {
url: 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
} }
tx = Radiator::Transaction.new(options) tx = Radiator::Transaction.new(options)
......
...@@ -5,11 +5,12 @@ Bundler.require ...@@ -5,11 +5,12 @@ Bundler.require
# change to true if you want to broadcast this example # change to true if you want to broadcast this example
broadcast = false broadcast = false
url = 'https://testnet.openhive.network'
wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
author = 'social' author = 'social'
title = 'title of my post' title = 'title of my post'
permlink = title.gsub(' ', '-').downcase permlink = title.gsub(' ', '-').downcase
api = Radiator::Api.new api = Radiator::Api.new(url: url)
content = api.get_content(author, permlink).result content = api.get_content(author, permlink).result
metadata = {tags: %w(tag), app: 'devportal/1.0'} metadata = {tags: %w(tag), app: 'devportal/1.0'}
new_body = "#{content.body}\nAppended content." new_body = "#{content.body}\nAppended content."
...@@ -33,7 +34,7 @@ post = { ...@@ -33,7 +34,7 @@ post = {
body: new_body body: new_body
} }
tx = Radiator::Transaction.new(wif: wif) tx = Radiator::Transaction.new(url: url, wif: wif)
tx.operations << post tx.operations << post
response = tx.process(broadcast) response = tx.process(broadcast)
......
...@@ -9,7 +9,10 @@ author = slug.split('/')[0] ...@@ -9,7 +9,10 @@ author = slug.split('/')[0]
permlink = slug.split('/')[1..-1].join('/') permlink = slug.split('/')[1..-1].join('/')
reblogger = 'social' reblogger = 'social'
posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
options = {wif: posting_wif} options = {
url: 'https://testnet.openhive.network',
wif: posting_wif
}
tx = Radiator::Transaction.new(options) tx = Radiator::Transaction.new(options)
......
...@@ -9,8 +9,11 @@ author = slug.split('/')[0] ...@@ -9,8 +9,11 @@ author = slug.split('/')[0]
permlink = slug.split('/')[1..-1].join('/') permlink = slug.split('/')[1..-1].join('/')
voter = 'social' voter = 'social'
posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
options = {wif: posting_wif}
weight = ((weight || '100.0').to_f * 100).to_i weight = ((weight || '100.0').to_f * 100).to_i
options = {
url: 'https://testnet.openhive.network',
wif: posting_wif
}
tx = Radiator::Transaction.new(options) tx = Radiator::Transaction.new(options)
......
...@@ -4,6 +4,7 @@ require 'bundler/setup' ...@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require Bundler.require
options = { options = {
url: 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC' wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
} }
tx = Radiator::Transaction.new(options) tx = Radiator::Transaction.new(options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment