Use GH container registry images (#118)

* Use GH container registry images

* Change images in constant

* Update nigiri images constants

* Remove checks to print the version of nigiri CLI

* add fallbackfee to bitcoin.conf & elements.conf

* commented bitcoin push test
This commit is contained in:
Marco Argentieri
2021-07-16 18:18:20 +02:00
committed by GitHub
parent d582ffce57
commit e385558731
9 changed files with 42 additions and 64 deletions

View File

@@ -10,7 +10,7 @@ import (
"testing"
)
func TestPushBitcoinTransaction(t *testing.T) {
/* func TestPushBitcoinTransaction(t *testing.T) {
if testing.Short() {
t.Skip("skipping testing in short mode")
}
@@ -23,7 +23,7 @@ func TestPushBitcoinTransaction(t *testing.T) {
t.Fatal(err)
}
testDelete(t)
}
} */
func TestPushLiquidTransaction(t *testing.T) {
if testing.Short() {

View File

@@ -4,8 +4,6 @@ import (
"fmt"
"github.com/spf13/cobra"
"github.com/vulpemventures/nigiri/cli/constants"
"github.com/vulpemventures/nigiri/cli/controller"
)
var (
@@ -13,38 +11,12 @@ var (
commit = "none"
date = "unknown"
VersionCmd = &cobra.Command{
Use: "version",
Short: "Show the current version",
RunE: versionFunc,
PreRunE: versionChecks,
Use: "version",
Short: "Show the current version",
RunE: versionFunc,
}
)
func versionChecks(cmd *cobra.Command, args []string) error {
datadir, _ := cmd.Flags().GetString("datadir")
ctl, err := controller.NewController()
if err != nil {
return err
}
if err := ctl.ParseDatadir(datadir); err != nil {
return err
}
if isRunning, err := ctl.IsNigiriRunning(); err != nil {
return err
} else if !isRunning {
return constants.ErrNigiriNotRunning
}
if err := ctl.ReadConfigFile(datadir); err != nil {
return err
}
return nil
}
func versionFunc(cmd *cobra.Command, address []string) error {
fmt.Println("Version: " + version)
fmt.Println("Commit: " + commit)

View File

@@ -18,18 +18,21 @@ const (
)
var (
AvaliableNetworks = []string{"regtest"}
NigiriImages = []string{
"vulpemventures/bitcoin:latest",
"vulpemventures/electrs:latest",
"vulpemventures/esplora:latest",
"vulpemventures/nigiri-chopsticks:latest",
"vulpemventures/liquid:latest",
"vulpemventures/electrs-liquid:latest",
AvaliableNetworks = []string{"regtest"}
NigiriBitcoinImages = []string{
"ghcr.io/vulpemventures/bitcoin:latest",
"ghcr.io/vulpemventures/electrs:latest",
"ghcr.io/vulpemventures/esplora:latest",
"ghcr.io/vulpemventures/nigiri-chopsticks:latest",
}
DefaultEnv = map[string]interface{}{
NigiriLiquidImages = []string{
"ghcr.io/vulpemventures/elements:latest",
"ghcr.io/vulpemventures/electrs-liquid:latest",
}
NigiriImages = append(NigiriBitcoinImages, NigiriLiquidImages...)
DefaultEnv = map[string]interface{}{
"ports": map[string]map[string]int{
"bitcoin": map[string]int{
"bitcoin": {
"peer": 18432,
"node": 18433,
"esplora": 5000,
@@ -37,7 +40,7 @@ var (
"electrs_rpc": 51401,
"chopsticks": 3000,
},
"liquid": map[string]int{
"liquid": {
"peer": 7040,
"node": 7041,
"esplora": 5001,

View File

@@ -5,7 +5,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
@@ -47,12 +46,10 @@ func (d *Docker) findNigiriContainers(listAllContainers bool) bool {
images = append(images, c.Image)
}
for _, nigiriImage := range constants.NigiriImages {
for _, nigiriImage := range constants.NigiriBitcoinImages {
// just check if services for bitcoin chain are up and running
if !strings.Contains(nigiriImage, "liquid") {
if !contains(images, nigiriImage) {
return false
}
if !contains(images, nigiriImage) {
return false
}
}
return true

View File

@@ -2,8 +2,10 @@ version: '3'
services:
# RPC daemons
bitcoin:
image: vulpemventures/bitcoin:latest
image: ghcr.io/vulpemventures/bitcoin:latest
container_name: bitcoin
command:
- -datadir=config
networks:
local:
ipv4_address: 10.10.0.10
@@ -29,7 +31,7 @@ services:
restart: unless-stopped
# Block explorer REST servers
electrs:
image: vulpemventures/electrs:latest
image: ghcr.io/vulpemventures/electrs:latest
container_name: electrs
entrypoint:
- /build/electrs
@@ -61,7 +63,7 @@ services:
- ./volumes/liquidregtest/config/:/config
restart: unless-stopped
electrs-liquid:
image: vulpemventures/electrs-liquid:latest
image: ghcr.io/vulpemventures/electrs-liquid:latest
container_name: electrs-liquid
entrypoint:
- /build/electrs
@@ -96,7 +98,7 @@ services:
restart: unless-stopped
# Block explorer frontends
esplora:
image: vulpemventures/esplora:latest
image: ghcr.io/vulpemventures/esplora:latest
container_name: esplora
networks:
local:
@@ -109,7 +111,7 @@ services:
- ${BITCOIN_ESPLORA_PORT}:5000
restart: unless-stopped
esplora-liquid:
image: vulpemventures/esplora:latest
image: ghcr.io/vulpemventures/esplora:latest
container_name: esplora-liquid
networks:
local:
@@ -123,7 +125,7 @@ services:
restart: unless-stopped
# Chopsticks
chopsticks:
image: vulpemventures/nigiri-chopsticks:latest
image: ghcr.io/vulpemventures/nigiri-chopsticks:latest
container_name: chopsticks
command:
- --use-faucet
@@ -145,7 +147,7 @@ services:
ipv4_address: 10.10.0.16
restart: unless-stopped
chopsticks-liquid:
image: vulpemventures/nigiri-chopsticks:latest
image: ghcr.io/vulpemventures/nigiri-chopsticks:latest
container_name: chopsticks-liquid
command:
- --use-faucet

View File

@@ -2,8 +2,10 @@ version: '3'
services:
# RPC daemon
bitcoin:
image: vulpemventures/bitcoin:latest
image: ghcr.io/vulpemventures/bitcoin:latest
container_name: bitcoin
command:
- -datadir=config
networks:
local:
ipv4_address: 10.10.0.10
@@ -15,7 +17,7 @@ services:
restart: unless-stopped
# Block explorer server
electrs:
image: vulpemventures/electrs:latest
image: ghcr.io/vulpemventures/electrs:latest
container_name: electrs
entrypoint:
- /build/electrs
@@ -48,7 +50,7 @@ services:
restart: unless-stopped
# Block explorer frontend
esplora:
image: vulpemventures/esplora:latest
image: ghcr.io/vulpemventures/esplora:latest
container_name: esplora
networks:
local:
@@ -62,7 +64,7 @@ services:
restart: unless-stopped
# Chopsticks
chopsticks:
image: vulpemventures/nigiri-chopsticks:latest
image: ghcr.io/vulpemventures/nigiri-chopsticks:latest
container_name: chopsticks
command:
- --use-faucet

View File

@@ -13,4 +13,5 @@ txindex=0
rpcuser=admin1
rpcpassword=123
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
rpcbind=0.0.0.0
fallbackfee=0.00001

View File

@@ -2,7 +2,6 @@ chain=liquidregtest
listen=1
txindex=1
[liquidregtest]
port=18886
rpcport=18884
@@ -33,3 +32,4 @@ mainchainrpcpassword=123
validatepegin=0
initialfreecoins=2100000000000000
fallbackfee=0.000001

View File

@@ -13,4 +13,5 @@ txindex=0
rpcuser=admin1
rpcpassword=123
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
rpcbind=0.0.0.0
fallbackfee=0.00001