Libra rocksdb sample

Hi there, is there anywhere a rocksdb sample d b for transactions, events, etc. with enough data to start exploring it?

I have run my first transactions according to intro file but I don’t find any corresponding .sst file on my machine.

Thanks. Didier

Hi @didier.durand! If you ran first transactions like what is described in https://developers.libra.org/docs/my-first-transaction, the RocksDB files are on the server we set up for testnet and you don’t have access to these servers.

To explore the DBs, you can run some validator nodes locally. You can find some instructions at https://developers.libra.org/docs/my-first-transaction#run-a-local-validator-node. Once you start some nodes on your machine you can find https://github.com/libra/libra/blob/737839b744794c0ca3be3db2934de7ebf056639a/storage/libradb/src/lib.rs#L116-L120 in the logs. Then you should be able to find the RocksDB files. You can then submit transactions to your local node. Feel free to let us know if you have questions regarding running nodes locally.

1 Like

Thanks, I’ll do that and come back if I have issues when running validator. Didier

@wqfish i followed your steps, the rock db files are supposed to be in the libradb folder in tmp?

@dino yeah i think so. just tried it

cargo run -p libra-swarm -- -n 4                                                                        ✔
    Finished dev [unoptimized + debuginfo] target(s) in 0.49s
     Running `target/debug/libra-swarm -n 4`
INFO 2020-03-25 17:57:42 libra-swarm/src/swarm.rs:302 logs at Temporary(TempPath { path_buf: "/var/folders/n9/0bc3c9y54vg83rwfd7gyz6s40000gn/T/534dfc6d4f8e9f1e0a33f3c606003da2", persist: false })
INFO 2020-03-25 17:57:42 common/workspace-builder/src/lib.rs:16 Building project binaries
INFO 2020-03-25 18:02:19 common/workspace-builder/src/lib.rs:29 Finished building project binaries
INFO 2020-03-25 18:02:34 libra-swarm/src/swarm.rs:366 Successfully launched Swarm
To run the Libra CLI client in a separate process and connect to the validator nodes you just spawned, use this command:
        cargo run --bin cli -- -u http://localhost:59148 -m "/var/folders/n9/0bc3c9y54vg83rwfd7gyz6s40000gn/T/534dfc6d4f8e9f1e0a33f3c606003da2/mint.key"
To run transaction generator run:
        cargo run -p cluster-test -- --mint-file "/var/folders/n9/0bc3c9y54vg83rwfd7gyz6s40000gn/T/534dfc6d4f8e9f1e0a33f3c606003da2/mint.key" --swarm --peers "localhost:59148,localhost:59162,localhost:59176,localhost:59190" --emit-tx --workers-per-ac 1
CTRL-C to exit.

In another terminal:

ls -lh /var/folders/n9/0bc3c9y54vg83rwfd7gyz6s40000gn/T/534dfc6d4f8e9f1e0a33f3c606003da2/0/libradb/db/libradb                                                                                                                                                        ✔
total 4472
-rw-r--r--  1 wqfish  staff   1.1M Mar 25 11:03 000003.log
-rw-r--r--  1 wqfish  staff    16B Mar 25 11:02 CURRENT
-rw-r--r--  1 wqfish  staff    33B Mar 25 11:02 IDENTITY
-rw-r--r--  1 wqfish  staff     0B Mar 25 11:02 LOCK
-rw-r--r--  1 wqfish  staff    92K Mar 25 11:02 LOG
-rw-r--r--  1 wqfish  staff    13B Mar 25 11:02 MANIFEST-000001
-rw-r--r--  1 wqfish  staff   738B Mar 25 11:02 MANIFEST-000006
-rw-r--r--  1 wqfish  staff    33K Mar 25 11:02 OPTIONS-000026
-rw-r--r--  1 wqfish  staff    36K Mar 25 11:02 OPTIONS-000028
2 Likes