Skip to content

Instantly share code, notes, and snippets.

View Craigson's full-sized avatar

Craig Pickard Craigson

View GitHub Profile
@Craigson
Craigson / swarm_peers
Created February 4, 2021 01:32
out put from the 'ipfs swarm' peers command
ok: [ipfs15] =>
msg: |-
/ip4/10.69.0.116/tcp/4001/p2p/12D3KooWGLUdhZqVNoBn5uNieknFc2KfaaxX8ZBqGZtmZ4kwc7Ac
/ip4/10.69.0.118/tcp/4001/p2p/12D3KooWEWkahNb3xLdkmwFiNkjjTvpwXCd7Yjf9KKQUixudz5UH
/ip4/10.69.0.119/tcp/4001/p2p/12D3KooWP19txmcCntvyW6rHj1pqbQGj8iHniPR3eGovLBrHucm2
/ip4/10.69.0.120/tcp/60150/p2p/12D3KooWJDRg63qafZNhbLnjRMZydQSAGH1zrtM36cAMvpAKjwZB
/ip4/10.69.0.126/tcp/4001/p2p/12D3KooWPzEiP3fUHwJUZBsmcJG8JaVaS7Hu2XBkbPAnY4SBsRPj
/ip4/10.69.0.130/tcp/4001/p2p/12D3KooWCTSRYxexC8mw2vvNfZVWaLvZK9h26QczRh9XapB9kx4T
/ip4/10.69.0.131/tcp/4001/p2p/12D3KooWFW5Zy1pmt9WaaW1i7fkxLZ9LSgDwhbJiZ9Gd56pZvTmB
/ip4/10.69.0.132/tcp/4001/p2p/12D3KooWKxYbKgnBPmksisLosM6TF6CUqaRJNCs9sBshiUfXZVJm
@Craigson
Craigson / deploy_network.yaml
Created February 4, 2021 01:19
Deploy IPFS network playbook
- name: Deploy IPFS syntropy network
hosts: [localhost]
tasks:
- name: Create network
syntropynet.syntropy.syntropy_network:
name: ipfs-mesh
state: present
topology: mesh
connections:
ipfs:
@Craigson
Craigson / bootstrap_add_peers
Created February 4, 2021 01:08
output from the bootstrap_peers playbook
ok: [ipfs1] =>
msg: |-
/ip4/172.100.0.2/tcp/4001/p2p/12D3KooWE2aspeb9Wcutns33MZikZ1x1gZKvxgWLv447cRMwPuaH # <==== Gateway
/ip4/172.101.0.2/tcp/4001/p2p/12D3KooWLqc7HQ4HhKtvBZ2b3sknb44XrEUFm3RqYypkhio3xzJZ
/ip4/172.102.0.2/tcp/4001/p2p/12D3KooWMbC1R2BvbSnUsjfJHyd7AQpirL3fnRGHpMKCwDeUkfGM
/ip4/172.103.0.2/tcp/4001/p2p/12D3KooWSbh5y89QxJ6ZYTXEaxpf2wtCZgHcGytMaLY3kJDpDDBe
/ip4/172.105.0.2/tcp/4001/p2p/12D3KooWAM21vQUUiVaSmHdhtQn3atZyHmnHgQBGZMPZTqeeaUJy
/ip4/172.105.0.2/tcp/4001/p2p/12D3KooWLYyL6AyaY8mjyBSPk2vJkRWsyWb5iCQyJPHfAcA7rEGV
ok: [ipfs6] =>
@Craigson
Craigson / ipfs-endpoints
Created February 4, 2021 00:49
Output from the syntropyctl get-endpoints command
❯ syntropyctl get-endpoints
+----------+---------------+-----------------+-----------------------+--------------+--------+----------------+
| Agent ID | Name | Public IP | Provider | Location | Online | Tags |
+----------+---------------+-----------------+-----------------------+--------------+--------+----------------+
| 1026 | ipfs1 | 104.248.228.239 | DigitalOcean | North Bergen | True | ipfs |
| 1027 | ipfs3 | 68.183.115.60 | DigitalOcean | North Bergen | True | ipfs |
| 1028 | ipfs5 | 68.183.125.71 | DigitalOcean | North Bergen | True | ipfs |
| 1029 | ipfs4 | 142.93.116.179 | DigitalOcean | North Bergen | True | ipfs |
| 1030 | ipfs2 | 68.183.115.185 | DigitalOcean | North Bergen | True | ipfs |
| 1031 | ipfs8 | 35.232.122.38 | Google Cloud Platform | | True |
@Craigson
Craigson / provisio_hosts.output
Created February 3, 2021 18:30
Output from the provision_hosts.yaml file
PLAY RECAP ********************************************************************************************************************************
ipfs0-gateway : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs1 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs10 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs11 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs12 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs13 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs14 : ok=14 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ipfs15 : ok=14 changed=12 unreachable=0 failed=0
@Craigson
Craigson / digraph
Created February 3, 2021 17:08
Output of the terraform graph command
digraph {
compound = "true"
newrank = "true"
subgraph "root" {
"[root] local_file.ansible_inventory (expand)" [label = "local_file.ansible_inventory", shape = "box"]
"[root] module.aws.aws_instance.dev_ipfs (expand)" [label = "module.aws.aws_instance.dev_ipfs", shape = "box"]
...
@Craigson
Craigson / main.tf
Last active February 3, 2021 05:32
Digital Ocean module's main.tf file
resource "digitalocean_droplet" "syntropy_ipfs" {
count = 5
image = "ubuntu-20-04-x64"
name = "ipfs${count.index + 1}"
region = "nyc1"
size = "s-1vcpu-1gb"
private_networking = true
ssh_keys = [
data.digitalocean_ssh_key.syntropy.id
@Craigson
Craigson / outputs.tf
Created February 3, 2021 04:07
Main outputs.tf terraform template
resource "local_file" "ansible_inventory" {
content = templatefile("ansible_inventory.tmpl", {
ec2_tags = module.aws.tags
ec2_instance_ips = module.aws.ips
gateway_ip = module.digitalocean_cluster.droplet_gateway_address
droplet_ips = module.digitalocean_cluster.droplet_ip_addresses
droplet_host_numbers = module.digitalocean_cluster.host_numbers
droplet_names = module.digitalocean_cluster.droplet_names
gcp_metadata = module.gcp_cluster.metadata
gcp_ips = module.gcp_cluster.vm_ips
@Craigson
Craigson / ansible_inventory.tmpl
Created February 3, 2021 03:57
A section of the Terraform template file for creating the Ansible Inventory
[digitalocean]
%{ for index, ip in droplet_ips ~}
${droplet_names[index]} ansible_host=${ip} ansible_connection=ssh ansible_user=root subnet=172.${sort(droplet_host_numbers[index])[0]}.0.0/24 ipfs_host=172.${sort(droplet_host_numbers[index])[0]}.0.2
%{ endfor ~}
[digitalocean:vars]
agent_provider="6"
agent_tags="digitalocean"
@Craigson
Craigson / play-recap
Created January 23, 2021 19:08
Play recap from deploy_services.yaml playbook for Log3
PLAY RECAP ************************************************************************************************************
elasticsearch : ok=7 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
fluentd : ok=20 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
kibana-nginx : ok=14 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0