glueby 0.4.3 → 0.4.4
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.
- checksums.yaml +4 -4
- data/README.md +387 -387
- data/glueby.gemspec +33 -33
- data/lib/generators/glueby/contract/templates/initializer.rb.erb +8 -8
- data/lib/generators/glueby/contract/templates/key_table.rb.erb +16 -16
- data/lib/generators/glueby/contract/templates/utxo_table.rb.erb +16 -16
- data/lib/glueby/block_syncer.rb +97 -97
- data/lib/glueby/contract/timestamp/syncer.rb +13 -13
- data/lib/glueby/contract/timestamp.rb +102 -102
- data/lib/glueby/contract/token.rb +244 -244
- data/lib/glueby/fee_provider/tasks.rb +140 -140
- data/lib/glueby/internal/wallet/abstract_wallet_adapter.rb +151 -149
- data/lib/glueby/internal/wallet/active_record/utxo.rb +51 -51
- data/lib/glueby/internal/wallet/active_record_wallet_adapter/syncer.rb +13 -13
- data/lib/glueby/internal/wallet/active_record_wallet_adapter.rb +151 -150
- data/lib/glueby/internal/wallet/tapyrus_core_wallet_adapter.rb +186 -186
- data/lib/glueby/internal/wallet.rb +162 -165
- data/lib/glueby/railtie.rb +9 -9
- data/lib/glueby/version.rb +3 -3
- data/lib/glueby.rb +39 -39
- data/lib/tasks/glueby/block_syncer.rake +28 -28
- data/lib/tasks/glueby/contract/timestamp.rake +39 -39
- data/lib/tasks/glueby/fee_provider.rake +18 -18
- metadata +2 -2
@@ -1,40 +1,40 @@
|
|
1
|
-
module Glueby
|
2
|
-
module Contract
|
3
|
-
module Task
|
4
|
-
module Timestamp
|
5
|
-
module_function
|
6
|
-
extend Glueby::Contract::TxBuilder
|
7
|
-
extend Glueby::Contract::Timestamp::Util
|
8
|
-
|
9
|
-
def create
|
10
|
-
timestamps = Glueby::Contract::AR::Timestamp.where(status: :init)
|
11
|
-
timestamps.each do |t|
|
12
|
-
begin
|
13
|
-
::ActiveRecord::Base.transaction do
|
14
|
-
wallet = Glueby::Wallet.load(t.wallet_id)
|
15
|
-
tx = create_tx(wallet, t.prefix, t.content_hash, Glueby::Contract::FixedFeeEstimator.new)
|
16
|
-
wallet.internal_wallet.broadcast(tx) do |tx|
|
17
|
-
t.update(txid: tx.txid, status: :unconfirmed)
|
18
|
-
end
|
19
|
-
puts "broadcasted (id=#{t.id}, txid=#{tx.txid})"
|
20
|
-
end
|
21
|
-
rescue => e
|
22
|
-
puts "failed to broadcast (id=#{t.id}, reason=#{e.message})"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
namespace :glueby do
|
32
|
-
namespace :contract do
|
33
|
-
namespace :timestamp do
|
34
|
-
desc 'create and broadcast glueby timestamp tx'
|
35
|
-
task :create, [] => [:environment] do |_, _|
|
36
|
-
Glueby::Contract::Task::Timestamp.create
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
module Glueby
|
2
|
+
module Contract
|
3
|
+
module Task
|
4
|
+
module Timestamp
|
5
|
+
module_function
|
6
|
+
extend Glueby::Contract::TxBuilder
|
7
|
+
extend Glueby::Contract::Timestamp::Util
|
8
|
+
|
9
|
+
def create
|
10
|
+
timestamps = Glueby::Contract::AR::Timestamp.where(status: :init)
|
11
|
+
timestamps.each do |t|
|
12
|
+
begin
|
13
|
+
::ActiveRecord::Base.transaction do
|
14
|
+
wallet = Glueby::Wallet.load(t.wallet_id)
|
15
|
+
tx = create_tx(wallet, t.prefix, t.content_hash, Glueby::Contract::FixedFeeEstimator.new)
|
16
|
+
wallet.internal_wallet.broadcast(tx) do |tx|
|
17
|
+
t.update(txid: tx.txid, status: :unconfirmed)
|
18
|
+
end
|
19
|
+
puts "broadcasted (id=#{t.id}, txid=#{tx.txid})"
|
20
|
+
end
|
21
|
+
rescue => e
|
22
|
+
puts "failed to broadcast (id=#{t.id}, reason=#{e.message})"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
namespace :glueby do
|
32
|
+
namespace :contract do
|
33
|
+
namespace :timestamp do
|
34
|
+
desc 'create and broadcast glueby timestamp tx'
|
35
|
+
task :create, [] => [:environment] do |_, _|
|
36
|
+
Glueby::Contract::Task::Timestamp.create
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
40
|
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
namespace :glueby do
|
2
|
-
namespace :fee_provider do
|
3
|
-
desc 'Manage the UTXO pool in Glueby::FeeProvider. Creates outputs for paying fee if the outputs is less than configured pool size by :utxo_pool_size'
|
4
|
-
task :manage_utxo_pool, [] => [:environment] do |_, _|
|
5
|
-
Glueby::FeeProvider::Tasks.new.manage_utxo_pool
|
6
|
-
end
|
7
|
-
|
8
|
-
desc 'Show the status of the UTXO pool in Glueby::FeeProvider'
|
9
|
-
task :status, [] => [:environment] do |_, _|
|
10
|
-
Glueby::FeeProvider::Tasks.new.status
|
11
|
-
end
|
12
|
-
|
13
|
-
desc 'Show the address of the Glueby::FeeProvider'
|
14
|
-
task :address, [] => [:environment] do |_, _|
|
15
|
-
Glueby::FeeProvider::Tasks.new.address
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
namespace :glueby do
|
2
|
+
namespace :fee_provider do
|
3
|
+
desc 'Manage the UTXO pool in Glueby::FeeProvider. Creates outputs for paying fee if the outputs is less than configured pool size by :utxo_pool_size'
|
4
|
+
task :manage_utxo_pool, [] => [:environment] do |_, _|
|
5
|
+
Glueby::FeeProvider::Tasks.new.manage_utxo_pool
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'Show the status of the UTXO pool in Glueby::FeeProvider'
|
9
|
+
task :status, [] => [:environment] do |_, _|
|
10
|
+
Glueby::FeeProvider::Tasks.new.status
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'Show the address of the Glueby::FeeProvider'
|
14
|
+
task :address, [] => [:environment] do |_, _|
|
15
|
+
Glueby::FeeProvider::Tasks.new.address
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glueby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tapyrus
|