Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Archway Environment and Configure Developer CLI for Account Setup #1

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d6fd827
Addition of Archway with script to deploy the Archway multisig on the…
emperorjm Mar 8, 2024
455e6e9
Rename startup script filename
emperorjm Mar 8, 2024
e16d1a5
Add a comment outlining what the script does
emperorjm Mar 8, 2024
1073607
Update comments
emperorjm Mar 8, 2024
042e0d3
Update the OS and also install npm
emperorjm Mar 8, 2024
d758d95
Automatically continue with each installation
emperorjm Mar 8, 2024
29dd43c
Install go dependency
emperorjm Mar 8, 2024
da830e9
Modifiy script to install NodeJs 18 which is the latest version requi…
emperorjm Mar 8, 2024
d7e2ee0
Use nvm to install node version 18
emperorjm Mar 8, 2024
00c7d7c
Fixed archway config command and added an acount name to archway acco…
emperorjm Mar 8, 2024
b854d0d
Allow for installing cargo, cargo-generate, gnome keyring and docker
emperorjm Mar 9, 2024
a370acb
Unlock the os keyring
emperorjm Mar 9, 2024
39fec34
Set keyring backend to test as the backend on headless ubuntu is not …
emperorjm Mar 9, 2024
190fe52
Use of the test keyring backend and clone github repo via https inste…
emperorjm Mar 11, 2024
382c447
Utilizing the test keyring and correctly editing the .env file
emperorjm Mar 11, 2024
1992afc
Reconfigured the script to simply set up an Archway environment and c…
emperorjm Mar 12, 2024
f413868
Use the latest LTS node version
emperorjm Mar 12, 2024
849957b
Remove the gnome keyring installation
emperorjm Mar 12, 2024
4b3378f
Use default responses for docker install and fix npm installation issues
emperorjm Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions archway/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/bash

# ******************************************************************************
# This script automates the process of setting up and environment for Archway
# and creating an Archway account.
# ******************************************************************************

# Create a new Archway account and capture the address
create_archway_account() {
echo "Creating new Archway account..."
output=$(archway accounts new mywallet --keyring-backend test)
address=$(echo "$output" | grep 'Address:' | awk '{print $2}')
echo "$output"
echo $address > account_address.txt
}

# Update os
sudo apt update

# Install go
echo "Installing go..."
sudo apt install -y golang-go

# Install curl to install node v18
sudo apt install -y curl

# Install jq
echo "Installing jq..."
sudo apt install -y jq

# Install cargo
echo "Installing cargo..."
#curl https://sh.rustup.rs -sSf | sh
curl https://sh.rustup.rs -sSf | sh -s -- -y

# Install cargo generate
#cargo add cargo-generate
echo "Installing cargo-generate..."
yes | cargo install cargo-generate

# Install docker
# Add Docker's official GPG key:
sudo apt-get -y update
sudo apt-get -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Install nodejs 18
echo "Installing nodejs..."
#curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
#sudo apt install -y nodejs
nvm install 20
nvm use 20

echo "Node.js version:"
node -v
echo "NPM version:"
npm -v

# Install npm
echo "Installing npm..."
sudo apt install -y npm

echo "Installing Archway Developer CLI..."
npm install -g @archwayhq/cli

# Configure Archway CLI
echo "Configuring Archway Developer CLI to use the Constantine network..."
#archway config chain-id constantine-3 --global
archway config set -g chain-id constantine-3
# archway config chain-id archway-1 --global # For Mainnet

# Set keyring backend to test
archway config set -g keyring-backend test

echo "Current Archway CLI configuration:"
archway config show

# Preparing accounts
#echo "Creating a new Archway account..."
#archway accounts new mywallet
create_archway_account

echo "Listing all accounts..."
archway accounts list --keyring-backend test

# Clone MultiSig repository
#echo "Change to user's home directory..."
#cd ~
echo "Cloning MultiSig repository..."
git clone https://github.com/archway-network/archway-msig.git
echo "Change into the archway-msig directory..."
cd archway-msig
echo "Install packages with npm..."
npm install -y