chore: rename phoenix to subspace - pt1.

This commit is contained in:
Richard Ramos 2019-09-25 08:55:05 -04:00
parent 01c7b2a8be
commit a02be022c9
17 changed files with 61 additions and 61 deletions

View File

@ -1,4 +1,4 @@
phoenix - react example subspace - react example
=== ===
Simple application using a react observable component to receive a stream of emitted events. This app will deploy a test contract to **Ganache**. Simple application using a react observable component to receive a stream of emitted events. This app will deploy a test contract to **Ganache**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```

View File

@ -1,12 +1,12 @@
/* global web3 */ /* global web3 */
import React from 'react'; import React from 'react';
import EmbarkJS from 'Embark/EmbarkJS'; import EmbarkJS from 'Embark/EmbarkJS';
import Phoenix from 'phoenix'; import Subspace from 'phoenix';
import Ranking from '../embarkArtifacts/contracts/Ranking'; import Ranking from '../embarkArtifacts/contracts/Ranking';
import { scan, map } from 'rxjs/operators'; import { scan, map } from 'rxjs/operators';
import RankItem from './RankItem'; import RankItem from './RankItem';
const phoenix = new Phoenix(web3.currentProvider); const subspace = new Subspace(web3.currentProvider);
const observables = {}; const observables = {};
@ -22,9 +22,9 @@ class App extends React.Component {
return; return;
} }
await phoenix.init() await subspace.init()
observables.items = phoenix observables.items = subspace
.trackEvent(Ranking, 'Rating', {filter: {}, fromBlock: 1}) .trackEvent(Ranking, 'Rating', {filter: {}, fromBlock: 1})
.pipe( .pipe(
scan((acc, curr) => { scan((acc, curr) => {

View File

@ -1,4 +1,4 @@
phoenix - react-apollo example subspace - react-apollo example
=== ===
Simple application using Apollo to receive a stream of emitted events. This app will deploy a test contract to **Ganache**. Simple application using Apollo to receive a stream of emitted events. This app will deploy a test contract to **Ganache**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import Phoenix from "phoenix"; import Subspace from "phoenix";
import { graphql } from "reactive-graphql"; import { graphql } from "reactive-graphql";
import gql from "graphql-tag"; import gql from "graphql-tag";
import { makeExecutableSchema } from "graphql-tools"; import { makeExecutableSchema } from "graphql-tools";
@ -38,7 +38,7 @@ class App extends React.Component {
}; };
async componentDidMount() { async componentDidMount() {
const eventSyncer = new Phoenix(web3.currentProvider); const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init(); await eventSyncer.init();
MyContractInstance = await MyContract.getInstance(); MyContractInstance = await MyContract.getInstance();

View File

@ -1,4 +1,4 @@
phoenix - react and redux example subspace - react and redux example
=== ===
Simple application that dispatches a redux action whenever an event is emitted. This app will deploy a test contract to **Ganache**. Simple application that dispatches a redux action whenever an event is emitted. This app will deploy a test contract to **Ganache**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import Phoenix from "phoenix"; import Subspace from "phoenix";
import web3 from './web3'; import web3 from './web3';
import MyContract from './MyContract'; import MyContract from './MyContract';
import { connect } from "react-redux"; import { connect } from "react-redux";
@ -13,7 +13,7 @@ class App extends React.Component {
async componentDidMount() { async componentDidMount() {
MyContractInstance = await MyContract.getInstance(); MyContractInstance = await MyContract.getInstance();
const eventSyncer = new Phoenix(web3.currentProvider); const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init(); await eventSyncer.init();
eventSubscription = eventSyncer.trackEvent(MyContractInstance, "MyEvent", { filter: {}, fromBlock: 1 }) eventSubscription = eventSyncer.trackEvent(MyContractInstance, "MyEvent", { filter: {}, fromBlock: 1 })
.subscribe(this.props.myAction); .subscribe(this.props.myAction);

View File

@ -1,4 +1,4 @@
phoenix - react example subspace - react example
=== ===
Simple application using a react observable component to receive a stream of emitted events. This app will deploy a test contract to **Ganache**. Simple application using a react observable component to receive a stream of emitted events. This app will deploy a test contract to **Ganache**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import Phoenix from "phoenix"; import Subspace from "phoenix";
import { scan } from 'rxjs/operators'; import { scan } from 'rxjs/operators';
import MyComponentObserver from "./MyComponentObserver"; import MyComponentObserver from "./MyComponentObserver";
import web3 from './web3'; import web3 from './web3';
@ -15,7 +15,7 @@ class App extends React.Component {
async componentDidMount() { async componentDidMount() {
MyContractInstance = await MyContract.getInstance(); // MyContractInstance = await MyContract.getInstance(); //
const eventSyncer = new Phoenix(web3.currentProvider); const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init(); await eventSyncer.init();
const myEventObservable$ = eventSyncer.trackEvent(MyContractInstance, "MyEvent", {filter: {}, fromBlock: 1 }); const myEventObservable$ = eventSyncer.trackEvent(MyContractInstance, "MyEvent", {filter: {}, fromBlock: 1 });

View File

@ -1,6 +1,6 @@
phoenix - reactive-graphql example subspace - reactive-graphql example
=== ===
Simple application that shows how to use graphql queries with Phoenix observables Simple application that shows how to use graphql queries with Subspace observables
## Requirements ## Requirements
- `ganache-cli` - `ganache-cli`
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```

View File

@ -1,4 +1,4 @@
const Phoenix = require('phoenix'); const Subspace = require('phoenix');
const web3 = require('./web3'); const web3 = require('./web3');
const MyContract = require('./MyContract'); const MyContract = require('./MyContract');
const { pluck } = require('rxjs/operators'); const { pluck } = require('rxjs/operators');
@ -7,7 +7,7 @@ const gql = require("graphql-tag");
const { graphql } = require("reactive-graphql"); const { graphql } = require("reactive-graphql");
const run = (async () => { const run = (async () => {
const eventSyncer = new Phoenix(web3.currentProvider); const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init(); await eventSyncer.init();
const MyContractInstance = await MyContract.getInstance(); const MyContractInstance = await MyContract.getInstance();

View File

@ -1,6 +1,6 @@
phoenix - redux-observable example subspace - redux-observable example
=== ===
NodeJS application that uses `redux-observable` to initialize Phoenix, deploy a contract and periodically create a transaction. This app will deploy a test contract to **Ganache**. NodeJS application that uses `redux-observable` to initialize Subspace, deploy a contract and periodically create a transaction. This app will deploy a test contract to **Ganache**.
## Requirements ## Requirements
- `ganache-cli` - `ganache-cli`
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```
@ -28,7 +28,7 @@ In a different session, execute
node -r esm src/index.js node -r esm src/index.js
``` ```
You'll see in the console how the state changes everytime phoenix receives an event, and a new transaction is created every second or so. You'll see in the console how the state changes everytime subspace receives an event, and a new transaction is created every second or so.
*Note*: this is a simple example application that does not include error handling for the web3 connection. Be sure `ganache-cli` is running in `localhost:8545` before browsing the dapp. *Note*: this is a simple example application that does not include error handling for the web3 connection. Be sure `ganache-cli` is running in `localhost:8545` before browsing the dapp.

View File

@ -1,7 +1,7 @@
import { DEPLOY_CONTRACT, INIT_PHOENIX, PHOENIX_READY, MY_ACTION, DUMMY_TRANSACTION } from "./constants"; import { DEPLOY_CONTRACT, INIT_SUBSPACE, SUBSPACE_READY, MY_ACTION, DUMMY_TRANSACTION } from "./constants";
export const deployContract = () => ({type: DEPLOY_CONTRACT}); export const deployContract = () => ({type: DEPLOY_CONTRACT});
export const initPhoenix = () =>({type: INIT_PHOENIX}); export const initSubspace = () =>({type: INIT_SUBSPACE});
export const phoenixReady = () => ({type: PHOENIX_READY}); export const subspaceReady = () => ({type: SUBSPACE_READY});
export const myAction = (eventData) => ({ type: MY_ACTION, eventData }); export const myAction = (eventData) => ({ type: MY_ACTION, eventData });
export const createDummyTransaction = () => ({ type: DUMMY_TRANSACTION }); export const createDummyTransaction = () => ({ type: DUMMY_TRANSACTION });

View File

@ -1,6 +1,6 @@
export const INIT_PHOENIX = "INIT_PHOENIX"; export const INIT_SUBSPACE = "INIT_SUBSPACE";
export const DEPLOY_CONTRACT = "DEPLOY_CONTRACT"; export const DEPLOY_CONTRACT = "DEPLOY_CONTRACT";
export const PHOENIX_READY = "PHOENIX_READY"; export const SUBSPACE_READY = "SUBSPACE_READY";
export const MY_ACTION = "MY_ACTION"; export const MY_ACTION = "MY_ACTION";
export const DUMMY_TRANSACTION = "DUMMY_TRANSACTION"; export const DUMMY_TRANSACTION = "DUMMY_TRANSACTION";

View File

@ -3,8 +3,8 @@ import { myReducer } from "./reducer";
import { createEpicMiddleware } from "redux-observable"; import { createEpicMiddleware } from "redux-observable";
import { import {
DEPLOY_CONTRACT, DEPLOY_CONTRACT,
INIT_PHOENIX, INIT_SUBSPACE,
PHOENIX_READY, SUBSPACE_READY,
DUMMY_TRANSACTION DUMMY_TRANSACTION
} from "./constants"; } from "./constants";
import { mergeMap, map, mapTo, delay, filter } from "rxjs/operators"; import { mergeMap, map, mapTo, delay, filter } from "rxjs/operators";
@ -12,13 +12,13 @@ import MyContract from "./MyContract";
import { combineEpics } from "redux-observable"; import { combineEpics } from "redux-observable";
import { ofType } from "redux-observable"; import { ofType } from "redux-observable";
import { import {
initPhoenix, initSubspace,
phoenixReady, subspaceReady,
createDummyTransaction, createDummyTransaction,
myAction myAction
} from "./actions"; } from "./actions";
import web3 from "./web3"; import web3 from "./web3";
import Phoenix from "phoenix"; import Subspace from "phoenix";
let MyContractInstance; let MyContractInstance;
let eventSyncer; let eventSyncer;
@ -31,23 +31,23 @@ const deployContractEpic = action$ =>
}), }),
map(instance => { map(instance => {
MyContractInstance = instance; MyContractInstance = instance;
return initPhoenix(); return initSubspace();
}) })
); );
const initPhoenixEpic = action$ => const initSubspaceEpic = action$ =>
action$.pipe( action$.pipe(
ofType(INIT_PHOENIX), ofType(INIT_SUBSPACE),
mergeMap(() => { mergeMap(() => {
eventSyncer = new Phoenix(web3.currentProvider); eventSyncer = new Subspace(web3.currentProvider);
return eventSyncer.init(); return eventSyncer.init();
}), }),
mapTo(phoenixReady()) mapTo(subspaceReady())
); );
const trackEventEpic = action$ => const trackEventEpic = action$ =>
action$.pipe( action$.pipe(
ofType(PHOENIX_READY), ofType(SUBSPACE_READY),
mergeMap(() => { mergeMap(() => {
createDummyTransaction(); createDummyTransaction();
return eventSyncer return eventSyncer
@ -64,7 +64,7 @@ const dummyTransactionEpic = action$ =>
action$.pipe( action$.pipe(
filter( filter(
action => action =>
action.type === PHOENIX_READY || action.type === DUMMY_TRANSACTION action.type === SUBSPACE_READY || action.type === DUMMY_TRANSACTION
), ),
map(() => { map(() => {
MyContractInstance.methods MyContractInstance.methods
@ -78,7 +78,7 @@ const dummyTransactionEpic = action$ =>
const rootEpic = combineEpics( const rootEpic = combineEpics(
deployContractEpic, deployContractEpic,
initPhoenixEpic, initSubspaceEpic,
trackEventEpic, trackEventEpic,
dummyTransactionEpic dummyTransactionEpic
); );

View File

@ -1,7 +1,7 @@
phoenix - redux example subspcae - redux example
=== ===
Simple application that shows how to dispatch a redux action from an observable. This app will deploy a test contract to **Ganache**. Simple application that shows how to dispatch a redux action from an observable. This app will deploy a test contract to **Ganache**.
For using Phoenix with `react` and `redux`, please check `examples/react-redux` to see a practical example For using Subspace with `react` and `redux`, please check `examples/react-redux` to see a practical example
## Requirements ## Requirements
- `ganache-cli` - `ganache-cli`
@ -12,9 +12,9 @@ In the parent folder, link the package with `yarn` or `npm`
``` ```
yarn link yarn link
``` ```
Then in the current folder link `phoenix`, and install the packages Then in the current folder link `subspace`, and install the packages
``` ```
yarn link phoenix yarn link subspace
yarn yarn
``` ```
@ -29,7 +29,7 @@ In a different session, execute
node -r esm src/index.js node -r esm src/index.js
``` ```
You'll see in the console how the state changes everytime phoenix receives an event. You'll see in the console how the state changes everytime Subspace receives an event.
*Note*: this is a simple example application that does not include error handling for the web3 connection. Be sure `ganache-cli` is running in `localhost:8545` before executing the dapp. *Note*: this is a simple example application that does not include error handling for the web3 connection. Be sure `ganache-cli` is running in `localhost:8545` before executing the dapp.

View File

@ -1,6 +1,6 @@
import store from './store'; import store from './store';
import web3 from './web3'; import web3 from './web3';
import Phoenix from 'phoenix'; import Subspace from 'phoenix';
import { myAction } from './actions'; import { myAction } from './actions';
import MyContract from './MyContract'; import MyContract from './MyContract';
@ -13,7 +13,7 @@ store.subscribe(() => console.log("=====\n", store.getState()))
const run = async () => { const run = async () => {
const MyContractInstance = await MyContract.getInstance(); // const MyContractInstance = await MyContract.getInstance(); //
const eventSyncer = new Phoenix(web3.currentProvider); const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init(); await eventSyncer.init();
eventSyncer.trackEvent(MyContractInstance, "MyEvent", {filter: {}, fromBlock: 1 }) eventSyncer.trackEvent(MyContractInstance, "MyEvent", {filter: {}, fromBlock: 1 })

View File

@ -41,7 +41,7 @@ const web = {
output: { output: {
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, "dist"),
filename: "browser.js", filename: "browser.js",
library: "phoenix", library: "subspace",
libraryTarget: "umd" libraryTarget: "umd"
}, },
node: { node: {
@ -62,7 +62,7 @@ const react = {
output: { output: {
path: path.resolve(__dirname, "react"), path: path.resolve(__dirname, "react"),
filename: "index.js", filename: "index.js",
library: "phoenix-react", library: "subspace-react",
libraryTarget: "umd" libraryTarget: "umd"
} }
}; };
@ -87,7 +87,7 @@ const node = {
output: { output: {
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, "dist"),
filename: "node.js", filename: "node.js",
library: "phoenix", library: "subspace",
libraryTarget: "commonjs2" libraryTarget: "commonjs2"
}, },
optimization: { optimization: {