- Prerequisite reading
- Start a private network tutorial - just read the below sections (there's no need to read the whole thing)
- Start the blockchain using predefined accounts
- I have read and run node locally
- I understand the command-line options (particularly
--node-key
,--bootnodes
and the different ports used)
- Create a custom chain specification
- I understand the process of generating chain specs
- Start the blockchain using predefined accounts
- Start a private network tutorial - just read the below sections (there's no need to read the whole thing)
- Launch the private network
Run compose with optinal logging (open http://localhost in your browser for app):
docker-compose up -d
docker logs ajuna-network_worker_1 -f
Bash into the worker container to start sending trusted calls:
Clone the projects and mount them in a container:
git clone -b polkadot-v0.9.20-dev [email protected]:ajuna-network/Ajuna.git Ajuna
git clone [email protected]:ajuna-network/worker.git worker
cd worker && git checkout 0c40097 && cd ..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clone an upstream repo | |
git clone https://github.com/<user>/<project>.git && cd project | |
git branch -m upstream-master | |
git subtree split --prefix=<folder>/<subfolder> -b upstream-rebase | |
git checkout upstream-rebase | |
git remote rename origin upstream | |
git remote add origin https://github.com/<my-account>/<my-project>.git | |
git fetch origin | |
git push -u origin upstream-rebase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://codesandwich.github.io/overlapping_blanket_impls/ | |
use std::convert::TryInto; | |
// Dummy Trait | |
trait Blanket<I> { | |
fn blanket(&self) -> &'static str; | |
} | |
// Dummy Structs | |
struct Numbers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clone repos | |
mkdir move-repo && cd move-repo/ | |
git clone <repo-src> | |
git clone <repo-dst> | |
# prepare source | |
cd repo-src | |
#git checkout <branch-in-repo-src> # optional | |
#git remote rm origin # optional | |
git filter-branch --subdirectory-filter <directory-to-move> -- --all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(specialization)] | |
trait Foo { | |
fn foo(&self); | |
} | |
impl<T> Foo for T { | |
default fn foo(&self) { println!("default foo") } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3, re, asyncio | |
async def sync_one_to_s3(path): | |
source, target = path | |
bucket = re.sub('^s3://(.+?)/.+$', '\\1', target) | |
s3 = boto3.resource('s3') | |
b = s3.Bucket(bucket) | |
try: | |
b.upload_file(file, key) | |
except ClientError as e: |