[ci] Use bitcoindevkit/electrs base image for electrum tests
This commit is contained in:
		
							parent
							
								
									aea9abff8a
								
							
						
					
					
						commit
						98803b2573
					
				
							
								
								
									
										8
									
								
								.github/workflows/cont_integration.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/cont_integration.yml
									
									
									
									
										vendored
									
									
								
							@ -78,8 +78,12 @@ jobs:
 | 
				
			|||||||
  test-electrum:
 | 
					  test-electrum:
 | 
				
			||||||
    name: Test Electrum
 | 
					    name: Test Electrum
 | 
				
			||||||
    runs-on: ubuntu-16.04
 | 
					    runs-on: ubuntu-16.04
 | 
				
			||||||
 | 
					    container: bitcoindevkit/electrs
 | 
				
			||||||
    env:
 | 
					    env:
 | 
				
			||||||
      MAGICAL_RPC_COOKIEFILE: /home/runner/.bitcoin/regtest/.cookie
 | 
					      MAGICAL_RPC_AUTH: USER_PASS
 | 
				
			||||||
 | 
					      MAGICAL_RPC_USER: admin
 | 
				
			||||||
 | 
					      MAGICAL_RPC_PASS: passw
 | 
				
			||||||
 | 
					      MAGICAL_RPC_URL: 127.0.0.1:18443
 | 
				
			||||||
      MAGICAL_ELECTRUM_URL: tcp://127.0.0.1:60401
 | 
					      MAGICAL_ELECTRUM_URL: tcp://127.0.0.1:60401
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: checkout
 | 
					      - name: checkout
 | 
				
			||||||
@ -99,7 +103,7 @@ jobs:
 | 
				
			|||||||
          toolchain: stable
 | 
					          toolchain: stable
 | 
				
			||||||
          override: true
 | 
					          override: true
 | 
				
			||||||
      - name: start core
 | 
					      - name: start core
 | 
				
			||||||
        run: ./ci/start-core.sh || exit 1
 | 
					        run: ./ci/start-core.sh
 | 
				
			||||||
      - name: test
 | 
					      - name: test
 | 
				
			||||||
        uses: actions-rs/cargo@v1
 | 
					        uses: actions-rs/cargo@v1
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
 | 
				
			|||||||
@ -1,28 +1,17 @@
 | 
				
			|||||||
#!/usr/bin/env sh
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set -e
 | 
					echo "Starting bitcoin node."
 | 
				
			||||||
 | 
					/root/bitcoind -regtest -server -daemon -fallbackfee=0.0002 -rpcuser=admin -rpcpassword=passw -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BITCOIN_VERSION=0.20.1
 | 
					echo "Waiting for bitcoin node."
 | 
				
			||||||
 | 
					until /root/bitcoin-cli -regtest -rpcuser=admin -rpcpassword=passw getblockchaininfo; do
 | 
				
			||||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
 | 
					 | 
				
			||||||
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1
 | 
					 | 
				
			||||||
sudo apt-get update || exit 1
 | 
					 | 
				
			||||||
sudo apt-get install -y libllvm10 clang-10 libclang-common-10-dev || exit 1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cargo install --git https://github.com/romanz/electrs --bin electrs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
curl -O -L https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
 | 
					 | 
				
			||||||
tar xf bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export PATH=$PATH:./bitcoin-$BITCOIN_VERSION/bin
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bitcoind -regtest=1 -daemon=1 -fallbackfee=0.0002
 | 
					 | 
				
			||||||
until bitcoin-cli -regtest getblockchaininfo; do
 | 
					 | 
				
			||||||
    sleep 1
 | 
					    sleep 1
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ADDR=$(bitcoin-cli -regtest getnewaddress)
 | 
					echo "Generating 150 bitcoin blocks."
 | 
				
			||||||
bitcoin-cli -regtest generatetoaddress 150 $ADDR
 | 
					ADDR=$(/root/bitcoin-cli -regtest -rpcuser=admin -rpcpassword=passw getnewaddress)
 | 
				
			||||||
 | 
					/root/bitcoin-cli -regtest -rpcuser=admin -rpcpassword=passw generatetoaddress 150 $ADDR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
nohup electrs --network regtest --jsonrpc-import --cookie-file $HOME/.bitcoin/regtest/.cookie &
 | 
					echo "Starting electrs node."
 | 
				
			||||||
 | 
					nohup /root/electrs --network regtest --jsonrpc-import &
 | 
				
			||||||
sleep 5
 | 
					sleep 5
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user