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**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```

View File

@ -1,12 +1,12 @@
/* global web3 */
import React from 'react';
import EmbarkJS from 'Embark/EmbarkJS';
import Phoenix from 'phoenix';
import Subspace from 'phoenix';
import Ranking from '../embarkArtifacts/contracts/Ranking';
import { scan, map } from 'rxjs/operators';
import RankItem from './RankItem';
const phoenix = new Phoenix(web3.currentProvider);
const subspace = new Subspace(web3.currentProvider);
const observables = {};
@ -22,9 +22,9 @@ class App extends React.Component {
return;
}
await phoenix.init()
await subspace.init()
observables.items = phoenix
observables.items = subspace
.trackEvent(Ranking, 'Rating', {filter: {}, fromBlock: 1})
.pipe(
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**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```

View File

@ -1,5 +1,5 @@
import React from "react";
import Phoenix from "phoenix";
import Subspace from "phoenix";
import { graphql } from "reactive-graphql";
import gql from "graphql-tag";
import { makeExecutableSchema } from "graphql-tools";
@ -38,7 +38,7 @@ class App extends React.Component {
};
async componentDidMount() {
const eventSyncer = new Phoenix(web3.currentProvider);
const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init();
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**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```

View File

@ -1,5 +1,5 @@
import React from "react";
import Phoenix from "phoenix";
import Subspace from "phoenix";
import web3 from './web3';
import MyContract from './MyContract';
import { connect } from "react-redux";
@ -13,7 +13,7 @@ class App extends React.Component {
async componentDidMount() {
MyContractInstance = await MyContract.getInstance();
const eventSyncer = new Phoenix(web3.currentProvider);
const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init();
eventSubscription = eventSyncer.trackEvent(MyContractInstance, "MyEvent", { filter: {}, fromBlock: 1 })
.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**.
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```

View File

@ -1,5 +1,5 @@
import React from "react";
import Phoenix from "phoenix";
import Subspace from "phoenix";
import { scan } from 'rxjs/operators';
import MyComponentObserver from "./MyComponentObserver";
import web3 from './web3';
@ -15,7 +15,7 @@ class App extends React.Component {
async componentDidMount() {
MyContractInstance = await MyContract.getInstance(); //
const eventSyncer = new Phoenix(web3.currentProvider);
const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init();
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
- `ganache-cli`
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```

View File

@ -1,4 +1,4 @@
const Phoenix = require('phoenix');
const Subspace = require('phoenix');
const web3 = require('./web3');
const MyContract = require('./MyContract');
const { pluck } = require('rxjs/operators');
@ -7,7 +7,7 @@ const gql = require("graphql-tag");
const { graphql } = require("reactive-graphql");
const run = (async () => {
const eventSyncer = new Phoenix(web3.currentProvider);
const eventSyncer = new Subspace(web3.currentProvider);
await eventSyncer.init();
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
- `ganache-cli`
@ -11,9 +11,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```
@ -28,7 +28,7 @@ In a different session, execute
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.

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 initPhoenix = () =>({type: INIT_PHOENIX});
export const phoenixReady = () => ({type: PHOENIX_READY});
export const initSubspace = () =>({type: INIT_SUBSPACE});
export const subspaceReady = () => ({type: SUBSPACE_READY});
export const myAction = (eventData) => ({ type: MY_ACTION, eventData });
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 PHOENIX_READY = "PHOENIX_READY";
export const SUBSPACE_READY = "SUBSPACE_READY";
export const MY_ACTION = "MY_ACTION";
export const DUMMY_TRANSACTION = "DUMMY_TRANSACTION";

View File

@ -3,8 +3,8 @@ import { myReducer } from "./reducer";
import { createEpicMiddleware } from "redux-observable";
import {
DEPLOY_CONTRACT,
INIT_PHOENIX,
PHOENIX_READY,
INIT_SUBSPACE,
SUBSPACE_READY,
DUMMY_TRANSACTION
} from "./constants";
import { mergeMap, map, mapTo, delay, filter } from "rxjs/operators";
@ -12,13 +12,13 @@ import MyContract from "./MyContract";
import { combineEpics } from "redux-observable";
import { ofType } from "redux-observable";
import {
initPhoenix,
phoenixReady,
initSubspace,
subspaceReady,
createDummyTransaction,
myAction
} from "./actions";
import web3 from "./web3";
import Phoenix from "phoenix";
import Subspace from "phoenix";
let MyContractInstance;
let eventSyncer;
@ -31,23 +31,23 @@ const deployContractEpic = action$ =>
}),
map(instance => {
MyContractInstance = instance;
return initPhoenix();
return initSubspace();
})
);
const initPhoenixEpic = action$ =>
const initSubspaceEpic = action$ =>
action$.pipe(
ofType(INIT_PHOENIX),
ofType(INIT_SUBSPACE),
mergeMap(() => {
eventSyncer = new Phoenix(web3.currentProvider);
eventSyncer = new Subspace(web3.currentProvider);
return eventSyncer.init();
}),
mapTo(phoenixReady())
mapTo(subspaceReady())
);
const trackEventEpic = action$ =>
action$.pipe(
ofType(PHOENIX_READY),
ofType(SUBSPACE_READY),
mergeMap(() => {
createDummyTransaction();
return eventSyncer
@ -64,7 +64,7 @@ const dummyTransactionEpic = action$ =>
action$.pipe(
filter(
action =>
action.type === PHOENIX_READY || action.type === DUMMY_TRANSACTION
action.type === SUBSPACE_READY || action.type === DUMMY_TRANSACTION
),
map(() => {
MyContractInstance.methods
@ -78,7 +78,7 @@ const dummyTransactionEpic = action$ =>
const rootEpic = combineEpics(
deployContractEpic,
initPhoenixEpic,
initSubspaceEpic,
trackEventEpic,
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**.
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
- `ganache-cli`
@ -12,9 +12,9 @@ In the parent folder, link the package with `yarn` or `npm`
```
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
```
@ -29,7 +29,7 @@ In a different session, execute
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.

View File

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

View File

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