Skip to content

Instantly share code, notes, and snippets.

View stwiname's full-sized avatar

Scott Twiname stwiname

View GitHub Profile

SubQuery V3 Release

V3.0.0 of SubQuery is a large release with a lot of new features. Although there are no breaking changes we felt that there was a large enough improvement to justify a major version bump. To use these new features please make sure to use the latest versions of the SubQuery dependencies in your project.

Project Upgrades

This allows users to upgrade projects at specific heights. This is useful with the network where there is currently no way to update a project if the contracts need updating or the chain has upgrades.

Documentation

@stwiname
stwiname / subquery-manifest-schema.json
Created August 11, 2023 03:42
Rough Subquery Manifest JSON Schema
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/SubQuery",
"definitions": {
"SubQuery": {
"type": "object",
"additionalProperties": false,
"properties": {
"specVersion": {
"type": "string",
@stwiname
stwiname / project.yaml
Last active February 22, 2022 20:27
Example EVM with multiple ABIs
specVersion: 0.2.0
name: zoombies-subquery
version: 1.0.0
description: Zoom Token mint, burn and approvals, Zoombies NFT events on Moonriver
repository: https://github.com/ryanprice/zoombies-subquery
schema:
file: ./schema.graphql
network:
genesisHash: '0x401a1f9dca3da46f5c4091016c8a2f26dcea05865116b286f60f668207d1474b' # Genesis hash of Moonriver
endpoint: wss://moonriver.api.onfinality.io/public-ws
@stwiname
stwiname / GameLib.sol
Created June 1, 2020 20:41
GameLib.sol
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result

Breif

To remember the user we will store a boolean as a string in AsyncStorage

It then needs to be loaded and set in redux state as well

Current practices

This is the most up to date way we do things

The Sylo Developer Guide

Branching

Naming

Branch names should take the format [type]/[name].

The type is what the purpose of the branch is, is it a fix or a feature or something else?

0415fc9fdae8468d3282c6e75880667511befb89b9cc8119c1228f2f82f45eb523a88ce685db347f2185fb610aa78f0c6f133af3aca798a9acd9e7db9da7bb4bcd;cednz
package main
/*
#cgo LDFLAGS: -lpthread -Llibrary -ltesting
#include "library/testing.h"
extern void cgo_callback_wrapper(void * context, char *message, int message_len);
*/
import "C"

HTTP Queue

The aim is to write a simple http server with methods to use a queue.

Methods

These methods should be implemented:

  • POST /queue/pop - Should pop from the queue and return a JSON object with an ID and created time
  • POST /queue/push - Should submit JSON object to a server with an ID and push it to the queue
  • GET /queue/count Should return the size of the queue in a JSON object

HTTP Queue

The aim is to write a simple http server with methods to use a queue.

Methods

These methods should be implemented:

  • POST /queue/pop - Should pop from the queue and return the pushed JSON object with an ID and created time added
  • POST /queue/push - Should submit a JSON object to the server and push it to the queue. The response should be a JSON object with the id
  • GET /queue/count Should return the size of the queue in a JSON object