Skip to content

Instantly share code, notes, and snippets.

View xeroc's full-sized avatar
🏠
building

Fabian Schuh xeroc

🏠
building
View GitHub Profile
import idl from '../protocol-v2/sdk/src/idl/drift.json';
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
import { Program, ProgramAccount } from '@coral-xyz/anchor';
import * as anchor from '@coral-xyz/anchor';
const wallet = new anchor.Wallet(Keypair.generate());
const connection = new Connection("https://api.devnet.solana.com");
//const connection = new Connection("https://api.mainnet-beta.solana.com");
const provider = new anchor.AnchorProvider(
job "bash" {
type = "service"
datacenters = ["de1"]
group "bash" {
count = 1
network {
mode = "bridge"
}
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
Spec: 0010
Title: Single-SignOn Onboarding
Authors: Fabian Schuh <fabian@blockops.de>
Status: Draft
Type: off-chain
Created: 2021-03-01

Abstract

In these days, internet users have a number of accounts they have to manage

from getpass import getpass
from pprint import pprint
from bitshares import BitShares
from bitshares.account import Account
from bitshares.amount import Amount
from bitsharesbase import operations
bitshares = BitShares("wss://eu.nodes.bitshares.ws")
bitshares.wallet.unlock(getpass())
ops = list()
if not self.worker.blockchain.nobroadcast:
# We using blocking so after this call we can be sure the operation
# is on the blockchain. However, a transfer does not return a
# resulting operation id as no object is created, thus we go thru
# the history and obtain the most recent operation id
# FIXME: potentially, this could go wrong in case some other entity
# has access ot the accounting account too and leverages that at the
# very same time. The ids would still be close to each other
account = Account(self.accounting_account)
statistics = Object(account["statistics"])
diff --git a/Dockerfile b/Dockerfile
index 618ff161..78d69a1d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,9 +17,8 @@ RUN \
libncurses-dev \
doxygen \
ca-certificates \
+ fish \
&& \
@xeroc
xeroc / dict_merge.py
Created August 21, 2019 10:06 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
# Recursive dictionary merge
# Copyright (C) 2016 Paul Durivage <pauldurivage+github@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
---
- name: create pybitshares wallet
become_user: "{{bitshareseurope_pywallet_user}}"
become: yes
command: "{{bitshareseurope_pywallet_install_dir}}/env/bin/uptick createwallet --password '{{bitshareseurope_pywallet_passphrase | trim }}'"
args:
creates: "{{pybitshares_home}}/bitshares.sqlite"
- name: Set default node
become_user: "{{bitshareseurope_pywallet_user}}"