Skip to content

Commit

Permalink
voila
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrostr committed May 13, 2022
1 parent c5cb7db commit cb5b606
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Full Node BSC
# Full Node of mainnet

## goal

spins up a geth full node for binance smart chain using teraform and ansible
spins up a geth node for ethereum chain using provisioning tools

### requirements

Expand All @@ -19,32 +19,41 @@ export TF_VAR_REGION=""
- terraform
- ansible
- jq (for parsing json)

ssh keys (`~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`)
- 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 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
echo $NODE_IP >> /etc/ansible/hosts
```

in case one would prefer to maintain the same address, the setting of the `BSC_NODE_IP`
in case one would prefer to maintain the same address, the setting of the `NODE_IP`
and `TF_VAR_ALLOCATION_ID` variables can be appended to ~/.profile or ~/.bashrc

### usage

start the instance
start and setup the instance

```bash
cd ./terraform && terraform init && terraform apply
cd ../
ansible-playbook ansible/main.yml
ssh ubuntu@$NODE_IP
```

and

```bash
terraform init && terraform apply
ssh -i ~/.ssh/id_rsa ubuntu@$BSC_NODE_IP
geth --syncmode light --http
```

then, you can pull data from the chain by calling

```bash
git clone https://github.com/ethereum/go-ethereum
curl http://$NODE_IP:8545/
```

0 comments on commit cb5b606

Please sign in to comment.