Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omni layer - how to parse it? #197

Closed
allenday opened this issue Nov 5, 2018 · 1 comment
Closed

omni layer - how to parse it? #197

allenday opened this issue Nov 5, 2018 · 1 comment
Labels
question Question related to using BlockSci

Comments

@allenday
Copy link

allenday commented Nov 5, 2018

It seems to be the bitcoin chain synchronized by the omni-core client, but I want to access the omni layer data instead of the bitcoin data. How can I do this?

I tried and failed as follows:

blocksci_parser /data/omni.cfg update

Error while interacting with RPC: std::exception
terminate called after throwing an instance of 'BitcoinException'
  what():  std::exception

Here's the config file:

{
    "chainConfig": {
        "coinName": "custom",
        "dataDirectory": "/data/omni-parser",
        "pubkeyPrefix": [],
        "scriptPrefix": [],
        "segwitActivationHeight": 0,
        "segwitPrefix": ""
    },
    "parser": {
        "maxBlockNum": -6,
        "rpc": {
            "address": "10.1.1.6",
            "password": "y",
            "port": 3389,
            "username": "x"
        }
    },
    "version": 5
}
@hkalodner
Copy link
Collaborator

Since BlockSci only handles layer 1 parsing, it can't really do much directly with Omni Layer, although it should be totally possible to write code in BlockSci to parse out the Omni related txes.

Using the v0.6 interface you can do some simple data parsing with

omni_addresses = chain.addresses(blocksci.address_type.nulldata).where(lambda opreturn: opreturn.data.startswith(b'omni'))
omni = [x[4:] for x in omni_addresses.data]
version_and_type = [(int.from_bytes(x[:2], byteorder='big'), int.from_bytes(x[2:4], byteorder='big')) for x in omni]
common = Counter(version_and_type).most_common()

Which shows that there are 3416671 simple sends.

This method only turns up Omni Layer transactions which use Op return storage so it ignores the pubkey and multig formats which I haven't dug into. It's certainly easy to get all transactions including an output sent to the exodus address using:

chain.address_from_string("1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P").out_txes.to_list()

@hkalodner hkalodner added the question Question related to using BlockSci label Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question related to using BlockSci
Projects
None yet
Development

No branches or pull requests

3 participants