From 5e6d3d151c7b64d4da255e6d0811454ca812b118 Mon Sep 17 00:00:00 2001 From: timlucmiptev Date: Sun, 27 Sep 2020 16:16:33 +0300 Subject: [PATCH] init --- app/bippy-provider.hoon | 58 +++++++++++++++++++++++++++++++++++++++++ install.sh | 30 +++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 app/bippy-provider.hoon create mode 100755 install.sh diff --git a/app/bippy-provider.hoon b/app/bippy-provider.hoon new file mode 100644 index 000000000..3c2f8f14b --- /dev/null +++ b/app/bippy-provider.hoon @@ -0,0 +1,58 @@ +:: bippy-provider.hoon +:: Provider for accessing BTC full node +:: +/+ dbug, default-agent +|% ++$ versioned-state + $% state-0 + == +:: ++$ state-0 [%0 counter=@] +:: ++$ card card:agent:gall +:: +-- +%- agent:dbug +=| state-0 +=* state - +^- agent:gall +|_ =bowl:gall ++* this . + def ~(. (default-agent this %|) bowl) + hc ~(. +> bowl) +:: +++ on-init + ^- (quip card _this) + ~& > '%bippy-provider initialized successfully' + `this +++ on-save + ^- vase + !>(state) +++ on-load + |= old-state=vase + ^- (quip card _this) + ~& > '%bippy-provider recompiled successfully' + `this(state !<(versioned-state old-state)) +++ on-poke + |= [=mark =vase] + ^- (quip card _this) + ?+ mark (on-poke:def mark vase) + %noun + ?+ q.vase (on-poke:def mark vase) + %send-tx + ~& >>> %send-tx + :_ this + ~ + :: :~ [%pass /[url.action] %arvo %i %request (get-url url.action) *outbound-config:iris] + == + == + == +:: +++ on-watch on-watch:def +++ on-leave on-leave:def +++ on-peek on-peek:def +++ on-agent on-agent:def +++ on-arvo on-arvo:def +++ on-fail on-fail:def +-- +:: helper core diff --git a/install.sh b/install.sh new file mode 100755 index 000000000..fce7b2a29 --- /dev/null +++ b/install.sh @@ -0,0 +1,30 @@ +#!/bin/bash +usage() { printf "Usage: $0 [-w] URBIT_PIER_DIRECTORY \n(-w: flag to watch and live copy code)\n" 1>&2; exit 1; } + +if [ $# -eq 0 ]; then + usage + exit 2 +fi +PIER=$1 + +while getopts "w" opt; do + case ${opt} in + w) WATCH_MODE="true" + PIER=$2 + ;; + *) usage + ;; + esac +done + +if [ -z "$WATCH_MODE" ]; then + echo "Installed %coiny-store" + rsync -r --exclude '.*' --exclude '*.sh' --exclude '*.md' * $PIER/ +else + echo "Watching for changes to copy to ${PIER}..." + while [ 0 ] + do + sleep 0.8 + rsync -r --exclude '.*' --exclude '*.sh' --exclude '*.md' * $PIER/ + done +fi