Skip to content

Instantly share code, notes, and snippets.

View Connoropolous's full-sized avatar

Connor Turland Connoropolous

View GitHub Profile
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;

Keybase proof

I hereby claim:

  • I am Connoropolous on github.
  • I am connorscott (https://keybase.io/connorscott) on keybase.
  • I have a public key whose fingerprint is C551 A5A1 B06E AFC9 3EB3 E318 66C4 A949 30C0 60EA

To claim this, I am signing this object:

const Container = require('@holochain/holochain-nodejs');
// instantiate an app from the DNA JSON bundle
const app = Container.instanceFromNameAndDna("app", "dist/bundle.json")
const app2 = Container.instanceFromNameAndDna("app2", "dist/bundle.json")
// activate the new instance
app.start()
app2.start()
@Connoropolous
Connoropolous / index.js
Created January 17, 2019 20:04
use of Option seems to work
// This test file uses the tape testing framework.
// To learn more, go here: https://github.com/substack/tape
const test = require('tape');
const { Config, Container } = require("@holochain/holochain-nodejs")
const dnaPath = "./dist/bundle.json"
// closure to keep config-only stuff out of test scope
const container = (() => {
TAP version 13
# Can create a list
Reading DNA from dist/holochain-rust-todo.dna.json
No chain found in the store
Initializing new chain...
Starting instance "alice"...
WAITER: Action::Commit -> Action::Hold
WAITER: Action::Commit -> Action::Hold
WAITER: Action::Commit -> Action::Hold
WAITER: Action::Commit -> Action::Hold
!C0! @@ fixme publish error catch @@ Error: Cannot connect to a peer with the same peerAddress: HcSCJKYKbh7Hdggn4z4NxW6GYhh6Q83wazVH76o4bJp39h3bSQuqzyDomrgfkqz
at P2pBackendHackmodePeer._ensureConnection (/Users/distiller/Library/Application Support/org.holochain.holochain/n3h-binaries/v0.0.12-alpha/n3h.app/Contents/Resources/app.asar/lib/hackmode/p2p-backend-hackmode-peer.js:264:13)
at P2pBackendHackmodePeer._ensureCIdForPeerAddress (/Users/distiller/Library/Application Support/org.holochain.holochain/n3h-binaries/v0.0.12-alpha/n3h.app/Contents/Resources/app.asar/lib/hackmode/p2p-backend-hackmode-peer.js:305:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
!C1! @@ fixme publish error catch @@ Error: Cannot connect to a peer with the same peerAddress: HcSci5QM4aBm7ake3ggieEzfzvoqp474szaAROeXRvdkxjiyO4QiORFPPxxfg4z
at P2pBackendHackmodePeer._ensureConnection (/Users/distiller/Library/Application Support/org.holochain.holochain/n3h-binaries/v0.0.12-alpha/n3h.app/Contents/Resour
nix-shell --run hc-app-spec-cluster-test
Finished release [optimized] target(s) in 0.40s
Installing hc v0.0.17-alpha2 (/Users/connor/code/holochain/rust/cli)
Finished release [optimized] target(s) in 0.42s
Replacing /Users/connor/code/holochain/rust/.cargo/bin/hc
Finished release [optimized] target(s) in 0.42s
Installing holochain v0.0.17-alpha2 (/Users/connor/code/holochain/rust/conductor)
Finished release [optimized] target(s) in 0.40s
Replacing /Users/connor/code/holochain/rust/.cargo/bin/holochain
npm WARN hc_cluster_test@0.0.1 No repository field.
This file has been truncated, but you can view the full file.
> basic-chat@1.0.0 start /Users/connor/code/holochain/ready-chat-mac-electron
> electron .
08:52:57.188 › Using config path: ./conductor-config.toml
Unlocking agent keys:
Unlocking key for agent 'test_agent1':
Reading keystore from ./keystore.key
08:53:06.865 › Spawning network with working directory: ./n3hfolder
@Connoropolous
Connoropolous / index.js
Created February 20, 2019 23:02
DHT hold rejection example
const { Config, Scenario } = require("@holochain/holochain-nodejs")
Scenario.setTape(require('tape-catch'))
const dnaPath = "./dist/bundle.json"
const agentAlice = Config.agent("alice")
const agentBob = Config.agent("bob")
const dna = Config.dna(dnaPath)
const instanceAlice = Config.instance(agentAlice, dna)
const instanceBob = Config.instance(agentBob, dna)