-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "release" | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@v13 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-21.05 | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ninegua | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: nix-build | ||
- name: Upload release package | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: result/bin/* | ||
file_glob: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CANISTERS=blackhole | ||
SRC=$(CANISTERS:%=src/%.mo) | ||
OBJ=$(CANISTERS:%=dist/%.wasm) | ||
OBJ_OPT=$(CANISTERS:%=dist/%-opt.wasm) | ||
IDL=$(CANISTERS:%=dist/%.did) | ||
MOC_OPT=--package base .vessel/base/927119e172964f4038ebc7018f9cc1b688544bfa/src | ||
|
||
build: $(OBJ) $(IDL) $(OBJ_OPT) | ||
|
||
clean: | ||
rm -f dist | ||
|
||
dist: | ||
@mkdir -p $@ | ||
|
||
dist/%.wasm: src/%.mo | dist | ||
moc $(MOC_OPT) -o $@ $< | ||
|
||
dist/%.did: src/%.mo | dist | ||
moc $(MOC_OPT) --idl -o $@ $< | ||
|
||
.PHONY: build clean really-clean | ||
|
||
UTIL_DIR?=/nix/store/4gaariri115lys3l5mfip6knn0v78clp-ic-utils | ||
include $(UTIL_DIR)/share/mk/inc.mk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
let | ||
ic-utils = import (builtins.fetchGit { | ||
url = "http://github.com/ninegua/ic-utils"; | ||
rev = "56d404d73dd5253372a1d50997df51e2ddc4d6fb"; | ||
}) { inherit pkgs; }; | ||
motoko-base = builtins.fetchGit { | ||
url = "https://github.com/dfinity/motoko-base"; | ||
rev = "927119e172964f4038ebc7018f9cc1b688544bfa"; | ||
}; | ||
in pkgs.stdenv.mkDerivation { | ||
name = "ic-blackhole"; | ||
version = "0.0.0"; | ||
phases = [ "buildPhase" "installPhase" ]; | ||
src = ./.; | ||
nativeBuildInputs = [ pkgs.binaryen ]; | ||
buildPhase = '' | ||
export PATH=${ic-utils}/bin:$PATH | ||
cp -r $src/* . | ||
make MOC_OPT='--package base ${motoko-base}/src/' UTIL_DIR='${ic-utils}' | ||
''; | ||
installPhase = "mkdir -p $out/bin && install -m 644 dist/* $out/bin/"; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Nat "mo:base/Nat"; | ||
import Nat8 "mo:base/Nat8"; | ||
import Principal "mo:base/Principal"; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ninegua
Author
Owner
|
||
|
||
actor { | ||
public type canister_id = Principal; | ||
|
||
public type definite_canister_settings = { | ||
freezing_threshold : Nat; | ||
controllers : [Principal]; | ||
memory_allocation : Nat; | ||
compute_allocation : Nat; | ||
}; | ||
|
||
public type canister_status = { | ||
status : { #stopped; #stopping; #running }; | ||
memory_size : Nat; | ||
cycles : Nat; | ||
settings : definite_canister_settings; | ||
module_hash : ?[Nat8]; | ||
}; | ||
|
||
public type IC = actor { | ||
canister_status : { canister_id : canister_id } -> async canister_status; | ||
}; | ||
|
||
let ic : IC = actor("aaaaa-aa"); | ||
|
||
public func canister_status(request : { canister_id : canister_id }) : async canister_status { | ||
await ic.canister_status(request) | ||
} | ||
} |
AFAICS, all these imports are unused. :)