vulpemventures / nigiri Goto Github PK
View Code? Open in Web Editor NEW๐ฃ A delicious docker box for special Bitcoin, Lightning and Liquid cookings
Home Page: https://nigiri.vulpem.com
License: MIT License
๐ฃ A delicious docker box for special Bitcoin, Lightning and Liquid cookings
Home Page: https://nigiri.vulpem.com
License: MIT License
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)
Explore the usage of https://github.com/ottomatica/slim in the context of having a very light container runtime
This way we can trigger a new block generate
Review the flow, add more information about cleaning in development and also the default ports to expect
We have a completely different version of nigiri to be used inside Travis and other CI services. So the readme should ask "Are you looking to spin-up Nigiri in Travis or Github Action? Look here" and link to https://github.com/vulpemventures/nigiri-travis
Add a list of steps to correctly open a PR.
an example can be found in dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
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"]
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)
This should be used by the start
command
It would be very helpful for Liquid Developers to have a service like Liquid.Coach spun up in the box.
This means:
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.
At the build command on Darwin
cli/cmd/create.go:11:2: cannot find package "github.com/vulpemventures/nigiri/cli/builder"
cli/cmd/create.go:13:2: cannot find package "github.com/vulpemventures/nigiri/cli/helpers"
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
Create an additional pipeline using free Travis service
or find a way to get latest release
https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
this way we can run multiple nigiri compose in the same machine
Now the names are automatically generated, would be nice to add some shorter like bitcoin
, liquid
, electrs_liquid
, chopsticks
etc.. using the docker-compose directive container_name
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.
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
make the latter require the former active
We should make easy to push and tag new release. Goreleaser coudl help with that, especially to keep in sync the cobra CLI version, so nigiri --version
will be always up to date.
In this way in a hypotetical cli we would do nigiri-cli start --deterministic
and will look let's say to ~/.nigiri
where we can have the volumes containing bitcoind and electrs previous state to attach to docker compose
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)
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.