Skip to content

Instantly share code, notes, and snippets.

View decentration's full-sized avatar
💭
Just getting this Github page set up...

Decentration decentration

💭
Just getting this Github page set up...
View GitHub Profile
@decentration
decentration / gist:240b0e9d1b7eedac64a326aa85740144
Created March 30, 2023 20:07
Samantha and Cindy first conversation
```
import requests
import uuid
import json
import time
class GPTChatAPIWrapper:
def __init__(self, api_key: str, model: str):
self.api_key = api_key
@decentration
decentration / gist:fceeafb66c8705fd6127012d9d35dbb0
Created February 13, 2022 11:59
Public RPC (full node) Command
./target/release/polkadot \ (replace polkadot with the name of your repo)
--validator \ - base-path /tmp/relay/MyVal1 \ (specify your db path)
--chain ./specs/<INSERT-CHAIN-SPEC.JSON> \
--port 30333 \
--ws-port 9944 \
--rpc-port 9933 \
--unsafe-ws-external \
--rpc-methods=Unsafe \
--rpc-external=True \
--rpc-cors all \
@decentration
decentration / cli
Last active February 13, 2022 12:09
Validator Node Command
./target/release/polkadot \
-- validator \
-- base-path /tmp/relay/MyVal1 \ specify your db path
-- chain ./specs/<INSERT-CHAIN-SPEC.JSON> \
-- port 30333 \
-- ws-port 9944 \
-- rpc-port 9933 \
-- rpc-methods=Unsafe \
-- name MyVal01 \
-- bootnodes /ip4/<INSERT A BOOTNODE TO LAUNCH VALIDATOR> \
./target/release/polkadot \
-- validator \
-- base-path /tmp/relay/MyVal1 \ specify your db path
-- chain ./specs/<INSERT-CHAIN-SPEC.JSON> \
-- port 30333 \
-- ws-port 9944 \
-- rpc-port 9933 \
-- rpc-methods=Unsafe \
-- name MyVal01 \
-- bootnodes /ip4/<INSERT A BOOTNODE TO LAUNCH VALIDATOR> \
@decentration
decentration / gist:9fad5edec9f529b709f7ff3338e7bf0d
Created February 12, 2022 15:04
example command with tags
./target/release/polkadot \
 - validator \
 - base-path /tmp/relay/MyVal1 \
 - chain ./specs/pop-art-3-val.json \
 - port 30333 \
 - ws-port 9944 \
 - rpc-port 9933 \
 - unsafe-ws-external \
 - rpc-methods=Unsafe \
 - rpc-external=True \
@decentration
decentration / gist:165b3a9cc5e8575c9abd39cdb1e38d90
Created November 24, 2021 18:51
Collator wont produce blocks
Can anyone advise why my collator is not producing blocks.
I think it is something to do with the relay_chain parameter in my chain spec. Where can i find what options there are? I tried rococo-local, rococo-staging, and rococo-chachacha, while cleaning the tmp/collator/chains each time.
Chain spec:
```
{
"name": "Chachacha",
"id": "cha",
Minting... https://gateway.pinata.cloud/ipfs/QmTeMUzcacETGgV9MZSBrUMDoFsQp7HHytjepavdw8gE28 B94D27B9934D3E08A52E52D7DA7DABFAC484EFE37A5380EE9088F7ACE2EFCDE9 https://gateway.pinata.cloud/ipfs/QmQgjchZuoxUPT3WqugPUoW1t7Jj9mENs7vyEUUA5EPiXW B94D27B9934D3E08A52E52D7DA7DABFAC484EFE37A5380EE9088F7ACE2EFCDE9
<ref *1> Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"bad response","code":"SERVER_ERROR","status":504,"headers":{"server":"nginx/1.16.1 (Ubuntu)","date":"Fri, 04 Jun 2021 06:16:26 GMT","content-type":"text/html","content-length":"176","connection":"close"},"body":"<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx/1.16.1 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n","requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"gasPrice\":\"0x1\",\"from\":\"0x006a758b2b5981b8f79b36c7362bee7a7c79b4f1\",\"to\":\"0xe1cab304a8275f26261e907b812fe267552b80b2\",\"data\":\"0x2cca
@decentration
decentration / DGovProposal
Created April 13, 2021 12:48
DGov: Decentralized Government Proposal
**DGov: Decentralised Governance for Web3.0 (Draft)**
Abstract 1
Mission 2
D-Gov: Decentralised Government Project 3
What are D-Gov’s? 4
What technology enables D-Gov’s? 4
How are DApps different to D-Govs? 4
Examples of D-Gov’s: 5
// Data returned by remote login request
{
"session": {
"user": {
"approval_status": "approved",
"empty_pass": false,
"id": "user_id",
"profile_keys": [
"profile_4"
],
const options = {
url: 'https://api.knack.com/v1/applications/5e159b77ed2cc100162fae1f/session',
method: 'POST',
headers: {
'content-type': 'application/json',
'Knack-Application-Id': '5e159b77ed2cc100162fae1f',
'email': bundle.authData.email,
'password': bundle.authData.password
},
params: {