ravencoin_rpc_ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2cc753cba73de8407a8606fde0cc8ed7cf5bc5a8d34b79c16f57e714b959051a
4
+ data.tar.gz: 354f5505ea0426e63d7e13d54ec123b33d7a6277537426c073d3ca997a6d2db8
5
+ SHA512:
6
+ metadata.gz: 781c0d65af1fc13393d17f68e77cfdea6d8fcf3b3ce2c49224732ae1ca3548ff23cee42a59741e2cfff30b5a55a84ccc4092054f8a911d14e9b39e756f74c13c
7
+ data.tar.gz: 68f0286ff6a9e52ebdb491c1716d48bd2d553b3f172e889470517d5fbf4679494446b061160d359bec3569f8a62578b27637aaae426684453b23b501279257fd
@@ -0,0 +1,45 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Ruby 2.7
20
+ uses: actions/setup-ruby@v1
21
+ with:
22
+ ruby-version: 2.7
23
+
24
+ - name: Publish to GPR
25
+ run: |
26
+ mkdir -p $HOME/.gem
27
+ touch $HOME/.gem/credentials
28
+ chmod 0600 $HOME/.gem/credentials
29
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
30
+ gem build *.gemspec
31
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
32
+ env:
33
+ GEM_HOST_API_KEY: "Bearer ${{secrets.AUTH_GITHUB_TOKEN}}"
34
+ OWNER: ${{ github.repository_owner }}
35
+
36
+ - name: Publish to RubyGems
37
+ run: |
38
+ mkdir -p $HOME/.gem
39
+ touch $HOME/.gem/credentials
40
+ chmod 0600 $HOME/.gem/credentials
41
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
42
+ gem build *.gemspec
43
+ gem push *.gem
44
+ env:
45
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.6
6
+ before_install: gem install bundler -v 2.1.4
data/1.md ADDED
@@ -0,0 +1 @@
1
+ # README
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at vulkan.u4u1@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in ravencoin_rpc.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0.1'
9
+ gem 'rspec', '~> 3.0'
10
+ gem 'rubocop'
data/Gemfile.lock ADDED
@@ -0,0 +1,105 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ ravencoin_rpc (0.1.0)
5
+ activesupport (~> 6.1.7)
6
+ attr_extras (~> 6.2)
7
+ faraday (~> 1.3)
8
+ faraday_middleware (~> 1.0)
9
+ json
10
+ ostruct
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activesupport (6.1.7)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ ast (2.4.2)
22
+ attr_extras (6.2.5)
23
+ concurrent-ruby (1.1.10)
24
+ diff-lcs (1.5.0)
25
+ faraday (1.10.2)
26
+ faraday-em_http (~> 1.0)
27
+ faraday-em_synchrony (~> 1.0)
28
+ faraday-excon (~> 1.1)
29
+ faraday-httpclient (~> 1.0)
30
+ faraday-multipart (~> 1.0)
31
+ faraday-net_http (~> 1.0)
32
+ faraday-net_http_persistent (~> 1.0)
33
+ faraday-patron (~> 1.0)
34
+ faraday-rack (~> 1.0)
35
+ faraday-retry (~> 1.0)
36
+ ruby2_keywords (>= 0.0.4)
37
+ faraday-em_http (1.0.0)
38
+ faraday-em_synchrony (1.0.0)
39
+ faraday-excon (1.1.0)
40
+ faraday-httpclient (1.0.1)
41
+ faraday-multipart (1.0.4)
42
+ multipart-post (~> 2)
43
+ faraday-net_http (1.0.1)
44
+ faraday-net_http_persistent (1.2.0)
45
+ faraday-patron (1.0.0)
46
+ faraday-rack (1.0.0)
47
+ faraday-retry (1.0.3)
48
+ faraday_middleware (1.2.0)
49
+ faraday (~> 1.0)
50
+ i18n (1.12.0)
51
+ concurrent-ruby (~> 1.0)
52
+ json (2.6.2)
53
+ minitest (5.16.3)
54
+ multipart-post (2.2.3)
55
+ ostruct (0.5.5)
56
+ parallel (1.22.1)
57
+ parser (3.1.2.1)
58
+ ast (~> 2.4.1)
59
+ rainbow (3.1.1)
60
+ rake (13.0.6)
61
+ regexp_parser (2.6.0)
62
+ rexml (3.2.5)
63
+ rspec (3.10.0)
64
+ rspec-core (~> 3.10.0)
65
+ rspec-expectations (~> 3.10.0)
66
+ rspec-mocks (~> 3.10.0)
67
+ rspec-core (3.10.1)
68
+ rspec-support (~> 3.10.0)
69
+ rspec-expectations (3.10.1)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.10.0)
72
+ rspec-mocks (3.10.2)
73
+ diff-lcs (>= 1.2.0, < 2.0)
74
+ rspec-support (~> 3.10.0)
75
+ rspec-support (3.10.2)
76
+ rubocop (1.36.0)
77
+ json (~> 2.3)
78
+ parallel (~> 1.10)
79
+ parser (>= 3.1.2.1)
80
+ rainbow (>= 2.2.2, < 4.0)
81
+ regexp_parser (>= 1.8, < 3.0)
82
+ rexml (>= 3.2.5, < 4.0)
83
+ rubocop-ast (>= 1.20.1, < 2.0)
84
+ ruby-progressbar (~> 1.7)
85
+ unicode-display_width (>= 1.4.0, < 3.0)
86
+ rubocop-ast (1.21.0)
87
+ parser (>= 3.1.1.0)
88
+ ruby-progressbar (1.11.0)
89
+ ruby2_keywords (0.0.5)
90
+ tzinfo (2.0.5)
91
+ concurrent-ruby (~> 1.0)
92
+ unicode-display_width (2.3.0)
93
+ zeitwerk (2.6.1)
94
+
95
+ PLATFORMS
96
+ arm64-darwin-21
97
+
98
+ DEPENDENCIES
99
+ rake (~> 13.0.1)
100
+ ravencoin_rpc!
101
+ rspec (~> 3.0)
102
+ rubocop
103
+
104
+ BUNDLED WITH
105
+ 2.3.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Vladimir Sidorenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # RavencoinRpcRuby
2
+
3
+ A package that will help you do RPC calls from Ruby / Rails / etc to your Raven core node.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ravencoin_rpc'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install ravencoin_rpc
20
+
21
+ ## Usage
22
+
23
+ ```ruby
24
+ @client ||= RavencoinRpc::Client.new(url: 'raven_node_rpc_url:port', login: 'login', password: 'password')
25
+
26
+ # Get difficulty
27
+
28
+ client.('getdifficulty')
29
+ => 235605.3157608159
30
+
31
+ # Get getbestblockhash
32
+
33
+ client.('getbestblockhash')
34
+ => "0000000000000c8df13031bd90c0ede26d7a1439fc955e001028bab4f6449f1b"
35
+
36
+ # Get getassetdata
37
+
38
+ client.('getassetdata', ['SYNTH/COIN'])
39
+ => {"name"=>"SYNTH/COIN", "amount"=>21000000, "units"=>0, "reissuable"=>1, "has_ipfs"=>1, "ipfs_hash"=>"QmQNeN1mNWFJXg37Vq48CkVhLsva84uHYBkBdCA7ELEaYv"}
40
+
41
+ # Get getrawtransaction
42
+
43
+ client.('getrawtransaction', ['735e678c50f12d5ca49866a7a72652448c5663efabc280017c26ab9bfedff190', true])
44
+
45
+ => {"txid"=>"735e678c50f12d5ca49866a7a72652448c5663efabc280017c26ab9bfedff190", "hash"=>"26bde081606193f60ef2ecbdc12c6178e509359f6587bd1d0c73698dd9632feb", "version"=>1, "size"=>186, "vsize"=>159, "locktime"=>0, "vin"=>[{"coinbase"=>"03211626002f666c79706f6f6c2e6f72672f", "sequence"=>4294967295}], "vout"=>[{"value"=>2500.01569097, "n"=>0, "scriptPubKey"=>{"asm"=>"OP_DUP OP_HASH160 cb6d3fedc3b50d5936a36601710c6008ff783fd1 OP_EQUALVERIFY OP_CHECKSIG", "hex"=>"76a914cb6d3fedc3b50d5936a36601710c6008ff783fd188ac", "reqSigs"=>1, "type"=>"pubkeyhash", "addresses"=>["RTpp8G7Y5f9HZ1iGNz1gtbWazwnHvoHCxK"]}, "valueSat"=>250001569097}, {"value"=>0.0, "n"=>1, "scriptPubKey"=>{"asm"=>"OP_RETURN aa21a9ede7b473ed902c0f0dbf40ad15b44415efd01b33031c9aa3ad22a7270300a5b614", "hex"=>"6a24aa21a9ede7b473ed902c0f0dbf40ad15b44415efd01b33031c9aa3ad22a7270300a5b614", "type"=>"nulldata"}, "valueSat"=>0}], "hex"=>"010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff1203211626002f666c79706f6f6c2e6f72672fffffffff02493541353a0000001976a914cb6d3fedc3b50d5936a36601710c6008ff783fd188ac0000000000000000266a24aa21a9ede7b473ed902c0f0dbf40ad15b44415efd01b33031c9aa3ad22a7270300a5b6140120000000000000000000000000000000000000000000000000000000000000000000000000", "blockhash"=>"00000000000041dbecb93a3a577816dce9321053f75429a9497d5003677af7eb", "height"=>2496033, "confirmations"=>2, "time"=>1665821398, "blocktime"=>1665821398}
46
+ ```
47
+
48
+ ## [See all methods](ravencoin_methods.md)
49
+
50
+
51
+
52
+ ## Contributing
53
+
54
+ Bug reports and pull requests are welcome on GitHub at https://github.com/vulkanfry/ravencoin_rpc_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/vulkanfry/ravencoin_rpc_ruby/blob/master/CODE_OF_CONDUCT.md).
55
+
56
+
57
+ ## License
58
+
59
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'ravencoin_rpc'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here