Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: In 8586246881e8ff226a252abcee7447c2ad3905d0 it was changed and we don't have to replace "some-host" to "localhost" anymore

...

docker run \
    -it \
    --workdir /home \
    --name='ubuntu_test' \
    --network=host \
    ubuntu:22.04

Where:

  • -it  - to run image with interactive console (input && output)
  • --workdir /home  - is to set current directory in the docker instance
  • --name='ubuntu_test'  - instance name
  • --network=host - it is option to make possible easy communication between host and guest inside machine (like virtuall another computer in local network)
  • ubuntu:22.04  - image from docker-hub "ubuntu" version "22.04"

...


In the official Iroha repository You have sample configuration files, You can use them to run a node (here is: documentation of command line arguments). I suggest to read description below before running the command:


 irohad./build/bin/irohad \
    --config $PWD/homeexample/config/config.docker \
       --keypair_name $PWD/home/keysexample/node0 \
       -genesis_block $PWD/home/configexample/genesis.block \
       -reuse_state
    #-overwrite_ledger -drop_state

Where:

  • --config  - path to config file, in the config postgres is choosen, so it must be running
  • --keypair_name  - path to private and public keys of a the node
  • -genesis_block  - path to genesis block (first block of network)
  • -reuse_state  - not create network from beginning but use existing
  • -overwrite_ledger -drop_state  - DANGEROUS - it will erase the network (both database and files)

To run irohad  with configuration arguments as above You need first to change something in config file or change config + have working postgres DB.

A) Using Iroha with postgres db:

I suggest to use docker instance. To create instance with user&&password compatible with sample config you need command (it needs to be run in host):


docker run --name postgres_tmp \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_PASSWORD=mysecretpassword \
    --network=host \
    -d postgres \
    -c 'max_prepared_transactions=100' \
    -c 'port=5432'

Then you can just run irohad  command.

B) Using Iroha with RocksDB:

Instead of postgres you can use RocksDB. In example  directory there is sample config, which is using RocksDB, but path to database must be changed, e.g.:

sed -i 's_/path/to/wsv/folder_/home/rocksdb_g' example/config.sample

The next step is to use that config when running irohad:

./build/bin/irohad \
     --config $PWD/example/config.sample \
     --keypair_name $PWD/example/node0 \
     -genesis_block $PWD/example/genesis.block \
     -reuse_state