Skip to content

Instantly share code, notes, and snippets.

View Craigson's full-sized avatar

Craig Pickard Craigson

View GitHub Profile
@Craigson
Craigson / GasslessTest.sol
Last active March 24, 2022 18:09
EXR Biconomy implementation
pragma solidity 0.8.7;
import "./extensions/CouponSystem.sol";
import "./EIP712MetaTransaction.sol";
contract MyContract is CouponSystem {
bool public isGasless;
IEXRGameAsset public pilotContract;
@Craigson
Craigson / solidity-resources
Last active December 16, 2021 17:15
List of resources for Solidity
# On-Chain Metadata
- https://blog.simondlr.com/posts/flavours-of-on-chain-svg-nfts-on-ethereum
# EVM / MEV
- https://twitter.com/libevm/status/1467376978697211904?s=20
# Solidity Devtools:
<34.70.232.163> (1, b'\r\n{"failed": true, "msg": "Error connecting: Error while fetching server API version: (\'Connection aborted.\', PermissionError(13, \'Permission denied\'))", "exception": " File \\"/tmp/ansible_docker_network_payload_3e__q8cf/ansible_docker_network_payload.zip/ansible_collections/community/general/plugins/module_utils/docker/common.py\\", line 361, in __init__\\n super(AnsibleDockerClient, self).__init__(**self._connect_params)\\n File \\"/home/craigpick/.local/lib/python3.8/site-packages/docker/api/client.py\\", line 197, in __init__\\n self._version = self._retrieve_server_version()\\n File \\"/home/craigpick/.local/lib/python3.8/site-packages/docker/api/client.py\\", line 221, in _retrieve_server_version\\n raise DockerException(\\n", "invocation": {"module_args": {"name": "syntropynet", "driver": "bridge", "ipam_config": [{"subnet": "172.22.0.0/24", "iprange": null, "gateway": null, "aux_addresses": null}], "docker_host": "unix://var/run/docker.sock", "tls_hostname": "l
2021/02/18 23:13:40 [TRACE] vertex "var.ssh_private_key": visit complete
2021/02/18 23:13:40 [TRACE] vertex "var.region": starting visit (*terraform.NodeRootVariable)
2021/02/18 23:13:40 [TRACE] vertex "var.region": visit complete
2021/02/18 23:13:40 [TRACE] vertex "var.user_ocid": starting visit (*terraform.NodeRootVariable)
2021/02/18 23:13:40 [TRACE] dag/walk: visiting "var.compartment_ocid"
2021/02/18 23:13:40 [TRACE] vertex "var.compartment_ocid": starting visit (*terraform.NodeRootVariable)
2021/02/18 23:13:40 [TRACE] vertex "var.num_instances": starting visit (*terraform.NodeRootVariable)
2021/02/18 23:13:40 [TRACE] vertex "var.compartment_ocid": visit complete
2021/02/18 23:13:40 [TRACE] vertex "var.num_instances": visit complete
2021/02/18 23:13:40 [TRACE] vertex "var.user_ocid": visit complete
@Craigson
Craigson / play_recap
Created February 19, 2021 00:57
recap of the main.yaml playbook for launching a Polkadot validator
PLAY RECAP ***********************************************************************************************************
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
polkadot-monitoring : ok=18 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
polkadot-validator : ok=13 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'network'
fatal: [localhost]: FAILED! => changed=false
attempts: 3
module_stderr: |-
Traceback (most recent call last):
File "/tmp/ansible-craig/ansible-tmp-1613695864.793667-76876-208000978950/AnsiballZ_syntropy_template.py", line 102, in <module>
_ansiballz_main()
File "/tmp/ansible-craig/ansible-tmp-1613695864.793667-76876-208000978950/AnsiballZ_syntropy_template.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/tmp/ansible-craig/ansible-tmp-1613695864.793667-76876-208000978950/AnsiballZ_syntropy_template.py", line 40, in invoke_module
@Craigson
Craigson / launch_vallidator.yaml
Created February 19, 2021 00:29
launch_validator role for running the Validator docker container
---
- name: Create data directory if it doesn't exist
command: mkdir -p ./polkadot/.local
- name: Create data directory if it doesn't exist
command: mkdir -p ./data
- name: Launch Polkadot validator
docker_container:
image: parity/polkadot:latest
@Craigson
Craigson / terraform_plan
Created February 18, 2021 23:16
Console output from terraform plan
# module.digitalocean_monitoring.digitalocean_droplet.syntropy-polkadot-monitoring will be created
+ resource "digitalocean_droplet" "syntropy-polkadot-monitoring" {
+ backups = false
+ created_at = (known after apply)
+ disk = (known after apply)
+ id = (known after apply)
+ image = "ubuntu-20-04-x64"
+ ipv4_address = (known after apply)
+ ipv4_address_private = (known after apply)
+ ipv6 = false
@Craigson
Craigson / aws_instance.tf
Created February 18, 2021 23:11
AWS EC2 instance for polkadot validator
resource "aws_instance" "main-syntropy-polkadot" {
ami = var.image # Ubuntu 20.04 LTS
instance_type = var.machine_type # m4.large
key_name = "syntropy-polkadot"
subnet_id = aws_subnet.main-syntropy-polkadot.id
vpc_security_group_ids = [aws_security_group.main-syntropy-polkadot.id]
root_block_device {
volume_size = 400
@Craigson
Craigson / main.tf
Created February 18, 2021 22:38
Terraform template for Polkadot validator
module "aws_validator" {
source = "./aws"
ssh_public_key_file = var.ssh_public_key_file
}
module "digitalocean_monitoring" {
source = "./digitalocean"
do_token = var.do_token
pvt_key = var.pvt_key
}