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
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
git clone https://gitlab.syncad.com/hive/devportal.git
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
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
git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/18_follow_another_user
......
......@@ -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):
{% include local-testnet.html %}
```bash
git clone https://gitlab.syncad.com/hive/devportal.git
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
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
git clone https://gitlab.syncad.com/hive/devportal.git
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
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
git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/10_submit_post
......
......@@ -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:
{% include local-testnet.html %}
```bash
git clone https://gitlab.syncad.com/hive/devportal.git
cd devportal/tutorials/ruby/17_vote_on_content
......
......@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require
options = {
url = 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
}
tx = Radiator::Transaction.new(options)
......
......@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require
options = {
url: 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
}
tx = Radiator::Transaction.new(options)
......
......@@ -5,11 +5,12 @@ Bundler.require
# change to true if you want to broadcast this example
broadcast = false
url = 'https://testnet.openhive.network'
wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
author = 'social'
title = 'title of my post'
permlink = title.gsub(' ', '-').downcase
api = Radiator::Api.new
api = Radiator::Api.new(url: url)
content = api.get_content(author, permlink).result
metadata = {tags: %w(tag), app: 'devportal/1.0'}
new_body = "#{content.body}\nAppended content."
......@@ -33,7 +34,7 @@ post = {
body: new_body
}
tx = Radiator::Transaction.new(wif: wif)
tx = Radiator::Transaction.new(url: url, wif: wif)
tx.operations << post
response = tx.process(broadcast)
......
......@@ -9,7 +9,10 @@ author = slug.split('/')[0]
permlink = slug.split('/')[1..-1].join('/')
reblogger = 'social'
posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
options = {wif: posting_wif}
options = {
url: 'https://testnet.openhive.network',
wif: posting_wif
}
tx = Radiator::Transaction.new(options)
......
......@@ -9,8 +9,11 @@ author = slug.split('/')[0]
permlink = slug.split('/')[1..-1].join('/')
voter = 'social'
posting_wif = '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
options = {wif: posting_wif}
weight = ((weight || '100.0').to_f * 100).to_i
options = {
url: 'https://testnet.openhive.network',
wif: posting_wif
}
tx = Radiator::Transaction.new(options)
......
......@@ -4,6 +4,7 @@ require 'bundler/setup'
Bundler.require
options = {
url: 'https://testnet.openhive.network',
wif: '5JrvPrQeBBvCRdjv29iDvkwn3EQYZ9jqfAHzrCyUvfbEbRkrYFC'
}
tx = Radiator::Transaction.new(options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment