tapyrus 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +12 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +100 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/tapyrusrb-cli +5 -0
- data/exe/tapyrusrbd +41 -0
- data/lib/openassets/marker_output.rb +20 -0
- data/lib/openassets/payload.rb +54 -0
- data/lib/openassets/util.rb +28 -0
- data/lib/openassets.rb +9 -0
- data/lib/tapyrus/base58.rb +38 -0
- data/lib/tapyrus/block.rb +77 -0
- data/lib/tapyrus/block_header.rb +88 -0
- data/lib/tapyrus/bloom_filter.rb +78 -0
- data/lib/tapyrus/chain_params.rb +90 -0
- data/lib/tapyrus/chainparams/mainnet.yml +41 -0
- data/lib/tapyrus/chainparams/regtest.yml +38 -0
- data/lib/tapyrus/chainparams/testnet.yml +41 -0
- data/lib/tapyrus/constants.rb +195 -0
- data/lib/tapyrus/descriptor.rb +147 -0
- data/lib/tapyrus/ext_key.rb +337 -0
- data/lib/tapyrus/key.rb +296 -0
- data/lib/tapyrus/key_path.rb +26 -0
- data/lib/tapyrus/logger.rb +42 -0
- data/lib/tapyrus/merkle_tree.rb +149 -0
- data/lib/tapyrus/message/addr.rb +35 -0
- data/lib/tapyrus/message/base.rb +28 -0
- data/lib/tapyrus/message/block.rb +46 -0
- data/lib/tapyrus/message/block_transaction_request.rb +45 -0
- data/lib/tapyrus/message/block_transactions.rb +31 -0
- data/lib/tapyrus/message/block_txn.rb +27 -0
- data/lib/tapyrus/message/cmpct_block.rb +42 -0
- data/lib/tapyrus/message/error.rb +10 -0
- data/lib/tapyrus/message/fee_filter.rb +27 -0
- data/lib/tapyrus/message/filter_add.rb +28 -0
- data/lib/tapyrus/message/filter_clear.rb +17 -0
- data/lib/tapyrus/message/filter_load.rb +39 -0
- data/lib/tapyrus/message/get_addr.rb +17 -0
- data/lib/tapyrus/message/get_block_txn.rb +27 -0
- data/lib/tapyrus/message/get_blocks.rb +29 -0
- data/lib/tapyrus/message/get_data.rb +21 -0
- data/lib/tapyrus/message/get_headers.rb +28 -0
- data/lib/tapyrus/message/header_and_short_ids.rb +57 -0
- data/lib/tapyrus/message/headers.rb +35 -0
- data/lib/tapyrus/message/headers_parser.rb +24 -0
- data/lib/tapyrus/message/inv.rb +21 -0
- data/lib/tapyrus/message/inventories_parser.rb +23 -0
- data/lib/tapyrus/message/inventory.rb +51 -0
- data/lib/tapyrus/message/mem_pool.rb +17 -0
- data/lib/tapyrus/message/merkle_block.rb +42 -0
- data/lib/tapyrus/message/network_addr.rb +63 -0
- data/lib/tapyrus/message/not_found.rb +21 -0
- data/lib/tapyrus/message/ping.rb +30 -0
- data/lib/tapyrus/message/pong.rb +26 -0
- data/lib/tapyrus/message/prefilled_tx.rb +29 -0
- data/lib/tapyrus/message/reject.rb +46 -0
- data/lib/tapyrus/message/send_cmpct.rb +43 -0
- data/lib/tapyrus/message/send_headers.rb +16 -0
- data/lib/tapyrus/message/tx.rb +30 -0
- data/lib/tapyrus/message/ver_ack.rb +17 -0
- data/lib/tapyrus/message/version.rb +69 -0
- data/lib/tapyrus/message.rb +70 -0
- data/lib/tapyrus/mnemonic/wordlist/chinese_simplified.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/chinese_traditional.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/english.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/french.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/italian.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/japanese.txt +2048 -0
- data/lib/tapyrus/mnemonic/wordlist/spanish.txt +2048 -0
- data/lib/tapyrus/mnemonic.rb +77 -0
- data/lib/tapyrus/network/connection.rb +73 -0
- data/lib/tapyrus/network/message_handler.rb +241 -0
- data/lib/tapyrus/network/peer.rb +223 -0
- data/lib/tapyrus/network/peer_discovery.rb +42 -0
- data/lib/tapyrus/network/pool.rb +135 -0
- data/lib/tapyrus/network.rb +13 -0
- data/lib/tapyrus/node/cli.rb +112 -0
- data/lib/tapyrus/node/configuration.rb +38 -0
- data/lib/tapyrus/node/spv.rb +79 -0
- data/lib/tapyrus/node.rb +7 -0
- data/lib/tapyrus/opcodes.rb +178 -0
- data/lib/tapyrus/out_point.rb +44 -0
- data/lib/tapyrus/rpc/http_server.rb +65 -0
- data/lib/tapyrus/rpc/request_handler.rb +150 -0
- data/lib/tapyrus/rpc/tapyrus_core_client.rb +72 -0
- data/lib/tapyrus/rpc.rb +7 -0
- data/lib/tapyrus/script/multisig.rb +92 -0
- data/lib/tapyrus/script/script.rb +551 -0
- data/lib/tapyrus/script/script_error.rb +111 -0
- data/lib/tapyrus/script/script_interpreter.rb +668 -0
- data/lib/tapyrus/script/tx_checker.rb +81 -0
- data/lib/tapyrus/script_witness.rb +38 -0
- data/lib/tapyrus/secp256k1/native.rb +174 -0
- data/lib/tapyrus/secp256k1/ruby.rb +123 -0
- data/lib/tapyrus/secp256k1.rb +12 -0
- data/lib/tapyrus/slip39/share.rb +122 -0
- data/lib/tapyrus/slip39/sss.rb +245 -0
- data/lib/tapyrus/slip39/wordlist/english.txt +1024 -0
- data/lib/tapyrus/slip39.rb +93 -0
- data/lib/tapyrus/store/chain_entry.rb +67 -0
- data/lib/tapyrus/store/db/level_db.rb +98 -0
- data/lib/tapyrus/store/db.rb +9 -0
- data/lib/tapyrus/store/spv_chain.rb +101 -0
- data/lib/tapyrus/store.rb +9 -0
- data/lib/tapyrus/tx.rb +347 -0
- data/lib/tapyrus/tx_in.rb +89 -0
- data/lib/tapyrus/tx_out.rb +74 -0
- data/lib/tapyrus/util.rb +133 -0
- data/lib/tapyrus/validation.rb +115 -0
- data/lib/tapyrus/version.rb +3 -0
- data/lib/tapyrus/wallet/account.rb +151 -0
- data/lib/tapyrus/wallet/base.rb +162 -0
- data/lib/tapyrus/wallet/db.rb +81 -0
- data/lib/tapyrus/wallet/master_key.rb +110 -0
- data/lib/tapyrus/wallet.rb +8 -0
- data/lib/tapyrus.rb +219 -0
- data/tapyrusrb.conf.sample +0 -0
- data/tapyrusrb.gemspec +47 -0
- metadata +451 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
module Tapyrus
|
2
|
+
module Message
|
3
|
+
|
4
|
+
autoload :Base, 'tapyrus/message/base'
|
5
|
+
autoload :Inventory, 'tapyrus/message/inventory'
|
6
|
+
autoload :InventoriesParser, 'tapyrus/message/inventories_parser'
|
7
|
+
autoload :HeadersParser, 'tapyrus/message/headers_parser'
|
8
|
+
autoload :Version, 'tapyrus/message/version'
|
9
|
+
autoload :VerAck, 'tapyrus/message/ver_ack'
|
10
|
+
autoload :Addr, 'tapyrus/message/addr'
|
11
|
+
autoload :NetworkAddr, 'tapyrus/message/network_addr'
|
12
|
+
autoload :Block, 'tapyrus/message/block'
|
13
|
+
autoload :FilterLoad, 'tapyrus/message/filter_load'
|
14
|
+
autoload :FilterAdd, 'tapyrus/message/filter_add'
|
15
|
+
autoload :FilterClear, 'tapyrus/message/filter_clear'
|
16
|
+
autoload :MerkleBlock, 'tapyrus/message/merkle_block'
|
17
|
+
autoload :Tx, 'tapyrus/message/tx'
|
18
|
+
autoload :Ping, 'tapyrus/message/ping'
|
19
|
+
autoload :Pong, 'tapyrus/message/pong'
|
20
|
+
autoload :Inv, 'tapyrus/message/inv'
|
21
|
+
autoload :GetBlocks, 'tapyrus/message/get_blocks'
|
22
|
+
autoload :GetHeaders, 'tapyrus/message/get_headers'
|
23
|
+
autoload :Headers, 'tapyrus/message/headers'
|
24
|
+
autoload :GetAddr, 'tapyrus/message/get_addr'
|
25
|
+
autoload :GetData, 'tapyrus/message/get_data'
|
26
|
+
autoload :SendHeaders, 'tapyrus/message/send_headers'
|
27
|
+
autoload :FeeFilter, 'tapyrus/message/fee_filter'
|
28
|
+
autoload :MemPool, 'tapyrus/message/mem_pool'
|
29
|
+
autoload :NotFound, 'tapyrus/message/not_found'
|
30
|
+
autoload :Error, 'tapyrus/message/error'
|
31
|
+
autoload :Reject, 'tapyrus/message/reject'
|
32
|
+
autoload :SendCmpct, 'tapyrus/message/send_cmpct'
|
33
|
+
autoload :CmpctBlock, 'tapyrus/message/cmpct_block'
|
34
|
+
autoload :HeaderAndShortIDs, 'tapyrus/message/header_and_short_ids'
|
35
|
+
autoload :PrefilledTx, 'tapyrus/message/prefilled_tx'
|
36
|
+
autoload :GetBlockTxn, 'tapyrus/message/get_block_txn'
|
37
|
+
autoload :BlockTransactionRequest, 'tapyrus/message/block_transaction_request'
|
38
|
+
autoload :BlockTxn, 'tapyrus/message/block_txn'
|
39
|
+
autoload :BlockTransactions, 'tapyrus/message/block_transactions'
|
40
|
+
|
41
|
+
USER_AGENT = "/tapyrusrb:#{Tapyrus::VERSION}/"
|
42
|
+
|
43
|
+
SERVICE_FLAGS = {
|
44
|
+
none: 0,
|
45
|
+
network: 1 << 0, # the node is capable of serving the block chain. It is currently set by all Bitcoin Core node, and is unset by SPV clients or other peers that just want network services but don't provide them.
|
46
|
+
# getutxo: 1 << 1, # BIP-64. not implemented in Bitcoin Core.
|
47
|
+
bloom: 1 << 2, # the node is capable and willing to handle bloom-filtered connections. Bitcoin Core node used to support this by default, without advertising this bit, but no longer do as of protocol version 70011 (= NO_BLOOM_VERSION)
|
48
|
+
witness: 1 << 3, # the node can be asked for blocks and transactions including witness data.
|
49
|
+
# xthin: 1 << 4 # support Xtreme Thinblocks. not implemented in Bitcoin Core
|
50
|
+
}
|
51
|
+
|
52
|
+
# DEFAULT_SERVICE_FLAGS = SERVICE_FLAGS[:network] | SERVICE_FLAGS[:bloom] | SERVICE_FLAGS[:witness]
|
53
|
+
|
54
|
+
DEFAULT_SERVICE_FLAGS = SERVICE_FLAGS[:none] | SERVICE_FLAGS[:witness]
|
55
|
+
|
56
|
+
DEFAULT_STOP_HASH = "00"*32
|
57
|
+
|
58
|
+
# the protocol version.
|
59
|
+
VERSION = {
|
60
|
+
headers: 31800,
|
61
|
+
pong: 60001,
|
62
|
+
bloom: 70011,
|
63
|
+
send_headers: 70012,
|
64
|
+
fee_filter: 70013,
|
65
|
+
compact: 70014,
|
66
|
+
compact_witness: 70015
|
67
|
+
}
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|