module-render-xyz 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2191323ec8f661bec9b333080339179909b998c9daa9d375756d95a90bc5bd95
4
+ data.tar.gz: 7f0301e0f377c0a3753b64b8288fad5158528623a8bfdda6c8ff84ae021d97b6
5
+ SHA512:
6
+ metadata.gz: be5c5c5cd3cff6d118567cfa857efc179f6c5fe241d6d789e92419edebd8089e2f9a48ce43d26a3ad5d0a0c59eed4e90d6811ef6bab52894b6af04c2b145a085
7
+ data.tar.gz: 4e05964e74eb442479f44cc1e3afb3ada91ca0b84e1b5eb254e301d8d8e68bcf20359245c7be2b9fcbc25dc3923db1633839e487ec3dc47837e03512a98fed96
@@ -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
@@ -0,0 +1,8 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ - 2.6.2
8
+ before_install: gem install bundler -v 1.16.3
@@ -0,0 +1,5 @@
1
+ FROM ruby:2.6.1
2
+
3
+ COPY . .
4
+
5
+ CMD ["tail" , "-f", "/dev/null"]
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in peatio-infura.gemspec
6
+ gemspec
@@ -0,0 +1,114 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ module-render-xyz (0.1.3)
5
+ activesupport (~> 5.2.3)
6
+ better-faraday (~> 1.0.5)
7
+ faraday (~> 0.15.4)
8
+ memoist (~> 0.16.0)
9
+ net-http-persistent (~> 3.0.1)
10
+ peatio (~> 0.6.1)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (5.2.4)
16
+ activesupport (= 5.2.4)
17
+ activesupport (5.2.4)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 0.7, < 2)
20
+ minitest (~> 5.1)
21
+ tzinfo (~> 1.1)
22
+ addressable (2.6.0)
23
+ public_suffix (>= 2.0.2, < 4.0)
24
+ amq-protocol (2.3.0)
25
+ amqp (1.8.0)
26
+ amq-protocol (>= 2.2.0)
27
+ eventmachine
28
+ better-faraday (1.0.8)
29
+ activesupport (>= 4.0, < 6.0)
30
+ faraday (~> 0.12)
31
+ bunny (2.14.3)
32
+ amq-protocol (~> 2.3, >= 2.3.0)
33
+ byebug (11.0.1)
34
+ clamp (1.3.1)
35
+ coderay (1.1.2)
36
+ concurrent-ruby (1.1.5)
37
+ connection_pool (2.2.2)
38
+ crack (0.4.3)
39
+ safe_yaml (~> 1.0.0)
40
+ diff-lcs (1.3)
41
+ em-websocket (0.5.1)
42
+ eventmachine (>= 0.12.9)
43
+ http_parser.rb (~> 0.6.0)
44
+ eventmachine (1.2.7)
45
+ faraday (0.15.4)
46
+ multipart-post (>= 1.2, < 3)
47
+ hashdiff (0.3.9)
48
+ http_parser.rb (0.6.0)
49
+ i18n (1.7.0)
50
+ concurrent-ruby (~> 1.0)
51
+ jwt (2.2.1)
52
+ memoist (0.16.2)
53
+ metaclass (0.0.4)
54
+ method_source (0.9.2)
55
+ minitest (5.13.0)
56
+ mocha (1.8.0)
57
+ metaclass (~> 0.0.1)
58
+ multipart-post (2.1.1)
59
+ mysql2 (0.5.3)
60
+ net-http-persistent (3.0.1)
61
+ connection_pool (~> 2.2)
62
+ peatio (0.6.3)
63
+ activemodel (> 5.2, <= 6.0.0)
64
+ amqp
65
+ bunny
66
+ clamp
67
+ em-websocket
68
+ eventmachine
69
+ jwt
70
+ mysql2
71
+ pry (0.12.2)
72
+ coderay (~> 1.1.0)
73
+ method_source (~> 0.9.0)
74
+ pry-byebug (3.7.0)
75
+ byebug (~> 11.0)
76
+ pry (~> 0.10)
77
+ public_suffix (3.0.3)
78
+ rake (10.5.0)
79
+ rspec (3.8.0)
80
+ rspec-core (~> 3.8.0)
81
+ rspec-expectations (~> 3.8.0)
82
+ rspec-mocks (~> 3.8.0)
83
+ rspec-core (3.8.0)
84
+ rspec-support (~> 3.8.0)
85
+ rspec-expectations (3.8.2)
86
+ diff-lcs (>= 1.2.0, < 2.0)
87
+ rspec-support (~> 3.8.0)
88
+ rspec-mocks (3.8.0)
89
+ diff-lcs (>= 1.2.0, < 2.0)
90
+ rspec-support (~> 3.8.0)
91
+ rspec-support (3.8.0)
92
+ safe_yaml (1.0.5)
93
+ thread_safe (0.3.6)
94
+ tzinfo (1.2.5)
95
+ thread_safe (~> 0.1)
96
+ webmock (3.5.1)
97
+ addressable (>= 2.3.6)
98
+ crack (>= 0.3.2)
99
+ hashdiff
100
+
101
+ PLATFORMS
102
+ ruby
103
+
104
+ DEPENDENCIES
105
+ bundler (~> 1.16)
106
+ mocha (~> 1.8)
107
+ module-render-xyz!
108
+ pry-byebug
109
+ rake (~> 10.0)
110
+ rspec (~> 3.0)
111
+ webmock (~> 3.5)
112
+
113
+ BUNDLED WITH
114
+ 1.17.3
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Yaroslav Savchuk
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.
@@ -0,0 +1,108 @@
1
+ # Peatio::Infura
2
+
3
+ Peatio infura plugin for Openware stack
4
+
5
+ ## Create Gem
6
+
7
+ Clone this repository
8
+
9
+ git clone https://github.com/mycework/peatio-infura.git
10
+
11
+ Enter `peatio-infura` folder and build image
12
+
13
+ docker build -t sundanny26/ruby-infura .
14
+
15
+ Run container
16
+
17
+ docker run --name infura_container -d sundanny26/ruby-infura
18
+
19
+ Enter container
20
+
21
+ docker exec -it infura_container bash
22
+
23
+ Build GEM
24
+
25
+ gem build peatio-infura.gemspec
26
+
27
+ Test GEM
28
+
29
+
30
+ ./bin/setup
31
+ ./bin/console
32
+ client = Peatio::Infura::Client.new('https://rinkeby.infura.io/v3/b5d560f71a4341428acacd4a5b25a8a0','https://rinkeby.infura.io/v3/b5d560f71a4341428acacd4a5b25a8a0')
33
+ client.json_rpc(:eth_blockNumber)
34
+
35
+ Push GEM
36
+
37
+ gem push peatio-infura-0.1.0.gem
38
+
39
+
40
+ *others*
41
+ Delete accidentaly added rubygem *if the gem contains password, you should reset all passwords*
42
+
43
+ gem yank -v 0.1.0 peatio-infura
44
+
45
+
46
+ ## Installation
47
+
48
+ Add this line to your application's Gemfile:
49
+
50
+ ```ruby
51
+ gem 'peatio-infura'
52
+ ```
53
+
54
+ And then execute:
55
+
56
+ $ bundle
57
+
58
+ Or install it yourself as:
59
+
60
+ $ gem install peatio-infura
61
+
62
+ ## Usage
63
+
64
+ For Peatio Infura plugin integration you need to do the following steps:
65
+
66
+ ### Image Build.
67
+
68
+ 1. Add peatio-infura gem into your Gemfile.plugin
69
+ ```ruby
70
+ gem 'peatio-infura', '~> 0.2.0'
71
+ ```
72
+
73
+ 2. Run `bundle install` for updating Gemfile.lock
74
+
75
+ 3. Build custom Peatio [docker image with Infura plugin](https://github.com/rubykube/peatio/blob/master/docs/plugins.md#build)
76
+
77
+ 4. Push your image using `docker push`
78
+
79
+ 5. Update your deployment to use image with peatio-infura gem
80
+
81
+ ### Peatio Configuration.
82
+
83
+ 1. Create Infura Blockchain [config example](../config/blockchains.yml).
84
+ * No additional steps are needed
85
+
86
+ 2. Create Infura Currency [config example](../config/currencies.yml).
87
+ * No additional steps are needed
88
+
89
+ 3. Create Infura Wallets [config example](../config/wallets.yml)(deposit and hot wallets are required).
90
+ * No additional steps are needed
91
+
92
+
93
+ ## Development
94
+
95
+ Plugin development [example](https://github.com/rubykube/peatio/blob/master/docs/coins/development.md).
96
+
97
+ ## Contributing
98
+
99
+ Bug reports and pull requests are welcome on GitHub at https://github.com/rubykube/peatio-infura.
100
+
101
+ ## License
102
+
103
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
104
+
105
+ ## Consulting
106
+
107
+ You can contact Openware for finding certified vendors:
108
+ [Openware.com](https://www.openware.com)
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "peatio/infura"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -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
@@ -0,0 +1,10 @@
1
+ - key: eth-mainnet
2
+ name: Ethereum Mainnet
3
+ client: infura # API client name.
4
+ server: https://rinkeby.infura.io/v3/INFURA_KEY # Public Ethereum node endpoint. IMPORTANT: full syncmode.
5
+ height: 7500000 # Initial block number from which sync will be started.
6
+ min_confirmations: 6 # Minimal confirmations needed for withdraw and deposit confirmation.
7
+ explorer:
8
+ address: https://etherscan.io/address/#{address}
9
+ transaction: https://etherscan.io/tx/#{txid}
10
+ status: active
@@ -0,0 +1,20 @@
1
+ - id: eth
2
+ name: Ethereum
3
+ blockchain_key: eth-mainnet
4
+ symbol: 'Ξ'
5
+ type: coin
6
+ precision: 8
7
+ base_factor: 1_000_000_000_000_000_000
8
+ enabled: true
9
+ # Deposits with less amount are skipped during blockchain synchronization.
10
+ # We advise to set value 10 times bigger than the network fee to prevent losses.
11
+ min_deposit_amount: 0.00021
12
+ min_collection_amount: 0.00021
13
+ withdraw_limit_24h: 2.0
14
+ withdraw_limit_72h: 5.0
15
+ deposit_fee: 0
16
+ withdraw_fee: 0
17
+ position: 5
18
+ options:
19
+ gas_limit: 21_000
20
+ gas_price: 1_000_000_000
@@ -0,0 +1,47 @@
1
+ - name: Ethereum Deposit Wallet
2
+ blockchain_key: eth-mainnet
3
+ currency_id: eth
4
+ # Address where deposits will be collected to.
5
+ address: '0xd1bfc7daabbd6aa40a7a1a87464cc93882fa24cb' # IMPORTANT: Always wrap this value in quotes!
6
+ kind: deposit # Wallet kind (deposit, hot, warm, cold or fee).
7
+ nsig: 1 # Number of signatures required for performing withdraw.
8
+ max_balance: 0.0
9
+ status: active
10
+ gateway: infurad # Gateway client name.
11
+ settings:
12
+ #
13
+ # infurad gateway client settings.
14
+ uri: https://rinkeby.infura.io/v3/INFURA_KEY
15
+ sign_uri: http://infura:8545
16
+
17
+ - name: Ethereum Hot Wallet
18
+ blockchain_key: eth-mainnet
19
+ currency_id: eth
20
+ # Address where deposits will be collected to.
21
+ address: '0xd1bfc7daabbd6aa40a7a1a87464cc93882fa2401' # IMPORTANT: Always wrap this value in quotes!
22
+ kind: hot # Wallet kind (deposit, hot, warm, cold or fee).
23
+ nsig: 1 # Number of signatures required for performing withdraw.
24
+ max_balance: 5.0
25
+ status: active
26
+ gateway: infurad # Gateway client name.
27
+ settings:
28
+ #
29
+ # infurad gateway client settings.
30
+ uri: https://rinkeby.infura.io/v3/INFURA_KEY
31
+ sign_uri: http://infura:8545
32
+
33
+ - name: Ethereum Warm Wallet
34
+ blockchain_key: eth-mainnet
35
+ currency_id: eth
36
+ # Address where deposits will be collected to.
37
+ address: '0xd1bfc7daabbd6aa40a7a1a87464cc93882fa24545' # IMPORTANT: Always wrap this value in quotes!
38
+ kind: warm # Wallet kind (deposit, hot, warm, cold or fee).
39
+ nsig: 1 # Number of signatures required for performing withdraw.
40
+ max_balance: 50.0
41
+ status: active
42
+ gateway: infurad # Gateway client name.
43
+ settings:
44
+ #
45
+ # infurad gateway client settings.
46
+ uri: https://rinkeby.infura.io/v3/INFURA_KEY
47
+ sign_uri: http://infura:8545
@@ -0,0 +1,29 @@
1
+ # Integration.
2
+
3
+ For Peatio Infura plugin integration you need to do the following steps:
4
+
5
+ ## Image Build.
6
+
7
+ 1. Add peatio-infura gem into your Gemfile.plugin
8
+ ```ruby
9
+ gem 'peatio-infura', '~> 0.1.0'
10
+ ```
11
+
12
+ 2. Run `bundle install` for updating Gemfile.lock
13
+
14
+ 3. Build custom Peatio [docker image with Infura plugin](https://github.com/rubykube/peatio/blob/master/docs/plugins.md#build)
15
+
16
+ 4. Push your image using `docker push`
17
+
18
+ 5. Update your deployment to use image with peatio-infura gem
19
+
20
+ ## Peatio Configuration.
21
+
22
+ 1. Create Infura Blockchain [config example](../config/blockchains.yml).
23
+ * No additional steps are needed
24
+
25
+ 2. Create Infura Currency [config example](../config/currencies.yml).
26
+ * No additional steps are needed
27
+
28
+ 3. Create Infura Wallets [config example](../config/wallets.yml)(deposit and hot wallets are required).
29
+ * No additional steps are needed
@@ -0,0 +1,29 @@
1
+ # JSON RPC
2
+
3
+ The next list of JSON RPC calls where used for plugin development.
4
+ For response examples see spec/resources:
5
+
6
+ * getbalance
7
+
8
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": [] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`
9
+ * getblock
10
+
11
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["5a471d4fd13d8bc3351e4d3a618fa55993326014b925346d8e9272e271e97c4e", 2] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`
12
+ * getblockcount
13
+
14
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`
15
+ * getblockhash
16
+
17
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [40500] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332 `
18
+ * getnewaddress
19
+
20
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332 `
21
+ * listaddressgroupings
22
+
23
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaddressgroupings", "params": [] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`
24
+ * sendtoaddress
25
+
26
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["QRnrwkUBQ2E4ZJ3bj8jvn4Nwx4nJ2U7wXF", 0.11] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`
27
+ * methodnotfound
28
+
29
+ `curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "methodnotfound", "params": [] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:19332`