Giter VIP home page Giter VIP logo

nigiri's Issues

Integration tests and CI

Add a docker based CI pipeline to build the cli, pull the images and test the command against to it.

test the basic commands for all interfaces of services (REST, chopstick, electrum rpc, bitcoin rpc, liquid rpc)

electrs crashes

electrs.tar.gz
The archive contains the electrs w/ liquid build of the last new-index branch of Blockstream/electrs.
This version creashes when mining a block giving me the error:

Config { log: StdErrLog { verbosity: Trace, quiet: false, timestamp: Off, modules: [], writer: "stderr", color_choice: Auto }, network_type: LiquidRegtest, db_path: "./db/liquidregtest", daemon_dir: "/config/liquidregtest", daemon_rpc_addr: V4(10.10.0.11:18884), cookie: Some("admin1:123"), electrum_rpc_addr: V4(127.0.0.1:51401), http_addr: V4(0.0.0.0:3002), monitoring_addr: V4(127.0.0.1:44224), jsonrpc_import: false, index_batch_size: 100, bulk_index_threads: 2, tx_cache_size: 10000, prevout_enabled: true, cors: None, precache_scripts: None, parent_network: Bitcoin, parent_genesis_hash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" }
DEBUG - Server listening on 127.0.0.1:44224
WARN - reconnecting to bitcoind: {"code":-28,"message":"Verifying wallet..."}
DEBUG - Running accept thread
WARN - reconnecting to bitcoind: {"code":-28,"message":"Loading wallet..."}
INFO - NetworkInfo { version: 3140123, subversion: "/Liquid:3.14.1.23/" }
INFO - BlockchainInfo { chain: "liquidregtest", blocks: 0, headers: 0, bestblockhash: "1dfe15bb36db2806449fd64f601a8b04fd00af800bfe6be5daf2d8ac9bf0bf09", pruned: false, verificationprogress: 0.0, initialblockdownload: Some(true) }
DEBUG - opening DB at "./db/liquidregtest/newindex/txstore"
DEBUG - 0 blocks were added
DEBUG - opening DB at "./db/liquidregtest/newindex/history"
DEBUG - 0 blocks were indexed
DEBUG - 0 headers were loaded
DEBUG - opening DB at "./db/liquidregtest/newindex/cache"
DEBUG - downloading all block headers up to 846821dad2619b851afe9fdfbc314999853a2f1bc4a41073b7def42e02028902
TRACE - downloading 2 block headers
INFO - best=846821dad2619b851afe9fdfbc314999853a2f1bc4a41073b7def42e02028902 height=1 @ 2019-04-08T17:39:48Z (2 left to process)
DEBUG - adding transactions from 2 blocks using BlkFiles
DEBUG - listing block files at "/config/liquidregtest/blocks/blk*.dat"
TRACE - reading "/config/liquidregtest/blocks/blk00000.dat"
TRACE - parsing 16777216 bytes
TRACE - fetched 2 blocks
DEBUG - writing 114 rows to RocksDB { path: "./db/liquidregtest/newindex/txstore" }, flush=Disable
DEBUG - starting full compaction on RocksDB { path: "./db/liquidregtest/newindex/txstore" }
DEBUG - finished full compaction on RocksDB { path: "./db/liquidregtest/newindex/txstore" }
DEBUG - indexing history from 2 blocks using BlkFiles
DEBUG - listing block files at "/config/liquidregtest/blocks/blk*.dat"
TRACE - reading "/config/liquidregtest/blocks/blk00000.dat"
TRACE - parsing 16777216 bytes
TRACE - fetched 2 blocks
thread 'lookup-txo-12' panicked at 'missing txo [elements]50cdc410c9d0d61eeacc531f52d2c70af741da33af127c364e52ac1ee7c030a5:0 in DB { db: RocksDB { path: "./db/liquidregtest/newindex/txstore" } }', src/new_index/schema.rs:781:29

I can reproduce this error by editing the existing docker-compose-regtest-liquid.yml as:

version: '3'
services:
  bitcoin:
    image: vulpemventures/bitcoin:latest
    networks:
      local:
        ipv4_address: 10.10.0.10
    volumes:
      - ./volumes/liquidregtest/config/:/config
    ports:
      - 19001:19001
  liquid:
    image: vulpemventures/liquid:latest
    networks:
      local:
        ipv4_address: 10.10.0.11
    volumes:
      - ./volumes/liquidregtest/liquid-config/:/config
    ports:
      - 18884:18884
  # electrs:
  #   image: vulpemventures/electrs:latest
  #   entrypoint:
  #     - /build/electrs
  #   command:
  #     - -vvvv
  #     - --network
  #     - regtest
  #     - --daemon-dir
  #     - /config
  #     - --daemon-rpc-addr
  #     - 10.10.0.10:19001
  #     - --cookie
  #     - admin1:123
  #     - --http-addr
  #     - 0.0.0.0:3002
  #   networks:
  #     local:
  #       ipv4_address: 10.10.0.12
  #   ports:
  #     - 3002:3002
  #   volumes:
  #     - ./volumes/liquidregtest/config/:/config
  electrs-liquid:
    # instead of using
    # image: vulpemventures/electrs-liquid:latest
    build:
      context: electrs
      dockerfile: Dockerfile
    networks:
      local:
        ipv4_address: 10.10.0.13
    entrypoint:
      - /build/electrs
    command:
      - -vvvv
      - --network
      - liquidregtest
      - --daemon-dir
      - /config
      - --daemon-rpc-addr
      - 10.10.0.11:18884
      - --cookie
      - admin1:123
      - --http-addr
      - 0.0.0.0:3002
    volumes:
      - ./volumes/liquidregtest/liquid-config/:/config
    ports:
      - 3002:3002
  # chopsticks:
  # 	build:
  # 		context: chopsticks/
  #		dockerfile: Dockerfile
  # 	ports:
  # 		- 3000:3000
  # 	networks:
  # 		local:
  # 			ipv4_address: 10.10.0.13

networks:
  local:
    driver: bridge
    ipam:
      config:
        - subnet: 10.10.0.0/24

Create a directory electrs/ in the same folder where you have the YAML (default ~/.nigiri) and place the binary above with this minimal Dockerfile:

FROM ubuntu:18.04

WORKDIR /build

ADD electrs .

EXPOSE 3002

ENTRYPOINT ["/build/electrs"]

simple CLI that wraps current bash scripts

Would be nice instead of cloning manually and launch scripts, to create simple command line interface that wraps current bash scripts. Since the repo will be public, it's ok to download the current repo

nigiri-cli start --network regtest --chain `all|bitcoin|liquid`
nigiri-cli stop 
nigiri-cli clean  

create will be done automatically by cli if not already done, as well some cleaning on stop could be done (not destroying the image ofc)

Add Liquid.Coach

It would be very helpful for Liquid Developers to have a service like Liquid.Coach spun up in the box.

This means:

  1. Dockerize the orginal web application
  2. Create a travis pipeline that pushes to Docker Hub (look to the nigiri chopsticks one)
  3. Add it to the docker compose of Liquid
  4. expose a free port for it.

Add Lightning Network

The ideal high-level flow should be the same as the liquid one, passing the optional flag -ln or --lightning

Being the network regtest where we are focusing on, we need at least two different wallets in order to open channels and use for local development. We can use both c-lightning and lnd so in this way we can cross-test the two main implementations.

Drop link directive in compose

depends_on directive is enough to make each container reachable in the same local network, and also link is deprecated.

What to do?
Remove the link directive in each service in the docker-compose-regtest.yml and docker-compose-regtest-liquid.yml

Travis yaml

Create an additional pipeline using free Travis service

nigiri create - resources/docker-compose-regtest.yml is not created

After installing and building with the last master I have on create command:

โžœ  nigiri git:(master) build/nigiri-darwin-amd64 create
ERROR: .FileNotFoundError: [Errno 2] No such file or directory: '/Users/tiero/.nigiri/resources/docker-compose-regtest.yml'
FATA[0000] An error occured while composing Docker environment  error="exit status 1"

If I open '/Users/tiero/.nigiri/ I found ONLY a nigiri.config.json and not a resources folder. How someone is supposed to develop without having to download the binaries to get conf files?
I think yamls and .conf should be present both as a source in the git commit and in the binaries.

Use Nigiri in Travis or other CI pipelines

This would be a nice to be served as nigiri start --ci --liquid in order to pull an optimized version of nigiri for continuous integration pipelines like Travis. Eg. without the esplora frontends

Add nigiri log command

It can be something like

nigiri <chain> <service> log

or defaulting to chain bitcoin and add flag --liquid

nigiri log --liquid --service=electrs (default --liquid=false and --service=node)

Support for testnet and mainnet

Ideally there will be needed walletdisabled in both conf. A nice to have for nigiri-chopsticks is a tor hidden service, along with an API-KEY authentication at the proxy level.

Add txindex to elements.conf

After upgrading the version of the elements node I'm not able anymore to use cli commands like decoderawtransaction that returns the error No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.