Skip to content

Commit

Permalink
motd
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Schwartz committed Feb 24, 2021
1 parent f697ca7 commit 9ceda48
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 101 deletions.
57 changes: 57 additions & 0 deletions tools/packer/etc/motd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Your lotus node is up and running!

This image contains the two most important pieces of the lotus filecoin suite, the
daemon and the miner. The daemon is is configured to download a snapshot and start
running. In fact, by the time you read this, the daemon may already be in sync.
Go ahead and make sure everything is working correctly with the following commands.



To check if the daemon is running:

systemctl status lotus-daemon



To check if the daemon is in sync:

lotus sync status

**note: When starting lotus for the first time, it will download a chain snapshot.
This is a large download and will take several minutes to complete. During
this time, the lotus API will not be up yet. Give it time! You can see
progress by looking at the systemd journal.


To check if the daemon is connecting to other lotus nodes:

lotus net peers



No wallets are crated by default. You can view, create, and delete wallets with
the lotus command. On this image, lotus is running as the user `fc`.
Be careful, now. Don't delete a wallet with funds!

sudo -E -u fc lotus wallet list
sudo -E -u fc lotus wallet new bls



The lotus miner is also installed, but it's not running by default. If you have no
special disk or worker requirements, you can initialize the lotus-miner repo like this:

sudo -E -u fc lotus-miner init -o <wallet_you_created_before>



You only need to do this once, after which, you can enable and start the miner.

sudo systemctl enable lotus-miner
sudo systemctl start lotus-miner



For more information, see https://docs.filecoin.io/
Found a bug? let us know! https://github.com/filecoin-project/lotus
Chat with us on slack! https://filecoinproject.slack.com/archives/CEGN061C5
94 changes: 0 additions & 94 deletions tools/packer/homedir/LOTUS.txt

This file was deleted.

9 changes: 7 additions & 2 deletions tools/packer/lotus.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ source "amazon-ebs" "lotus" {
"all",
]
ami_description = "Lotus Filecoin AMI"
launch_block_device_mappings {
device_name = "/dev/sda1"
volume_size = 100
delete_on_termination = true
}

instance_type = "t2.micro"
source_ami_filter {
Expand Down Expand Up @@ -81,8 +86,8 @@ build {
destination = "lotus-miner.service"
}
provisioner "file" {
source = "./tools/packer/homedir/LOTUS.txt"
destination = "LOTUS.txt"
source = "./tools/packer/etc/motd"
destination = "motd"
}
provisioner "file" {
source = "./tools/packer/homedir/bashrc"
Expand Down
18 changes: 13 additions & 5 deletions tools/packer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ then
fi

MANAGED_BINS=( lotus lotus-miner lotus-init.sh )
MANAGED_SYSTEMD=( lotus-daemon.service lotus-miner.service lotus-init.service )
MANAGED_FILES=(
/lib/systemd/system/lotus-daemon.service
/lib/systemd/system/lotus-miner.service
/etc/motd
)

# install libs.
apt update
Expand All @@ -37,11 +41,15 @@ do
rm $i
done

# Install systemd units
for i in "${MANAGED_SYSTEMD[@]}"
# Install systemd and other files.
# Because packer doesn't copy files with root permisison,
# files are in the home directory of the ssh user. Copy
# these files into the right position.
for i in "${MANAGED_FILES[@]}"
do
install -o root -g root -m 644 -t /lib/systemd/system $i
rm $i
fn=$(basename $i)
install -o root -g root -m 644 $fn $i
rm $fn
done

# Enable services
Expand Down

0 comments on commit 9ceda48

Please sign in to comment.