Skip to content

Instantly share code, notes, and snippets.

@simwilso
simwilso / output.log
Created Feb 3, 2020
output.log from micro_blog test command
View output.log
Packaging files for testing to file: "/home/simwilso/Code/TestDemo/txrx/dist/txrx.dna.json"
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR 
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && echo $CARGO_TARGET_DIR "
/home/simwilso/Code/TestDemo/txrx/target
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && cargo build --release --target=wasm32-unknown-unknown --target-dir=$CARGO_TARGET_DIR"
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/txrx.wasm
"CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/target} && wasm-gc $CARGO_TARGET_DIR/wasm32-unknown-unknown/release/txrx.wasm"
> CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-/tmp/my_first_app/targ
@simwilso
simwilso / hello blog zome lib.rs
Created Feb 3, 2020
lib.rs for micro blog tutorial
View hello blog zome lib.rs
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate hdk;
extern crate hdk_proc_macros;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate holochain_json_derive;
@simwilso
simwilso / Hello blog test file index.js
Created Feb 3, 2020
index.js test file from micro blog tutorial
View Hello blog test file index.js
/// NB: The tryorama config patterns are still not quite stabilized.
/// See the tryorama README [https://github.com/holochain/tryorama]
/// for a potentially more accurate example
const path = require('path');
const {
Orchestrator,
Config,
combine,
View c-release zome configuration
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate hdk;
extern crate hdk_proc_macros;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate holochain_json_derive;
View DHT Calls from RUST
extern crate reqwest;
extern crate serde_json;
extern crate serde_derive;
extern crate serde;
extern crate ws;
use ws::{connect, CloseCode};
use serde_json::{json, Deserializer, Value};
use std::sync::mpsc::channel;
@simwilso
simwilso / zome_config
Last active Jan 14, 2020
Send Receive Simple Zome
View zome_config
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate hdk;
extern crate hdk_proc_macros;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate holochain_json_derive;
@simwilso
simwilso / gist:e00251bb5185c8bd80b9970f9bbdc745
Created Dec 11, 2019
WebSocket into Emit/Recieve (How to publish a value into Recieve and how to recieve it?)
View gist:e00251bb5185c8bd80b9970f9bbdc745
// I want this function in my rust program to push an entry into the DHT but now sure how to do this under this EMIT method?
let signal_string = "I want this go into the signal entry on my dht";
fn set_to_dht(_signal: String) {
let json = serde_json::json!(
{"id": "signal",
"jsonrpc": "2.0",
"method": "call",
"params": {"instance_id": "test-instance",
@simwilso
simwilso / gist:b0f7363d1fa06863f3384a401d38a508
Last active Dec 11, 2019
WebSocket into Emit/Recieve (How to publish a value into Recieve and how to recieve it?)
View gist:b0f7363d1fa06863f3384a401d38a508
// trying to create the websocket sync connection and keep it open
let mut client = ClientBuilder::new("ws://localhost:3401")
.unwrap()
.connect_insecure()
.unwrap();
// this doesn't compile due to the function not accepting the dynamic 'client' but is this how the send function should look?
fn set_to_dht(_signal: String) {
View gist:23b0e8ba048167c7c715b5d25b1e8f42
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate hdk;
extern crate hdk_proc_macros;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate holochain_json_derive;