-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme, allocate elastic ip as part of setup
- Loading branch information
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Full Node BSC | ||
|
||
## goal | ||
|
||
spins up a geth full node for binance smart chain using teraform and ansible | ||
|
||
### requirements | ||
|
||
env vars: | ||
|
||
```bash | ||
export TF_VAR_AWS_ACCESS_KEY="" | ||
export TF_VAR_AWS_SECRET_KEY="" | ||
export TF_VAR_SSH_PASSWORD="" # to be used on logins without ssh keypair | ||
export TF_VAR_REGION="" | ||
``` | ||
|
||
- aws-cli | ||
- terraform | ||
- ansible | ||
- jq (for parsing json) | ||
|
||
ssh keys (`~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`) | ||
|
||
### setup | ||
|
||
get an ip address alocated and append to ansible hosts, export the address to env | ||
|
||
```bash | ||
aws ec2 allocate-address > /etc/allocated-address | ||
export BSC_NODE_IP=$(cat /etc/allocated-address | jq -r ".PublicIp") | ||
export TF_VAR_ALLOCATION_ID=$(cat /etc/allocated-address | jq -r ".AllocationId") | ||
echo $BSC_NODE_IP >> /etc/ansible/hosts | ||
``` | ||
|
||
in case one would prefer to maintain the same address, the setting of the `BSC_NODE_IP` | ||
and `TF_VAR_ALLOCATION_ID` variables can be appended to ~/.profile or ~/.bashrc | ||
|
||
### usage | ||
|
||
start the instance | ||
|
||
```bash | ||
terraform init && terraform apply | ||
ssh -i ~/.ssh/id_rsa ubuntu@$BSC_NODE_IP | ||
``` | ||
|
||
```bash | ||
git clone https://github.com/ethereum/go-ethereum | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: First Task | ||
hosts: all | ||
tasks: | ||
- name: Leaving a mark | ||
command: "touch /tmp/mark" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters