diff --git a/.gitignore b/.gitignore index dcddbe1..9cafa6c 100755 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ docker/reports # Lerna *.lerna_backup + +yarn-clean.sh diff --git a/packages/concordia-app/package.json b/packages/concordia-app/package.json index bbe624a..8727d5a 100644 --- a/packages/concordia-app/package.json +++ b/packages/concordia-app/package.json @@ -30,6 +30,7 @@ "@reduxjs/toolkit": "~1.4.0", "@welldone-software/why-did-you-render": "^6.0.0-rc.1", "concordia-contracts": "~0.1.0", + "concordia-shared": "~0.1.0", "i18next": "^19.8.3", "i18next-browser-languagedetector": "^6.0.1", "i18next-http-backend": "^1.0.21", diff --git a/packages/concordia-app/patches/web3-eth+1.3.3.patch b/packages/concordia-app/patches/web3-eth+1.3.4.patch similarity index 100% rename from packages/concordia-app/patches/web3-eth+1.3.3.patch rename to packages/concordia-app/patches/web3-eth+1.3.4.patch diff --git a/packages/concordia-app/src/components/InitializationScreen/index.jsx b/packages/concordia-app/src/components/InitializationScreen/index.jsx index 7a2dc5a..6ada2b8 100644 --- a/packages/concordia-app/src/components/InitializationScreen/index.jsx +++ b/packages/concordia-app/src/components/InitializationScreen/index.jsx @@ -1,11 +1,11 @@ import React, { Children } from 'react'; import { breezeConstants } from '@ezerous/breeze'; import { useSelector } from 'react-redux'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import CustomLoader from './CustomLoader'; // CSS import '../../assets/css/loading-component.css'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; const InitializationLoader = ({ children }) => { const initializing = useSelector((state) => state.drizzleStatus.initializing); diff --git a/packages/concordia-app/src/components/PostCreate/index.jsx b/packages/concordia-app/src/components/PostCreate/index.jsx index 27d966a..b912417 100644 --- a/packages/concordia-app/src/components/PostCreate/index.jsx +++ b/packages/concordia-app/src/components/PostCreate/index.jsx @@ -7,16 +7,16 @@ import { import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { POSTS_DATABASE, USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; +import { POST_CREATED_EVENT } from 'concordia-shared/src/constants/contracts/events/ForumContractEvents'; import determineKVAddress from '../../utils/orbitUtils'; -import { POSTS_DATABASE, USER_DATABASE } from '../../constants/orbit/OrbitDatabases'; import { FETCH_USER_DATABASE } from '../../redux/actions/peerDbReplicationActions'; import { USER_PROFILE_PICTURE } from '../../constants/orbit/UserDatabaseKeys'; import { breeze, drizzle } from '../../redux/store'; import './styles.css'; import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../constants/TransactionStatus'; import { POST_CONTENT } from '../../constants/orbit/PostsDatabaseKeys'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; -import { POST_CREATED_EVENT } from '../../constants/contracts/events/ForumContractEvents'; const { contracts: { [FORUM_CONTRACT]: { methods: { createPost } } } } = drizzle; const { orbit } = breeze; diff --git a/packages/concordia-app/src/components/PostList/PostListRow/index.jsx b/packages/concordia-app/src/components/PostList/PostListRow/index.jsx index 8814374..de93824 100644 --- a/packages/concordia-app/src/components/PostList/PostListRow/index.jsx +++ b/packages/concordia-app/src/components/PostList/PostListRow/index.jsx @@ -9,14 +9,14 @@ import { useTranslation } from 'react-i18next'; import TimeAgo from 'react-timeago'; import { useDispatch, useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { POSTS_DATABASE, USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import { FETCH_USER_DATABASE } from '../../../redux/actions/peerDbReplicationActions'; import { breeze } from '../../../redux/store'; import './styles.css'; -import { POSTS_DATABASE, USER_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import determineKVAddress from '../../../utils/orbitUtils'; import { USER_PROFILE_PICTURE } from '../../../constants/orbit/UserDatabaseKeys'; import { POST_CONTENT } from '../../../constants/orbit/PostsDatabaseKeys'; -import { FORUM_CONTRACT } from '../../../constants/contracts/ContractNames'; const { orbit } = breeze; diff --git a/packages/concordia-app/src/components/PostList/index.jsx b/packages/concordia-app/src/components/PostList/index.jsx index a967ccd..504a3a7 100644 --- a/packages/concordia-app/src/components/PostList/index.jsx +++ b/packages/concordia-app/src/components/PostList/index.jsx @@ -4,9 +4,9 @@ import React, { import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { Dimmer, Feed, Loader } from 'semantic-ui-react'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import PostListRow from './PostListRow'; import { drizzle } from '../../redux/store'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; const { contracts: { [FORUM_CONTRACT]: { methods: { getPost: { cacheCall: getPostChainData } } } } } = drizzle; diff --git a/packages/concordia-app/src/components/TopicList/TopicListRow/index.jsx b/packages/concordia-app/src/components/TopicList/TopicListRow/index.jsx index fd96bf4..1a50ba9 100644 --- a/packages/concordia-app/src/components/TopicList/TopicListRow/index.jsx +++ b/packages/concordia-app/src/components/TopicList/TopicListRow/index.jsx @@ -10,14 +10,14 @@ import TimeAgo from 'react-timeago'; import { useHistory } from 'react-router'; import { useDispatch, useSelector } from 'react-redux'; import { Link } from 'react-router-dom'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { TOPICS_DATABASE, USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import { FETCH_USER_DATABASE } from '../../../redux/actions/peerDbReplicationActions'; import { breeze } from '../../../redux/store'; import './styles.css'; -import { TOPICS_DATABASE, USER_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import determineKVAddress from '../../../utils/orbitUtils'; import { USER_PROFILE_PICTURE } from '../../../constants/orbit/UserDatabaseKeys'; import { TOPIC_SUBJECT } from '../../../constants/orbit/TopicsDatabaseKeys'; -import { FORUM_CONTRACT } from '../../../constants/contracts/ContractNames'; const { orbit } = breeze; diff --git a/packages/concordia-app/src/components/TopicList/index.jsx b/packages/concordia-app/src/components/TopicList/index.jsx index 8a85f4e..8a6b9fd 100644 --- a/packages/concordia-app/src/components/TopicList/index.jsx +++ b/packages/concordia-app/src/components/TopicList/index.jsx @@ -4,9 +4,9 @@ import React, { import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { List } from 'semantic-ui-react'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import TopicListRow from './TopicListRow'; import { drizzle } from '../../redux/store'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; const { contracts: { [FORUM_CONTRACT]: { methods: { getTopic: { cacheCall: getTopicChainData } } } } } = drizzle; diff --git a/packages/concordia-app/src/components/UsernameSelector.jsx b/packages/concordia-app/src/components/UsernameSelector.jsx index 8323757..72d9eb3 100644 --- a/packages/concordia-app/src/components/UsernameSelector.jsx +++ b/packages/concordia-app/src/components/UsernameSelector.jsx @@ -6,8 +6,8 @@ import throttle from 'lodash/throttle'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import { drizzle } from '../redux/store'; -import { FORUM_CONTRACT } from '../constants/contracts/ContractNames'; const { contracts: { [FORUM_CONTRACT]: { methods: { isUserNameTaken } } } } = drizzle; diff --git a/packages/concordia-app/src/constants/configuration/defaults.js b/packages/concordia-app/src/constants/configuration/defaults.js index c288c9c..5c94c7b 100644 --- a/packages/concordia-app/src/constants/configuration/defaults.js +++ b/packages/concordia-app/src/constants/configuration/defaults.js @@ -1,14 +1,2 @@ -export const WEB3_HOST_DEFAULT = '127.0.0.1'; -export const WEB3_PORT_DEFAULT = '8545'; -export const WEB3_PORT_SOCKET_TIMEOUT_DEFAULT = 30000; -export const WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT = 3; - -export const REACT_APP_CONCORDIA_HOST_DEFAULT = '127.0.0.1'; -export const REACT_APP_CONCORDIA_PORT_DEFAULT = '7000'; - -export const REACT_APP_RENDEZVOUS_HOST_DEFAULT = '127.0.0.1'; -export const REACT_APP_RENDEZVOUS_PORT_DEFAULT = '9090'; - -export const REACT_APP_CONTRACTS_SUPPLIER_HOST_DEFAULT = '127.0.0.1'; -export const REACT_APP_CONTRACTS_SUPPLIER_PORT_DEFAULT = '8400'; -export const REACT_APP_CONTRACTS_VERSION_HASH_DEFAULT = 'latest'; +export const CONCORDIA_HOST_DEFAULT = '127.0.0.1'; +export const CONCORDIA_PORT_DEFAULT = '7000'; diff --git a/packages/concordia-app/src/constants/contracts/ContractNames.js b/packages/concordia-app/src/constants/contracts/ContractNames.js deleted file mode 100644 index 52990a1..0000000 --- a/packages/concordia-app/src/constants/contracts/ContractNames.js +++ /dev/null @@ -1,11 +0,0 @@ -export const FORUM_CONTRACT = 'Forum'; -export const POST_VOTING_CONTRACT = 'PostVoting'; -export const VOTING_CONTRACT = 'Voting'; - -const CONTRACTS = [ - FORUM_CONTRACT, - POST_VOTING_CONTRACT, - VOTING_CONTRACT, -]; - -export default CONTRACTS; diff --git a/packages/concordia-app/src/constants/contracts/events/ForumContractEvents.js b/packages/concordia-app/src/constants/contracts/events/ForumContractEvents.js deleted file mode 100644 index f0f9a34..0000000 --- a/packages/concordia-app/src/constants/contracts/events/ForumContractEvents.js +++ /dev/null @@ -1,13 +0,0 @@ -export const USER_SIGNED_UP_EVENT = 'UserSignedUp'; -export const USERNAME_UPDATED_EVENT = 'UsernameUpdated'; -export const TOPIC_CREATED_EVENT = 'TopicCreated'; -export const POST_CREATED_EVENT = 'PostCreated'; - -const forumContractEvents = [ - USER_SIGNED_UP_EVENT, - USERNAME_UPDATED_EVENT, - TOPIC_CREATED_EVENT, - POST_CREATED_EVENT, -]; - -export default forumContractEvents; diff --git a/packages/concordia-app/src/constants/contracts/events/index.js b/packages/concordia-app/src/constants/contracts/events/index.js deleted file mode 100644 index 870bd36..0000000 --- a/packages/concordia-app/src/constants/contracts/events/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import { FORUM_CONTRACT } from '../ContractNames'; -import forumContractEvents from './ForumContractEvents'; - -const appEvents = { - [FORUM_CONTRACT]: forumContractEvents, -}; - -export default appEvents; diff --git a/packages/concordia-app/src/options/breezeOptions.js b/packages/concordia-app/src/options/breezeOptions.js deleted file mode 100644 index 3f3a15f..0000000 --- a/packages/concordia-app/src/options/breezeOptions.js +++ /dev/null @@ -1,40 +0,0 @@ -import { EthereumContractIdentityProvider } from '@ezerous/eth-identity-provider'; -import databases from '../constants/orbit/OrbitDatabases'; -import { - REACT_APP_RENDEZVOUS_HOST_DEFAULT, - REACT_APP_RENDEZVOUS_PORT_DEFAULT, -} from '../constants/configuration/defaults'; - -const REACT_APP_RENDEZVOUS_HOST = process.env.REACT_APP_RENDEZVOUS_HOST || REACT_APP_RENDEZVOUS_HOST_DEFAULT; -const REACT_APP_RENDEZVOUS_PORT = process.env.REACT_APP_RENDEZVOUS_PORT || REACT_APP_RENDEZVOUS_PORT_DEFAULT; - -const breezeOptions = { - ipfs: { - repo: 'concordia', - config: { - Addresses: { - Swarm: [ - // Use local signaling server (see also rendezvous script in package.json) - // For more information: https://github.com/libp2p/js-libp2p-webrtc-star - `/ip4/${REACT_APP_RENDEZVOUS_HOST}/tcp/${REACT_APP_RENDEZVOUS_PORT}/wss/p2p-webrtc-star`, - - // Use the following public servers if needed - // '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star', - // '/dns4/ wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star' - ], - }, - }, - preload: { - enabled: false, - }, - init: { - emptyRepo: true, - }, - }, - orbit: { - identityProvider: EthereumContractIdentityProvider, - databases, - }, -}; - -export default breezeOptions; diff --git a/packages/concordia-app/src/options/drizzleOptions.js b/packages/concordia-app/src/options/drizzleOptions.js index 9bb664d..ba6b211 100644 --- a/packages/concordia-app/src/options/drizzleOptions.js +++ b/packages/concordia-app/src/options/drizzleOptions.js @@ -1,17 +1,18 @@ // Check out the documentation: https://truffleframework.com/docs/drizzle/reference/drizzle-options import { contracts } from 'concordia-contracts'; -import web3Options from './web3Options'; -import appEvents from '../constants/contracts/events'; +import { getWeb3Configuration } from 'concordia-shared/src/configuration/web3Configuration'; +import Web3 from 'web3'; +import appEvents from 'concordia-shared/src/constants/contracts/events'; import downloadContractArtifactsSync from '../utils/drizzleUtils'; const drizzleOptions = { - web3: web3Options, + web3: getWeb3Configuration(Web3), events: { ...appEvents }, reloadWindowOnNetworkChange: true, reloadWindowOnAccountChange: true, // We need it to reinitialize breeze and create new Orbit databases }; -if (process.env.REACT_APP_USE_EXTERNAL_CONTRACTS_SUPPLIER) { +if (process.env.REACT_APP_USE_EXTERNAL_CONTRACTS_PROVIDER) { drizzleOptions.contracts = downloadContractArtifactsSync(); } else { drizzleOptions.contracts = contracts; diff --git a/packages/concordia-app/src/options/web3Options.js b/packages/concordia-app/src/options/web3Options.js deleted file mode 100644 index ded958c..0000000 --- a/packages/concordia-app/src/options/web3Options.js +++ /dev/null @@ -1,29 +0,0 @@ -import Web3 from 'web3'; -import { - WEB3_HOST_DEFAULT, - WEB3_PORT_DEFAULT, - WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT, - WEB3_PORT_SOCKET_TIMEOUT_DEFAULT, -} from '../constants/configuration/defaults'; - -const { WEB3_HOST, WEB3_PORT, WEBSOCKET_TIMEOUT } = process.env; - -const web3WebsocketOptions = { - keepAlive: true, - timeout: WEBSOCKET_TIMEOUT !== undefined ? WEBSOCKET_TIMEOUT : WEB3_PORT_SOCKET_TIMEOUT_DEFAULT, - reconnect: { - maxAttempts: WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT, - }, -}; - -const web3 = (WEB3_HOST !== undefined && WEB3_PORT !== undefined) - ? new Web3(new Web3.providers.WebsocketProvider(`ws://${WEB3_HOST}:${WEB3_PORT}`)) - : new Web3(Web3.givenProvider || new Web3.providers.WebsocketProvider( - `ws://${WEB3_HOST_DEFAULT}:${WEB3_PORT_DEFAULT}`, web3WebsocketOptions, - )); - -const web3Options = { - customProvider: web3, -}; - -export default web3Options; diff --git a/packages/concordia-app/src/redux/actions/contractEventActions.js b/packages/concordia-app/src/redux/actions/contractEventActions.js index a7b250e..36a7aea 100644 --- a/packages/concordia-app/src/redux/actions/contractEventActions.js +++ b/packages/concordia-app/src/redux/actions/contractEventActions.js @@ -3,7 +3,7 @@ import { TOPIC_CREATED_EVENT, USER_SIGNED_UP_EVENT, USERNAME_UPDATED_EVENT, -} from '../../constants/contracts/events/ForumContractEvents'; +} from 'concordia-shared/src/constants/contracts/events/ForumContractEvents'; export const FORUM_EVENT_USER_SIGNED_UP = 'FORUM_EVENT_USER_SIGNED_UP'; export const FORUM_EVENT_USERNAME_UPDATED = 'FORUM_EVENT_USERNAME_UPDATED'; diff --git a/packages/concordia-app/src/redux/sagas/orbitSaga.js b/packages/concordia-app/src/redux/sagas/orbitSaga.js index 385295b..1e3a8c4 100644 --- a/packages/concordia-app/src/redux/sagas/orbitSaga.js +++ b/packages/concordia-app/src/redux/sagas/orbitSaga.js @@ -7,7 +7,7 @@ import { drizzleActions } from '@ezerous/drizzle'; import { contracts } from 'concordia-contracts'; import { EthereumContractIdentityProvider } from '@ezerous/eth-identity-provider'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; function* initOrbitDatabases(action) { const { account, breeze } = action; diff --git a/packages/concordia-app/src/redux/sagas/peerDbReplicationSaga.js b/packages/concordia-app/src/redux/sagas/peerDbReplicationSaga.js index 0ed1896..969195d 100644 --- a/packages/concordia-app/src/redux/sagas/peerDbReplicationSaga.js +++ b/packages/concordia-app/src/redux/sagas/peerDbReplicationSaga.js @@ -7,9 +7,9 @@ import { ORBIT_DB_REPLICATED, ORBIT_DB_WRITE, } from '@ezerous/breeze/src/orbit/orbitActions'; +import { POSTS_DATABASE, TOPICS_DATABASE, USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import determineKVAddress from '../../utils/orbitUtils'; import { FETCH_USER_DATABASE, UPDATE_ORBIT_DATA } from '../actions/peerDbReplicationActions'; -import { POSTS_DATABASE, TOPICS_DATABASE, USER_DATABASE } from '../../constants/orbit/OrbitDatabases'; import userDatabaseKeys from '../../constants/orbit/UserDatabaseKeys'; import { TOPIC_SUBJECT } from '../../constants/orbit/TopicsDatabaseKeys'; import { POST_CONTENT } from '../../constants/orbit/PostsDatabaseKeys'; diff --git a/packages/concordia-app/src/redux/sagas/userSaga.js b/packages/concordia-app/src/redux/sagas/userSaga.js index ac06fd2..ed7ae8b 100644 --- a/packages/concordia-app/src/redux/sagas/userSaga.js +++ b/packages/concordia-app/src/redux/sagas/userSaga.js @@ -3,9 +3,9 @@ import { all, call, put, take, takeLatest, } from 'redux-saga/effects'; import { drizzleActions } from '@ezerous/drizzle'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import { USER_DATA_UPDATED, USER_DATA_ERROR } from '../actions/userActions'; import { FORUM_EVENT_USER_SIGNED_UP } from '../actions/contractEventActions'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; function* fetchUserData({ drizzle, account }) { const contract = drizzle.contracts[FORUM_CONTRACT]; diff --git a/packages/concordia-app/src/redux/store.js b/packages/concordia-app/src/redux/store.js index 8ed1b9e..34dedbe 100644 --- a/packages/concordia-app/src/redux/store.js +++ b/packages/concordia-app/src/redux/store.js @@ -4,11 +4,12 @@ import { } from '@ezerous/drizzle'; import { Breeze, breezeReducers } from '@ezerous/breeze'; import createSagaMiddleware from 'redux-saga'; +import getBreezeConfiguration from 'concordia-shared/src/configuration/breezeConfiguration'; +import { EthereumContractIdentityProvider } from '@ezerous/eth-identity-provider'; import userReducer from './reducers/userReducer'; import rootSaga from './sagas/rootSaga'; import drizzleOptions from '../options/drizzleOptions'; import peerDbReplicationReducer from './reducers/peerDbReplicationReducer'; -import breezeOptions from '../options/breezeOptions'; const initialState = { contracts: generateContractsInitialState(drizzleOptions), @@ -27,8 +28,12 @@ const store = configureStore({ preloadedState: initialState, }); +const breezeConfiguration = getBreezeConfiguration(EthereumContractIdentityProvider, + process.env.REACT_APP_RENDEZVOUS_HOST, + process.env.REACT_APP_RENDEZVOUS_PORT); + export const drizzle = new Drizzle(drizzleOptions, store); -export const breeze = new Breeze(breezeOptions, store); +export const breeze = new Breeze(breezeConfiguration, store); sagaMiddleware.run(rootSaga); export default store; diff --git a/packages/concordia-app/src/utils/drizzleUtils.js b/packages/concordia-app/src/utils/drizzleUtils.js index 5496d85..59208f2 100755 --- a/packages/concordia-app/src/utils/drizzleUtils.js +++ b/packages/concordia-app/src/utils/drizzleUtils.js @@ -1,26 +1,22 @@ +import { CONTRACTS } from 'concordia-shared/src/constants/contracts/ContractNames'; import { - REACT_APP_CONCORDIA_HOST_DEFAULT, - REACT_APP_CONCORDIA_PORT_DEFAULT, - REACT_APP_CONTRACTS_SUPPLIER_HOST_DEFAULT, - REACT_APP_CONTRACTS_SUPPLIER_PORT_DEFAULT, - REACT_APP_CONTRACTS_VERSION_HASH_DEFAULT, + contractsProviderHost, + contractsProviderPort, + contractsVersionHash, +} from 'concordia-shared/src/environment/interpolated/contractsProvider'; +import { + CONCORDIA_HOST_DEFAULT, + CONCORDIA_PORT_DEFAULT, } from '../constants/configuration/defaults'; -import CONTRACTS from '../constants/contracts/ContractNames'; function getContractsDownloadRequest() { - const CONTRACTS_SUPPLIER_HOST = process.env.REACT_APP_CONTRACTS_SUPPLIER_HOST - || REACT_APP_CONTRACTS_SUPPLIER_HOST_DEFAULT; - const CONTRACTS_SUPPLIER_PORT = process.env.REACT_APP_CONTRACTS_SUPPLIER_PORT - || REACT_APP_CONTRACTS_SUPPLIER_PORT_DEFAULT; - const CONTRACTS_VERSION_HASH = process.env.REACT_APP_CONTRACTS_VERSION_HASH - || REACT_APP_CONTRACTS_VERSION_HASH_DEFAULT; - const HOST = process.env.REACT_APP_CONCORDIA_HOST || REACT_APP_CONCORDIA_HOST_DEFAULT; - const PORT = process.env.REACT_APP_CONCORDIA_PORT || REACT_APP_CONCORDIA_PORT_DEFAULT; + const HOST = process.env.REACT_APP_CONCORDIA_HOST || CONCORDIA_HOST_DEFAULT; + const PORT = process.env.REACT_APP_CONCORDIA_PORT || CONCORDIA_PORT_DEFAULT; const xhrRequest = new XMLHttpRequest(); xhrRequest.open('GET', - `http://${CONTRACTS_SUPPLIER_HOST}:${CONTRACTS_SUPPLIER_PORT}/contracts/${CONTRACTS_VERSION_HASH}`, + `http://${contractsProviderHost}:${contractsProviderPort}/contracts/${contractsVersionHash}`, false); xhrRequest.setRequestHeader('Access-Control-Allow-Origin', `${HOST}:${PORT}`); xhrRequest.setRequestHeader('Access-Control-Allow-Credentials', 'true'); @@ -40,7 +36,7 @@ function validateRemoteContracts(remoteContracts) { })); if (contractsPresentStatus.reduce((accumulator, contract) => accumulator && contract.present, true)) { - throw new Error(`Contracts missing from artifacts. Supplier didn't bring ${contractsPresentStatus + throw new Error(`Contracts missing from artifacts. Provider didn't bring ${contractsPresentStatus .filter((contractPresentStatus) => contractPresentStatus.present === false) .map((contractPresentStatus) => contractPresentStatus.contract) .join(', ')}.`); diff --git a/packages/concordia-app/src/views/Home/index.jsx b/packages/concordia-app/src/views/Home/index.jsx index 989d684..73613d5 100644 --- a/packages/concordia-app/src/views/Home/index.jsx +++ b/packages/concordia-app/src/views/Home/index.jsx @@ -3,10 +3,10 @@ import React, { } from 'react'; import { Container } from 'semantic-ui-react'; import { useSelector } from 'react-redux'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import Board from './Board'; import './styles.css'; import { drizzle } from '../../redux/store'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; const { contracts: { [FORUM_CONTRACT]: { methods: { numTopics } } } } = drizzle; diff --git a/packages/concordia-app/src/views/Profile/GeneralTab/EditInformationModal/index.jsx b/packages/concordia-app/src/views/Profile/GeneralTab/EditInformationModal/index.jsx index 1290c7e..d86f395 100644 --- a/packages/concordia-app/src/views/Profile/GeneralTab/EditInformationModal/index.jsx +++ b/packages/concordia-app/src/views/Profile/GeneralTab/EditInformationModal/index.jsx @@ -6,12 +6,12 @@ import { } from 'semantic-ui-react'; import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import checkUrlValid from '../../../../utils/urlUtils'; import { USER_LOCATION, USER_PROFILE_PICTURE } from '../../../../constants/orbit/UserDatabaseKeys'; -import { USER_DATABASE } from '../../../../constants/orbit/OrbitDatabases'; import { breeze, drizzle } from '../../../../redux/store'; import UsernameSelector from '../../../../components/UsernameSelector'; -import { FORUM_CONTRACT } from '../../../../constants/contracts/ContractNames'; const { orbit: { stores } } = breeze; const { contracts: { [FORUM_CONTRACT]: { methods: { updateUsername } } } } = drizzle; diff --git a/packages/concordia-app/src/views/Profile/GeneralTab/index.jsx b/packages/concordia-app/src/views/Profile/GeneralTab/index.jsx index 2515bea..74fd9ef 100644 --- a/packages/concordia-app/src/views/Profile/GeneralTab/index.jsx +++ b/packages/concordia-app/src/views/Profile/GeneralTab/index.jsx @@ -5,8 +5,8 @@ import { import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; +import { USER_DATABASE, databases } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import determineKVAddress from '../../../utils/orbitUtils'; -import databases, { USER_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import { FETCH_USER_DATABASE } from '../../../redux/actions/peerDbReplicationActions'; import { breeze } from '../../../redux/store'; import { USER_LOCATION, USER_PROFILE_PICTURE } from '../../../constants/orbit/UserDatabaseKeys'; diff --git a/packages/concordia-app/src/views/Profile/index.jsx b/packages/concordia-app/src/views/Profile/index.jsx index 2126536..7751e51 100644 --- a/packages/concordia-app/src/views/Profile/index.jsx +++ b/packages/concordia-app/src/views/Profile/index.jsx @@ -5,8 +5,8 @@ import { Container, Header, Tab } from 'semantic-ui-react'; import { useSelector } from 'react-redux'; import { useHistory, useRouteMatch } from 'react-router'; import { useTranslation } from 'react-i18next'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import { drizzle } from '../../redux/store'; -import { FORUM_CONTRACT } from '../../constants/contracts/ContractNames'; import CustomLoadingTabPane from '../../components/CustomLoadingTabPane'; import TopicList from '../../components/TopicList'; import PostList from '../../components/PostList'; diff --git a/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx b/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx index 1ac1cdb..5cf10d9 100644 --- a/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx +++ b/packages/concordia-app/src/views/Register/PersonalInformationStep/index.jsx @@ -7,10 +7,10 @@ import { import { useTranslation } from 'react-i18next'; import PropTypes from 'prop-types'; import { useHistory } from 'react-router'; +import { USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import checkUrlValid from '../../../utils/urlUtils'; import { breeze } from '../../../redux/store'; import './styles.css'; -import { USER_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import { USER_LOCATION, USER_PROFILE_PICTURE } from '../../../constants/orbit/UserDatabaseKeys'; const { orbit: { stores } } = breeze; diff --git a/packages/concordia-app/src/views/Register/SignUpStep/index.jsx b/packages/concordia-app/src/views/Register/SignUpStep/index.jsx index 7e8cb8b..e4d494c 100644 --- a/packages/concordia-app/src/views/Register/SignUpStep/index.jsx +++ b/packages/concordia-app/src/views/Register/SignUpStep/index.jsx @@ -6,9 +6,9 @@ import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { useHistory } from 'react-router'; import PropTypes from 'prop-types'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; import { drizzle } from '../../../redux/store'; import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../../constants/TransactionStatus'; -import { FORUM_CONTRACT } from '../../../constants/contracts/ContractNames'; import UsernameSelector from '../../../components/UsernameSelector'; const { contracts: { [FORUM_CONTRACT]: { methods: { signUp } } } } = drizzle; diff --git a/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx b/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx index 9fa5759..d43157b 100644 --- a/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx +++ b/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx @@ -8,13 +8,13 @@ import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router'; import { useSelector } from 'react-redux'; import './styles.css'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { TOPIC_CREATED_EVENT } from 'concordia-shared/src/constants/contracts/events/ForumContractEvents'; +import { POSTS_DATABASE, TOPICS_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import { drizzle, breeze } from '../../../redux/store'; import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../../constants/TransactionStatus'; -import { POSTS_DATABASE, TOPICS_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import { TOPIC_SUBJECT } from '../../../constants/orbit/TopicsDatabaseKeys'; import { POST_CONTENT } from '../../../constants/orbit/PostsDatabaseKeys'; -import { FORUM_CONTRACT } from '../../../constants/contracts/ContractNames'; -import { TOPIC_CREATED_EVENT } from '../../../constants/contracts/events/ForumContractEvents'; const { contracts: { [FORUM_CONTRACT]: { methods: { createTopic } } } } = drizzle; const { orbit: { stores } } = breeze; diff --git a/packages/concordia-app/src/views/Topic/TopicView/index.jsx b/packages/concordia-app/src/views/Topic/TopicView/index.jsx index c0ca6c8..406bb2e 100644 --- a/packages/concordia-app/src/views/Topic/TopicView/index.jsx +++ b/packages/concordia-app/src/views/Topic/TopicView/index.jsx @@ -7,16 +7,16 @@ import { import { Link } from 'react-router-dom'; import { useHistory } from 'react-router'; import TimeAgo from 'react-timeago'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import { TOPICS_DATABASE, USER_DATABASE } from 'concordia-shared/src/constants/orbit/OrbitDatabases'; import { breeze, drizzle } from '../../../redux/store'; import { FETCH_USER_DATABASE } from '../../../redux/actions/peerDbReplicationActions'; import './styles.css'; import PostList from '../../../components/PostList'; -import { TOPICS_DATABASE, USER_DATABASE } from '../../../constants/orbit/OrbitDatabases'; import determineKVAddress from '../../../utils/orbitUtils'; import { USER_PROFILE_PICTURE } from '../../../constants/orbit/UserDatabaseKeys'; import { TOPIC_SUBJECT } from '../../../constants/orbit/TopicsDatabaseKeys'; import PostCreate from '../../../components/PostCreate'; -import { FORUM_CONTRACT } from '../../../constants/contracts/ContractNames'; const { contracts: { [FORUM_CONTRACT]: { methods: { getTopic: { cacheCall: getTopicChainData } } } } } = drizzle; const { orbit } = breeze; diff --git a/packages/concordia-contracts-provider/package.json b/packages/concordia-contracts-provider/package.json index f9eacb7..ae24260 100755 --- a/packages/concordia-contracts-provider/package.json +++ b/packages/concordia-contracts-provider/package.json @@ -5,10 +5,12 @@ "private": true, "main": "src/index.js", "scripts": { - "start": "node -r esm src/index.js" + "start": "node -r esm src/index.js", + "lint": "eslint --ext js,jsx . --format table" }, "license": "MIT", "dependencies": { + "concordia-shared": "~0.1.0", "cors": "^2.8.5", "esm": "~3.2.25", "express": "^4.17.1", diff --git a/packages/concordia-contracts-provider/src/constants.js b/packages/concordia-contracts-provider/src/constants.js index fbe54de..4c65196 100755 --- a/packages/concordia-contracts-provider/src/constants.js +++ b/packages/concordia-contracts-provider/src/constants.js @@ -1,11 +1,9 @@ import path from 'path'; -const PROVIDER_PORT = '8400'; const UPLOAD_CONTRACTS_DIRECTORY = path.join(__dirname, '..', 'contracts-uploads'); const CORS_ALLOWED_ORIGINS = ['http://127.0.0.1:7000', 'http://localhost:7000']; export default { - port: PROVIDER_PORT, uploadsDirectory: UPLOAD_CONTRACTS_DIRECTORY, corsAllowedOrigins: CORS_ALLOWED_ORIGINS, }; diff --git a/packages/concordia-contracts-provider/src/index.js b/packages/concordia-contracts-provider/src/index.js index 605d10c..8aecb85 100755 --- a/packages/concordia-contracts-provider/src/index.js +++ b/packages/concordia-contracts-provider/src/index.js @@ -1,10 +1,10 @@ import express from 'express'; import cors from 'cors'; import helmet from 'helmet'; +import { contractsProviderPort } from 'concordia-shared/src/environment/interpolated/contractsProvider'; import initRoutes from './routes/web'; import constants from './constants'; -const PROVIDER_PORT = process.env.CONTRACTS_PROVIDER_PORT || constants.port; const ALLOWED_ORIGINS = process.env.CORS_ALLOWED_ORIGINS ? process.env.CORS_ALLOWED_ORIGINS.split(';') : constants.corsAllowedOrigins; @@ -22,6 +22,6 @@ app.use(helmet()); initRoutes(app); -app.listen(PROVIDER_PORT, () => { - console.log(`Contracts provider listening at http://127.0.0.1:${PROVIDER_PORT}`); +app.listen(contractsProviderPort, () => { + console.log(`Contracts provider listening at http://127.0.0.1:${contractsProviderPort}`); }); diff --git a/packages/concordia-contracts/.eslintrc.js b/packages/concordia-contracts/.eslintrc.js index f4fd0dd..eb1cf53 100644 --- a/packages/concordia-contracts/.eslintrc.js +++ b/packages/concordia-contracts/.eslintrc.js @@ -32,7 +32,7 @@ module.exports = { 'no-console': 'warn', 'no-shadow': 'warn', 'no-multi-str': 'warn', - 'one-var': ["error", { "uninitialized": "always" }], + 'one-var': ["error", {"uninitialized": "always"}], 'one-var-declaration-per-line': ['error', 'initializations'] }, 'settings': { diff --git a/packages/concordia-contracts/constants/config/defaults.js b/packages/concordia-contracts/constants/config/defaults.js deleted file mode 100644 index 10941e0..0000000 --- a/packages/concordia-contracts/constants/config/defaults.js +++ /dev/null @@ -1,21 +0,0 @@ -const DEVELOP_CHAIN_HOST_DEFAULT = '127.0.0.1'; -const DEVELOP_CHAIN_PORT_DEFAULT = '8545'; - -const TEST_CHAIN_HOST_DEFAULT = '127.0.0.1'; -const TEST_CHAIN_PORT_DEFAULT = '8546'; - -const CONTRACTS_PROVIDER_HOST_DEFAULT = '127.0.0.1'; -const CONTRACTS_PROVIDER_PORT_DEFAULT = '8400'; - -module.exports = { - develop: { - chainHost: DEVELOP_CHAIN_HOST_DEFAULT, - chainPort: DEVELOP_CHAIN_PORT_DEFAULT, - }, - test: { - chainHost: TEST_CHAIN_HOST_DEFAULT, - chainPort: TEST_CHAIN_PORT_DEFAULT, - }, - contractsProviderHost: CONTRACTS_PROVIDER_HOST_DEFAULT, - contractsProviderPort: CONTRACTS_PROVIDER_PORT_DEFAULT, -}; diff --git a/packages/concordia-contracts/contracts/Forum.sol b/packages/concordia-contracts/contracts/Forum.sol index 05d6031..9d61da8 100644 --- a/packages/concordia-contracts/contracts/Forum.sol +++ b/packages/concordia-contracts/contracts/Forum.sol @@ -18,7 +18,8 @@ contract Forum { } mapping(address => User) users; - mapping(string => address) userAddresses; + mapping(string => address) usernameAddresses; + address[] userAddresses; event UserSignedUp(string username, address userAddress); event UsernameUpdated(string newName, string oldName, address userAddress); @@ -27,7 +28,8 @@ contract Forum { require(!hasUserSignedUp(msg.sender), USER_HAS_NOT_SIGNED_UP); require(!isUserNameTaken(username), USERNAME_TAKEN); users[msg.sender] = User(username, new uint[](0), new uint[](0), block.timestamp, true); - userAddresses[username] = msg.sender; + usernameAddresses[username] = msg.sender; + userAddresses.push(msg.sender); emit UserSignedUp(username, msg.sender); return true; } @@ -36,9 +38,9 @@ contract Forum { require(hasUserSignedUp(msg.sender), USER_HAS_NOT_SIGNED_UP); require(!isUserNameTaken(newUsername), USERNAME_TAKEN); string memory oldUsername = getUsername(msg.sender); - delete userAddresses[users[msg.sender].username]; + delete usernameAddresses[users[msg.sender].username]; users[msg.sender].username = newUsername; - userAddresses[newUsername] = msg.sender; + usernameAddresses[newUsername] = msg.sender; emit UsernameUpdated(newUsername, oldUsername, msg.sender); return true; } @@ -49,7 +51,7 @@ contract Forum { } function getUserAddress(string memory username) public view returns (address) { - return userAddresses[username]; + return usernameAddresses[username]; } function hasUserSignedUp(address userAddress) public view returns (bool) { @@ -82,6 +84,10 @@ contract Forum { return users[userAddress]; } + function getUserAddresses() public view returns (address[] memory) { + return userAddresses; + } + //----------------------------------------POSTING---------------------------------------- struct Topic { uint topicID; @@ -171,4 +177,9 @@ contract Forum { posts[postID].topicID ); } + + function getPostAuthor(uint postID) public view returns (address) { + require(postExists(postID), POST_DOES_NOT_EXIST); + return posts[postID].author; + } } diff --git a/packages/concordia-contracts/contracts/PostVoting.sol b/packages/concordia-contracts/contracts/PostVoting.sol index c6183c7..1b3374a 100644 --- a/packages/concordia-contracts/contracts/PostVoting.sol +++ b/packages/concordia-contracts/contracts/PostVoting.sol @@ -70,11 +70,13 @@ contract PostVoting { } function vote(uint postID, Option option) private { - require(forum.hasUserSignedUp(msg.sender), forum.USER_HAS_NOT_SIGNED_UP()); + address voter = msg.sender; + require(forum.hasUserSignedUp(voter), forum.USER_HAS_NOT_SIGNED_UP()); require(forum.postExists(postID), forum.POST_DOES_NOT_EXIST()); + address postAuthor = forum.getPostAuthor(postID); + require(voter != postAuthor, "Post's author cannot vote for it."); PostBallot storage postBallot = postBallots[postID]; - address voter = msg.sender; Option prevOption = postBallot.votes[voter]; if (prevOption == option) diff --git a/packages/concordia-contracts/package.json b/packages/concordia-contracts/package.json index c1cfd6d..6c46a16 100644 --- a/packages/concordia-contracts/package.json +++ b/packages/concordia-contracts/package.json @@ -16,8 +16,9 @@ "upload": "node ./utils/contractsProviderUtils.js ${npm_package_version}-dev latest" }, "dependencies": { - "@openzeppelin/contracts": "~3.2.0", - "truffle": "~5.1.55", + "@openzeppelin/contracts": "~3.3.0", + "concordia-shared": "~0.1.0", + "truffle": "~5.1.58", "unirest": "^0.6.0" }, "devDependencies": { diff --git a/packages/concordia-contracts/truffle-config.js b/packages/concordia-contracts/truffle-config.js index 6d07a9f..2467673 100644 --- a/packages/concordia-contracts/truffle-config.js +++ b/packages/concordia-contracts/truffle-config.js @@ -1,9 +1,6 @@ const path = require('path'); -const defaults = require('./constants/config/defaults'); - -const { - CHAIN_HOST, CHAIN_PORT, -} = process.env; +const web3EnvInterpolated = require('concordia-shared/src/environment/interpolated/web3'); +const configurationDefaults = require('concordia-shared/src/constants/configuration/defaults'); module.exports = { // See @@ -16,18 +13,18 @@ module.exports = { contracts_build_directory: path.join(__dirname, 'build/'), networks: { develop: { - host: defaults.develop.chainHost, - port: defaults.develop.chainPort, + host: configurationDefaults.web3.develop.chainHost, + port: configurationDefaults.web3.develop.chainPort, network_id: '*', }, test: { - host: defaults.test.chainHost, - port: defaults.test.chainPort, + host: configurationDefaults.web3.test.chainHost, + port: configurationDefaults.web3.test.chainPort, network_id: '*', }, env: { - host: CHAIN_HOST, - port: CHAIN_PORT, + host: web3EnvInterpolated.web3Host, + port: web3EnvInterpolated.web3Port, network_id: '*', }, }, diff --git a/packages/concordia-contracts/utils/contractsProviderUtils.js b/packages/concordia-contracts/utils/contractsProviderUtils.js index 2bd52a3..5777da1 100644 --- a/packages/concordia-contracts/utils/contractsProviderUtils.js +++ b/packages/concordia-contracts/utils/contractsProviderUtils.js @@ -1,13 +1,11 @@ const path = require('path'); const unirest = require('unirest'); +const { contractsProviderHost } = require('concordia-shared/src/environment/interpolated/contractsProvider'); +const { contractsProviderPort } = require('concordia-shared/src/environment/interpolated/contractsProvider'); const { contracts } = require('../index'); -const defaults = require('../constants/config/defaults'); const uploadContractsToProviderUnirest = (versionHash, tag) => { - const CONTRACTS_PROVIDER_HOST = process.env.CONTRACTS_PROVIDER_HOST || defaults.contractsProviderHost; - const CONTRACTS_PROVIDER_PORT = process.env.CONTRACTS_PROVIDER_PORT || defaults.contractsProviderPort; - - const uploadPath = `http://${CONTRACTS_PROVIDER_HOST}:${CONTRACTS_PROVIDER_PORT}/contracts/${versionHash}`; + const uploadPath = `http://${contractsProviderHost}:${contractsProviderPort}/contracts/${versionHash}`; const request = unirest('POST', uploadPath) .field('tag', tag); diff --git a/packages/concordia-pinner/.eslintrc.js b/packages/concordia-pinner/.eslintrc.js new file mode 100755 index 0000000..9625123 --- /dev/null +++ b/packages/concordia-pinner/.eslintrc.js @@ -0,0 +1,60 @@ +module.exports = { + env: { + browser: true, + es6: true, + jest: true, + }, + extends: [ + 'plugin:react/recommended', + 'airbnb', + ], + globals: { + Atomics: 'readonly', + SharedArrayBuffer: 'readonly', + }, + parser: 'babel-eslint', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 2018, + sourceType: 'module', + }, + plugins: [ + 'react', + 'react-hooks', + ], + rules: { + 'react/jsx-props-no-spreading': 'off', + 'import/extensions': 'off', + 'react/jsx-indent': [ + 'error', + 4, + { + checkAttributes: true, + indentLogicalExpressions: true, + }, + ], + 'react/require-default-props': 'off', + 'react/prop-types': 'off', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'error', + 'max-len': ['warn', { code: 120, tabWidth: 4 }], + 'no-unused-vars': 'warn', + 'no-console': 'off', + 'no-shadow': 'warn', + 'no-multi-str': 'warn', + 'jsx-a11y/label-has-associated-control': [2, { + labelAttributes: ['label'], + controlComponents: ['Input'], + depth: 3, + }], + }, + settings: { + 'import/resolver': { + node: { + extensions: ['.js', '.jsx'], + }, + }, + }, +}; diff --git a/packages/concordia-pinner/.gitattributes b/packages/concordia-pinner/.gitattributes new file mode 100644 index 0000000..02ac587 --- /dev/null +++ b/packages/concordia-pinner/.gitattributes @@ -0,0 +1,10 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto eol=lf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.ico binary + +# Solidity +*.sol linguist-language=Solidity diff --git a/packages/concordia-pinner/.gitignore b/packages/concordia-pinner/.gitignore new file mode 100644 index 0000000..77564fe --- /dev/null +++ b/packages/concordia-pinner/.gitignore @@ -0,0 +1,40 @@ +# Node +/node_modules +packages/*/node_modules +packages/concordia-contracts/build + +# IDE +.DS_Store +.idea + +# Build Directories +/build +/src/build +/packages/concordia-app/build +/packages/concordia-contracts/build + +# Logs +/log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Docker volumes +docker/volumes +docker/ganache/volumes +docker/reports + +# Env var files +docker/env/concordia.env +docker/env/contracts.env + +# Misc +.env.local +.env.development.local +.env.test.local +.env.production.local + +# IPFS & OrbitDB Storage +ipfs +orbitdb + diff --git a/packages/concordia-pinner/package.json b/packages/concordia-pinner/package.json new file mode 100644 index 0000000..d5b0ccc --- /dev/null +++ b/packages/concordia-pinner/package.json @@ -0,0 +1,39 @@ +{ + "name": "concordia-pinner", + "description": "An OrbitDB pinning service for Concordia.", + "version": "0.1.0", + "private": true, + "main": "src/index.js", + "scripts": { + "start": "node -r esm src/index.js", + "clean": "rimraf ipfs orbitdb", + "lint": "eslint --ext js,jsx . --format table" + }, + "license": "MIT", + "dependencies": { + "@ezerous/eth-identity-provider": "~0.1.2", + "concordia-contracts": "~0.1.0", + "concordia-shared": "~0.1.0", + "esm": "~3.2.25", + "express": "^4.17.1", + "ipfs": "~0.52.1", + "is-reachable": "^5.0.0", + "level": "~6.0.1", + "libp2p": "~0.30.0", + "libp2p-bootstrap": "~0.12.1", + "libp2p-gossipsub": "~0.8.0", + "libp2p-kad-dht": "~0.20.1", + "libp2p-mdns": "~0.15.0", + "libp2p-mplex": "~0.10.0", + "libp2p-noise": "~2.0.1", + "libp2p-tcp": "~0.15.1", + "libp2p-webrtc-star": "~0.20.2", + "lodash": "^4.17.20", + "orbit-db": "~0.26.0", + "orbit-db-identity-provider": "~0.3.1", + "rimraf": "~3.0.2", + "web3": "~1.3.0", + "web3-eth-contract": "^1.3.1", + "wrtc": "~0.4.6" + } +} diff --git a/packages/concordia-pinner/src/app.js b/packages/concordia-pinner/src/app.js new file mode 100644 index 0000000..690e450 --- /dev/null +++ b/packages/concordia-pinner/src/app.js @@ -0,0 +1,63 @@ +import express from 'express'; +import _ from 'lodash'; +import isReachable from 'is-reachable'; +import { pinnerApiPort } from 'concordia-shared/src/environment/interpolated/pinner'; +import getWeb3ProviderUrl from 'concordia-shared/src/utils/web3'; +import getRendezvousUrl from 'concordia-shared/src/utils/rendezvous'; + +const POLLING_INTERVAL = 1000; + +const responseBody = { + ipfs: { + id: '', localAddresses: [], peers: [], totalPeers: 0, repoStats: {}, + }, + orbit: { identity: {}, databases: [] }, + web3: { url: getWeb3ProviderUrl(), reachable: false }, + rendezvous: { url: getRendezvousUrl(), reachable: false }, + timestamp: 0, +}; + +async function getStats(orbit) { + try { + // eslint-disable-next-line no-underscore-dangle + const ipfs = orbit._ipfs; + const { id } = await ipfs.id(); + const peers = await ipfs.swarm.peers(); + const localAddresses = await ipfs.swarm.localAddrs(); + const repoStats = await ipfs.stats.repo(); + const uniquePeers = _.uniqBy(peers, 'peer'); + const orbitIdentity = orbit.identity; + const databases = Object.keys(orbit.stores); + const isWeb3Reachable = await isReachable(getWeb3ProviderUrl()); + const isRendezvousReachable = await isReachable(getRendezvousUrl()); + const timestamp = +new Date(); + + responseBody.ipfs.id = id; + responseBody.ipfs.peers = uniquePeers; + responseBody.ipfs.totalPeers = uniquePeers.length; + responseBody.ipfs.localAddresses = localAddresses; + responseBody.ipfs.repoStats = repoStats; + responseBody.orbit.identity = orbitIdentity; + responseBody.orbit.databases = databases; + responseBody.web3.reachable = isWeb3Reachable; + responseBody.rendezvous.reachable = isRendezvousReachable; + responseBody.timestamp = timestamp; + } catch (err) { + console.error('Error while getting stats:', err); + } +} + +const startAPI = (orbit) => { + const app = express(); + app.get('/', async (req, res) => { + res.send(responseBody); + }); + + app.listen(pinnerApiPort, () => { + console.log(`Pinner API at http://localhost:${pinnerApiPort}!`); + }); + + setInterval(getStats, POLLING_INTERVAL, orbit); +}; + +export default startAPI; diff --git a/packages/concordia-pinner/src/constants.js b/packages/concordia-pinner/src/constants.js new file mode 100644 index 0000000..6a8055f --- /dev/null +++ b/packages/concordia-pinner/src/constants.js @@ -0,0 +1,6 @@ +import path from 'path'; +import getBreezeConfiguration from 'concordia-shared/src/configuration/breezeConfiguration'; + +export const swarmAddresses = getBreezeConfiguration().ipfs.config.Addresses.Swarm; + +export const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); diff --git a/packages/concordia-pinner/src/index.js b/packages/concordia-pinner/src/index.js new file mode 100644 index 0000000..401bced --- /dev/null +++ b/packages/concordia-pinner/src/index.js @@ -0,0 +1,80 @@ +import Web3 from 'web3'; +import Contract from 'web3-eth-contract'; +import IPFS from 'ipfs'; +import { contracts } from 'concordia-contracts'; +import { FORUM_CONTRACT } from 'concordia-shared/src/constants/contracts/ContractNames'; +import getWeb3ProviderUrl from 'concordia-shared/src/utils/web3'; +import { createOrbitInstance, getPeerDatabases, openKVDBs } from './utils/orbitUtils'; +import ipfsOptions from './options/ipfsOptions'; +import startAPI from './app'; + +process.on('unhandledRejection', (error) => { + // This happens when attempting to initialize without any available Swarm addresses (e.g. Rendezvous) + if (error.code === 'ERR_NO_VALID_ADDRESSES') { + console.error('unhandledRejection', error.message); + process.exit(1); + } + + // Don't swallow other errors + console.error(error); + throw error; +}); + +const getDeployedContract = async (web3) => { + const forumContract = contracts.find((contract) => contract.contractName === FORUM_CONTRACT); + + return web3.eth.net.getId() + .then((networkId) => forumContract.networks[networkId].address) + .then((contractAddress) => { + Contract.setProvider(getWeb3ProviderUrl()); + const contract = new Contract(forumContract.abi, contractAddress); + + return { contract, contractAddress }; + }); +}; + +// Open & replicate databases of existing users +const openExistingUsersDatabases = async (contract, orbit) => contract.methods.getUserAddresses().call() + .then((userAddresses) => getPeerDatabases(orbit, userAddresses)) + .then((peerDBs) => openKVDBs(orbit, peerDBs)); + +const handleWeb3LogEvent = (web3, eventJsonInterface, orbit) => (error, result) => { + if (!error) { + const eventObj = web3.eth.abi.decodeLog( + eventJsonInterface.inputs, + result.data, + result.topics.slice(1), + ); + const userAddress = eventObj[1]; + console.log('User signed up:', userAddress); + getPeerDatabases(orbit, [userAddress]) + .then((peerDBs) => openKVDBs(orbit, peerDBs)); + } +}; + +const main = async () => { + console.log('Initializing...'); + const web3 = new Web3(new Web3.providers.WebsocketProvider(getWeb3ProviderUrl())); + + getDeployedContract(web3) + .then(({ contract, contractAddress }) => IPFS.create(ipfsOptions) + .then((ipfs) => createOrbitInstance(ipfs, contractAddress)) + .then((orbit) => openExistingUsersDatabases(contract, orbit) + .then(() => { + // Listen for new users and subscribe to their databases + const eventJsonInterface = web3.utils._.find( + // eslint-disable-next-line no-underscore-dangle + contract._jsonInterface, + (obj) => obj.name === 'UserSignedUp' && obj.type === 'event', + ); + + web3.eth.subscribe('logs', { + address: contractAddress, + topics: [eventJsonInterface.signature], + }, handleWeb3LogEvent(web3, eventJsonInterface, orbit)); + + startAPI(orbit); + }))); +}; + +main(); diff --git a/packages/concordia-pinner/src/options/ipfsOptions.js b/packages/concordia-pinner/src/options/ipfsOptions.js new file mode 100644 index 0000000..b25b5e6 --- /dev/null +++ b/packages/concordia-pinner/src/options/ipfsOptions.js @@ -0,0 +1,22 @@ +import libp2pBundle from './libp2pBundle'; +import { swarmAddresses } from '../constants'; + +export default { + repo: 'ipfs', + config: { + Profile: 'server', + Addresses: { + Swarm: swarmAddresses, + }, + }, + libp2p: libp2pBundle, + EXPERIMENTAL: { + pubsub: true, + }, + preload: { + enabled: false, + }, + init: { + emptyRepo: true, + }, +}; diff --git a/packages/concordia-pinner/src/options/libp2pBundle.js b/packages/concordia-pinner/src/options/libp2pBundle.js new file mode 100644 index 0000000..4de108b --- /dev/null +++ b/packages/concordia-pinner/src/options/libp2pBundle.js @@ -0,0 +1,90 @@ +import Libp2p from 'libp2p'; +import wrtc from 'wrtc'; +import MulticastDNS from 'libp2p-mdns'; +import WebrtcStar from 'libp2p-webrtc-star'; +import Bootstrap from 'libp2p-bootstrap'; +import Gossipsub from 'libp2p-gossipsub'; +import KadDHT from 'libp2p-kad-dht'; +import MPLEX from 'libp2p-mplex'; +import { NOISE } from 'libp2p-noise'; +import { swarmAddresses } from '../constants'; + +// See also: https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md +export default (opts) => new Libp2p({ + peerId: opts.peerId, + addresses: { + listen: swarmAddresses, + }, + connectionManager: { + minPeers: 25, + maxPeers: 100, + pollInterval: 5000, + }, + modules: { + transport: [ + WebrtcStar, + ], + streamMuxer: [ + MPLEX, + ], + connEncryption: [ + NOISE, + ], + peerDiscovery: [ + MulticastDNS, + Bootstrap, + ], + dht: KadDHT, + pubsub: Gossipsub, + }, + config: { + transport: { + [WebrtcStar.prototype[Symbol.toStringTag]]: { + wrtc, + }, + }, + peerDiscovery: { + autoDial: true, + mdns: { + enabled: true, + interval: 10000, + }, + bootstrap: { + enabled: true, + interval: 30e3, + list: opts.config.Bootstrap, + }, + }, + relay: { + enabled: true, + hop: { + enabled: true, + active: true, + }, + }, + dht: { + enabled: true, + kBucketSize: 20, + randomWalk: { + enabled: true, + interval: 10e3, + timeout: 2e3, + }, + }, + pubsub: { + enabled: true, + emitself: true, + }, + }, + metrics: { + enabled: true, + computeThrottleMaxQueueSize: 1000, + computeThrottleTimeout: 2000, + movingAverageIntervals: [ + 60 * 1000, // 1 minute + 5 * 60 * 1000, // 5 minutes + 15 * 60 * 1000, // 15 minutes + ], + maxOldPeersRetention: 50, + }, +}); diff --git a/packages/concordia-pinner/src/utils/orbitUtils.js b/packages/concordia-pinner/src/utils/orbitUtils.js new file mode 100644 index 0000000..71f47bf --- /dev/null +++ b/packages/concordia-pinner/src/utils/orbitUtils.js @@ -0,0 +1,46 @@ +import OrbitDB from 'orbit-db'; +import Identities from 'orbit-db-identity-provider'; +import { EthereumContractIdentityProvider } from '@ezerous/eth-identity-provider'; +import Web3 from 'web3'; +import { ORBIT_DIRECTORY_DEFAULT } from '../constants'; + +// TODO: share code below with frontend (?) +const determineDBAddress = async ({ + orbit, dbName, type, identityId, +}) => orbit.determineAddress(dbName, type, { accessController: { write: [identityId] } }) + .then((orbitAddress) => { + const ipfsMultihash = orbitAddress.root; + return `/orbitdb/${ipfsMultihash}/${dbName}`; + }); + +const determineKVAddress = async ({ orbit, dbName, userAddress }) => determineDBAddress({ + orbit, dbName, type: 'keyvalue', identityId: userAddress + EthereumContractIdentityProvider.contractAddress, +}); + +export const createOrbitInstance = async (ipfs, contractAddress) => { + Identities.addIdentityProvider(EthereumContractIdentityProvider); + + EthereumContractIdentityProvider.setWeb3(new Web3()); // We need a fully-featured new Web3 for signature verification + EthereumContractIdentityProvider.setContractAddress(contractAddress); + + const ORBIT_DIRECTORY = process.env.ORBIT_DIRECTORY || ORBIT_DIRECTORY_DEFAULT; + + return OrbitDB.createInstance(ipfs, { directory: ORBIT_DIRECTORY }); +}; + +export const getPeerDatabases = async (orbit, userAddresses) => Promise.all(userAddresses + .flatMap((userAddress) => [ + determineKVAddress({ orbit, dbName: 'user', userAddress }), + determineKVAddress({ orbit, dbName: 'posts', userAddress }), + determineKVAddress({ orbit, dbName: 'topics', userAddress }), + ])); + +export const openKVDBs = async (orbit, databases) => { + databases + .forEach((database) => { + orbit + .keyvalue(database) + .then((store) => store.events.on('replicated', (address) => console.log(`Replicated ${address}`))); + console.log(`Opened ${database}`); + }); +}; diff --git a/packages/concordia-shared/.eslintrc.js b/packages/concordia-shared/.eslintrc.js new file mode 100644 index 0000000..96481bd --- /dev/null +++ b/packages/concordia-shared/.eslintrc.js @@ -0,0 +1,60 @@ +module.exports = { + 'env': { + 'browser': true, + 'es6': true, + 'jest': true + }, + 'extends': [ + 'plugin:react/recommended', + 'airbnb' + ], + 'globals': { + 'Atomics': 'readonly', + 'SharedArrayBuffer': 'readonly' + }, + parser: 'babel-eslint', + 'parserOptions': { + 'ecmaFeatures': { + 'jsx': true + }, + 'ecmaVersion': 2018, + 'sourceType': 'module' + }, + 'plugins': [ + 'react', + 'react-hooks', + ], + 'rules': { + 'react/jsx-props-no-spreading': 'off', + 'import/extensions': 'off', + "react/jsx-indent": [ + 'error', + 4, + { + checkAttributes: true, + indentLogicalExpressions: true + } + ], + 'react/require-default-props': 'off', + 'react/prop-types': 'off', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'error', + 'max-len': ['warn', {'code': 120, 'tabWidth': 4}], + 'no-unused-vars': 'warn', + 'no-console': 'warn', + 'no-shadow': 'warn', + "no-multi-str": "warn", + "jsx-a11y/label-has-associated-control": [ 2, { + "labelAttributes": ["label"], + "controlComponents": ["Input"], + "depth": 3, + }], + }, + 'settings': { + 'import/resolver': { + 'node': { + 'extensions': ['.js', '.jsx'] + } + } + }, +}; diff --git a/packages/concordia-shared/package.json b/packages/concordia-shared/package.json new file mode 100644 index 0000000..a57542d --- /dev/null +++ b/packages/concordia-shared/package.json @@ -0,0 +1,16 @@ +{ + "name": "concordia-shared", + "version": "0.1.0", + "private": true, + "scripts": { + "lint": "eslint --ext js,jsx . --format table" + }, + "devDependencies": { + "eslint": "^6.8.0", + "eslint-config-airbnb": "^18.1.0", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-react": "^7.19.0", + "eslint-plugin-react-hooks": "^4.2.0" + } +} diff --git a/packages/concordia-shared/src/configuration/breezeConfiguration.js b/packages/concordia-shared/src/configuration/breezeConfiguration.js new file mode 100644 index 0000000..e1ab0e0 --- /dev/null +++ b/packages/concordia-shared/src/configuration/breezeConfiguration.js @@ -0,0 +1,33 @@ +const { databases } = require('../constants/orbit/OrbitDatabases'); +const { rendezvousHost, rendezvousPort } = require('../environment/interpolated/rendezvous'); + +const getBreezeConfiguration = (identityProvider) => ({ + ipfs: { + repo: 'concordia', + config: { + Addresses: { + Swarm: [ + // Use local signaling server (see also rendezvous script in package.json) + // For more information: https://github.com/libp2p/js-libp2p-webrtc-star + `/ip4/${rendezvousHost}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, + + // Use the following public servers if needed + // '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star', + // '/dns4/ wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star' + ], + }, + }, + preload: { + enabled: false, + }, + init: { + emptyRepo: true, + }, + }, + orbit: { + identityProvider, + databases, + }, +}); + +module.exports = getBreezeConfiguration; diff --git a/packages/concordia-shared/src/configuration/web3Configuration.js b/packages/concordia-shared/src/configuration/web3Configuration.js new file mode 100644 index 0000000..91a10a8 --- /dev/null +++ b/packages/concordia-shared/src/configuration/web3Configuration.js @@ -0,0 +1,25 @@ +const getWeb3ProviderUrl = require('../utils/web3'); +const { web3PortSocketConnectMaxAttempts, web3PortSocketTimeout } = require('../environment/interpolated/web3'); +const { web3HostEnv, web3PortEnv } = require('../environment/web3Env'); + +const getWeb3Configuration = (Web3) => { + const web3WebsocketOptions = { + keepAlive: true, + timeout: web3PortSocketTimeout, + reconnect: { + maxAttempts: web3PortSocketConnectMaxAttempts, + }, + }; + + const web3 = (web3HostEnv !== undefined && web3PortEnv !== undefined) + ? new Web3(new Web3.providers.WebsocketProvider(getWeb3ProviderUrl())) + : new Web3(Web3.givenProvider || new Web3.providers.WebsocketProvider(getWeb3ProviderUrl(), web3WebsocketOptions)); + + return { + customProvider: web3, + }; +}; + +module.exports = { + getWeb3Configuration, +}; diff --git a/packages/concordia-shared/src/constants/configuration/defaults.js b/packages/concordia-shared/src/constants/configuration/defaults.js new file mode 100644 index 0000000..07ee374 --- /dev/null +++ b/packages/concordia-shared/src/constants/configuration/defaults.js @@ -0,0 +1,46 @@ +// Contracts provider +const CONTRACTS_PROVIDER_HOST_DEFAULT = '127.0.0.1'; +const CONTRACTS_PROVIDER_PORT_DEFAULT = '8400'; +const CONTRACTS_VERSION_HASH_DEFAULT = 'latest'; + +// Pinner +const PINNER_API_PORT_DEFAULT = 4444; + +// Rendezvous +const RENDEZVOUS_HOST_DEFAULT = '127.0.0.1'; +const RENDEZVOUS_PORT_DEFAULT = '9090'; + +// Web3 (probably ganache) +const WEB3_HOST_DEFAULT = '127.0.0.1'; +const WEB3_PORT_DEFAULT = '8545'; +const WEB3_HOST_TEST_DEFAULT = '127.0.0.1'; +const WEB3_PORT_TEST_DEFAULT = '8546'; +const WEB3_PORT_SOCKET_TIMEOUT_DEFAULT = 30000; +const WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT = 3; + +module.exports = Object.freeze({ + contractsProvider: { + host: CONTRACTS_PROVIDER_HOST_DEFAULT, + port: CONTRACTS_PROVIDER_PORT_DEFAULT, + hash: CONTRACTS_VERSION_HASH_DEFAULT, + }, + pinner: { + port: PINNER_API_PORT_DEFAULT, + }, + rendezvous: { + host: RENDEZVOUS_HOST_DEFAULT, + port: RENDEZVOUS_PORT_DEFAULT, + }, + web3: { + develop: { + chainHost: WEB3_HOST_DEFAULT, + chainPort: WEB3_PORT_DEFAULT, + }, + test: { + chainHost: WEB3_HOST_TEST_DEFAULT, + chainPort: WEB3_PORT_TEST_DEFAULT, + }, + socketTimeout: WEB3_PORT_SOCKET_TIMEOUT_DEFAULT, + socketConnectMaxAttempts: WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT, + }, +}); diff --git a/packages/concordia-shared/src/constants/contracts/ContractNames.js b/packages/concordia-shared/src/constants/contracts/ContractNames.js new file mode 100644 index 0000000..1e6751d --- /dev/null +++ b/packages/concordia-shared/src/constants/contracts/ContractNames.js @@ -0,0 +1,16 @@ +const FORUM_CONTRACT = 'Forum'; +const POST_VOTING_CONTRACT = 'PostVoting'; +const VOTING_CONTRACT = 'Voting'; + +const CONTRACTS = [ + FORUM_CONTRACT, + POST_VOTING_CONTRACT, + VOTING_CONTRACT, +]; + +module.exports = Object.freeze({ + FORUM_CONTRACT, + POST_VOTING_CONTRACT, + VOTING_CONTRACT, + CONTRACTS, +}); diff --git a/packages/concordia-shared/src/constants/contracts/events/ForumContractEvents.js b/packages/concordia-shared/src/constants/contracts/events/ForumContractEvents.js new file mode 100644 index 0000000..4a741db --- /dev/null +++ b/packages/concordia-shared/src/constants/contracts/events/ForumContractEvents.js @@ -0,0 +1,19 @@ +const USER_SIGNED_UP_EVENT = 'UserSignedUp'; +const USERNAME_UPDATED_EVENT = 'UsernameUpdated'; +const TOPIC_CREATED_EVENT = 'TopicCreated'; +const POST_CREATED_EVENT = 'PostCreated'; + +const forumContractEvents = Object.freeze([ + USER_SIGNED_UP_EVENT, + USERNAME_UPDATED_EVENT, + TOPIC_CREATED_EVENT, + POST_CREATED_EVENT, +]); + +module.exports = { + USER_SIGNED_UP_EVENT, + USERNAME_UPDATED_EVENT, + TOPIC_CREATED_EVENT, + POST_CREATED_EVENT, + forumContractEvents, +}; diff --git a/packages/concordia-shared/src/constants/contracts/events/index.js b/packages/concordia-shared/src/constants/contracts/events/index.js new file mode 100644 index 0000000..09e71a3 --- /dev/null +++ b/packages/concordia-shared/src/constants/contracts/events/index.js @@ -0,0 +1,8 @@ +const forumContractEvents = require('./ForumContractEvents'); +const { FORUM_CONTRACT } = require('../ContractNames'); + +const appEvents = Object.freeze({ + [FORUM_CONTRACT]: forumContractEvents, +}); + +module.exports = appEvents; diff --git a/packages/concordia-app/src/constants/orbit/OrbitDatabases.js b/packages/concordia-shared/src/constants/orbit/OrbitDatabases.js similarity index 50% rename from packages/concordia-app/src/constants/orbit/OrbitDatabases.js rename to packages/concordia-shared/src/constants/orbit/OrbitDatabases.js index bf85018..75048f6 100644 --- a/packages/concordia-app/src/constants/orbit/OrbitDatabases.js +++ b/packages/concordia-shared/src/constants/orbit/OrbitDatabases.js @@ -1,6 +1,6 @@ -export const USER_DATABASE = 'user'; -export const TOPICS_DATABASE = 'topics'; -export const POSTS_DATABASE = 'posts'; +const USER_DATABASE = 'user'; +const TOPICS_DATABASE = 'topics'; +const POSTS_DATABASE = 'posts'; const databases = [ { @@ -17,4 +17,9 @@ const databases = [ }, ]; -export default databases; +module.exports = Object.freeze({ + USER_DATABASE, + TOPICS_DATABASE, + POSTS_DATABASE, + databases, +}); diff --git a/packages/concordia-shared/src/environment/contractsProviderEnv.js b/packages/concordia-shared/src/environment/contractsProviderEnv.js new file mode 100644 index 0000000..3a545ca --- /dev/null +++ b/packages/concordia-shared/src/environment/contractsProviderEnv.js @@ -0,0 +1,14 @@ +// Depending on the package user (app in contrast to any of the other packages) the env var names should either include +// the REACT_APP_ prefix or not +const contractsProviderHostEnv = process.env.REACT_APP_CONTRACTS_PROVIDER_HOST + || process.env.CONTRACTS_PROVIDER_HOST; +const contractsProviderPortEnv = process.env.REACT_APP_CONTRACTS_PROVIDER_PORT + || process.env.CONTRACTS_PROVIDER_PORT; +const contractsVersionHashEnv = process.env.REACT_APP_CONTRACTS_VERSION_HASH + || process.env.CONTRACTS_VERSION_HASH; + +module.exports = { + contractsProviderHostEnv, + contractsProviderPortEnv, + contractsVersionHashEnv, +}; diff --git a/packages/concordia-shared/src/environment/interpolated/contractsProvider.js b/packages/concordia-shared/src/environment/interpolated/contractsProvider.js new file mode 100644 index 0000000..ea4537e --- /dev/null +++ b/packages/concordia-shared/src/environment/interpolated/contractsProvider.js @@ -0,0 +1,21 @@ +const { + contractsProviderHostEnv, contractsProviderPortEnv, contractsVersionHashEnv, +} = require('../contractsProviderEnv'); + +const { + contractsProvider: { + host: CONTRACTS_PROVIDER_HOST_DEFAULT, + port: CONTRACTS_PROVIDER_PORT_DEFAULT, + hash: CONTRACTS_VERSION_HASH_DEFAULT, + }, +} = require('../../constants/configuration/defaults'); + +const contractsProviderHost = contractsProviderHostEnv || CONTRACTS_PROVIDER_HOST_DEFAULT; +const contractsProviderPort = contractsProviderPortEnv || CONTRACTS_PROVIDER_PORT_DEFAULT; +const contractsVersionHash = contractsVersionHashEnv || CONTRACTS_VERSION_HASH_DEFAULT; + +module.exports = { + contractsProviderHost, + contractsProviderPort, + contractsVersionHash, +}; diff --git a/packages/concordia-shared/src/environment/interpolated/pinner.js b/packages/concordia-shared/src/environment/interpolated/pinner.js new file mode 100644 index 0000000..5c81a88 --- /dev/null +++ b/packages/concordia-shared/src/environment/interpolated/pinner.js @@ -0,0 +1,12 @@ +const { + pinner: { + port: PINNER_API_PORT_DEFAULT, + }, +} = require('../../constants/configuration/defaults'); +const { pinnerApiPortEnv } = require('../pinnerEnv'); + +const pinnerApiPort = pinnerApiPortEnv || PINNER_API_PORT_DEFAULT; + +module.exports = { + pinnerApiPort, +}; diff --git a/packages/concordia-shared/src/environment/interpolated/rendezvous.js b/packages/concordia-shared/src/environment/interpolated/rendezvous.js new file mode 100644 index 0000000..d683408 --- /dev/null +++ b/packages/concordia-shared/src/environment/interpolated/rendezvous.js @@ -0,0 +1,15 @@ +const { rendezvousHostEnv, rendezvousPortEnv } = require('../rendezvousEnv'); +const { + rendezvous: { + host: RENDEZVOUS_HOST_DEFAULT, + port: RENDEZVOUS_PORT_DEFAULT, + }, +} = require('../../constants/configuration/defaults'); + +const rendezvousHost = rendezvousHostEnv || RENDEZVOUS_HOST_DEFAULT; +const rendezvousPort = rendezvousPortEnv || RENDEZVOUS_PORT_DEFAULT; + +module.exports = { + rendezvousHost, + rendezvousPort, +}; diff --git a/packages/concordia-shared/src/environment/interpolated/shared.js b/packages/concordia-shared/src/environment/interpolated/shared.js new file mode 100644 index 0000000..6cf342a --- /dev/null +++ b/packages/concordia-shared/src/environment/interpolated/shared.js @@ -0,0 +1,9 @@ +const contractsProvider = require('./contractsProvider'); +const rendezvous = require('./rendezvous'); +const web3 = require('./web3'); + +module.exports = { + contractsProvider, + rendezvous, + web3, +}; diff --git a/packages/concordia-shared/src/environment/interpolated/web3.js b/packages/concordia-shared/src/environment/interpolated/web3.js new file mode 100644 index 0000000..4fe1e9d --- /dev/null +++ b/packages/concordia-shared/src/environment/interpolated/web3.js @@ -0,0 +1,37 @@ +const { + web3: { + develop: { + chainHost: WEB3_HOST_DEFAULT, + chainPort: WEB3_PORT_DEFAULT, + }, + test: { + chainHost: WEB3_HOST_TEST_DEFAULT, + chainPort: WEB3_PORT_TEST_DEFAULT, + }, + socketConnectMaxAttempts: WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT, + socketTimeout: WEB3_PORT_SOCKET_TIMEOUT_DEFAULT, + }, +} = require('../../constants/configuration/defaults'); +const { + web3HostEnv, web3HostTestEnv, web3PortEnv, web3PortSocketConnectMaxAttemptsEnv, web3PortSocketTimeoutEnv, + web3PortTestEnv, +} = require('../web3Env'); + +const web3Host = web3HostEnv || WEB3_HOST_DEFAULT; +const web3Port = web3PortEnv || WEB3_PORT_DEFAULT; + +const web3HostTest = web3HostTestEnv || WEB3_HOST_TEST_DEFAULT; +const web3PortTest = web3PortTestEnv || WEB3_PORT_TEST_DEFAULT; + +const web3PortSocketTimeout = web3PortSocketTimeoutEnv || WEB3_PORT_SOCKET_TIMEOUT_DEFAULT; +const web3PortSocketConnectMaxAttempts = web3PortSocketConnectMaxAttemptsEnv + || WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT; + +module.exports = { + web3Host, + web3Port, + web3HostTest, + web3PortTest, + web3PortSocketTimeout, + web3PortSocketConnectMaxAttempts, +}; diff --git a/packages/concordia-shared/src/environment/pinnerEnv.js b/packages/concordia-shared/src/environment/pinnerEnv.js new file mode 100644 index 0000000..2ab5cbf --- /dev/null +++ b/packages/concordia-shared/src/environment/pinnerEnv.js @@ -0,0 +1,7 @@ +// Depending on the package user (app in contrast to any of the other packages) the env var names should either include +// the REACT_APP_ prefix or not +const pinnerApiPortEnv = process.env.REACT_APP_PINNER_API_PORT || process.env.PINNER_API_PORT; + +module.exports = { + pinnerApiPortEnv, +}; diff --git a/packages/concordia-shared/src/environment/rendezvousEnv.js b/packages/concordia-shared/src/environment/rendezvousEnv.js new file mode 100644 index 0000000..44f8965 --- /dev/null +++ b/packages/concordia-shared/src/environment/rendezvousEnv.js @@ -0,0 +1,9 @@ +// Depending on the package user (app in contrast to any of the other packages) the env var names should either include +// the REACT_APP_ prefix or not +const rendezvousHostEnv = process.env.REACT_APP_RENDEZVOUS_HOST || process.env.RENDEZVOUS_HOST; +const rendezvousPortEnv = process.env.REACT_APP_RENDEZVOUS_PORT || process.env.RENDEZVOUS_PORT; + +module.exports = { + rendezvousHostEnv, + rendezvousPortEnv, +}; diff --git a/packages/concordia-shared/src/environment/sharedEnv.js b/packages/concordia-shared/src/environment/sharedEnv.js new file mode 100644 index 0000000..28c2920 --- /dev/null +++ b/packages/concordia-shared/src/environment/sharedEnv.js @@ -0,0 +1,9 @@ +const contractsProvider = require('./contractsProviderEnv'); +const rendezvous = require('./rendezvousEnv'); +const web3 = require('./web3Env'); + +module.exports = { + contractsProvider, + rendezvous, + web3, +}; diff --git a/packages/concordia-shared/src/environment/web3Env.js b/packages/concordia-shared/src/environment/web3Env.js new file mode 100644 index 0000000..7bc2041 --- /dev/null +++ b/packages/concordia-shared/src/environment/web3Env.js @@ -0,0 +1,24 @@ +// Depending on the package user (app in contrast to any of the other packages) the env var names should either include +// the REACT_APP_ prefix or not +const web3HostEnv = process.env.REACT_APP_WEB3_HOST + || process.env.WEB3_HOST; +const web3PortEnv = process.env.REACT_APP_WEB3_PORT + || process.env.WEB3_PORT; + +// Web3 test environment shouldn't be available to the react app +const web3HostTestEnv = process.env.WEB3_HOST_TEST; +const web3PortTestEnv = process.env.WEB3_PORT_TEST; + +const web3PortSocketTimeoutEnv = process.env.REACT_APP_WEB3_PORT_SOCKET_TIMEOUT + || process.env.WEB3_PORT_SOCKET_TIMEOUT; +const web3PortSocketConnectMaxAttemptsEnv = process.env.REACT_APP_WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS + || process.env.WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS; + +module.exports = { + web3HostEnv, + web3PortEnv, + web3HostTestEnv, + web3PortTestEnv, + web3PortSocketTimeoutEnv, + web3PortSocketConnectMaxAttemptsEnv, +}; diff --git a/packages/concordia-shared/src/utils/rendezvous.js b/packages/concordia-shared/src/utils/rendezvous.js new file mode 100644 index 0000000..8d862fc --- /dev/null +++ b/packages/concordia-shared/src/utils/rendezvous.js @@ -0,0 +1,5 @@ +const { rendezvousHost, rendezvousPort } = require('../environment/interpolated/rendezvous'); + +const getRendezvousUrl = () => `http://${rendezvousHost}:${rendezvousPort}`; + +module.exports = getRendezvousUrl; diff --git a/packages/concordia-shared/src/utils/web3.js b/packages/concordia-shared/src/utils/web3.js new file mode 100644 index 0000000..4c7adc8 --- /dev/null +++ b/packages/concordia-shared/src/utils/web3.js @@ -0,0 +1,6 @@ +const { web3Port } = require('../environment/interpolated/web3'); +const { web3Host } = require('../environment/interpolated/web3'); + +const getWeb3ProviderUrl = () => `ws://${web3Host}:${web3Port}`; + +module.exports = getWeb3ProviderUrl; diff --git a/yarn.lock b/yarn.lock index c971c61..c1d989b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -77,9 +77,9 @@ source-map "^0.5.0" "@babel/generator@^7.12.13", "@babel/generator@^7.4.0", "@babel/generator@^7.9.0": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.13.tgz#5f6ebe6c85db99886db2d7b044409196f872a503" - integrity sha512-9qQ8Fgo8HaSvHEt6A5+BATP7XktD/AdAnObUeTRz5/e2y3kbrxZgz32qUJJsdmwUvBJzF4AeV21nGTNwv05Mpw== + version "7.12.15" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.15.tgz#4617b5d0b25cc572474cc1aafee1edeaf9b5368f" + integrity sha512-6F2xHxBiFXWNSGb7vyCUTBF8RCLY66rS0zEPcP8t/nQyXjha5EuK4z7H5o7fWG8B4M7y6mqVWq1J+1PuwRhecQ== dependencies: "@babel/types" "^7.12.13" jsesc "^2.5.1" @@ -279,9 +279,9 @@ js-tokens "^4.0.0" "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": - version "7.12.14" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.14.tgz#4adb7c5eef1d437ef965ad1569cd826db8c11dc9" - integrity sha512-xcfxDq3OrBnDsA/Z8eK5/2iPcLD8qbOaSSfOw4RA6jp4i7e6dEQ7+wTwxItEwzcXPQcsry5nZk96gmVPKletjQ== + version "7.12.15" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.15.tgz#2b20de7f0b4b332d9b119dd9c33409c538b8aacf" + integrity sha512-AQBOU2Z9kWwSZMd6lNjCX0GUgFonL1wAM1db8L8PMk9UDaGsRCArBkU4Sc+UCM3AE4hjbXx+h58Lb3QT4oRmrA== "@babel/plugin-proposal-async-generator-functions@^7.12.13", "@babel/plugin-proposal-async-generator-functions@^7.8.3": version "7.12.13" @@ -1148,10 +1148,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@ethersproject/abi@5.0.11", "@ethersproject/abi@^5.0.10": - version "5.0.11" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.11.tgz#d3b6fd955d3172214603d4d123055b3b0b06376b" - integrity sha512-ibZswQsjdFuLSfY2lbRTZM2Uk+ci7tp+mjVK0kjxVol2V32cb7va1r6B4AJU/Ac/VTstCjxtn0KKMfbkPc002w== +"@ethersproject/abi@5.0.12", "@ethersproject/abi@^5.0.10": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.12.tgz#9aebe6aedc05ce45bb6c41b06d80bd195b7de77c" + integrity sha512-Ujr/3bwyYYjXLDQfebeiiTuvOw9XtUKM8av6YkoBeMXyGQM9GkjrQlwJMNwGTmqjATH/ZNbRgCh98GjOLiIB1Q== dependencies: "@ethersproject/address" "^5.0.9" "@ethersproject/bignumber" "^5.0.13" @@ -1546,9 +1546,9 @@ react-is "^16.6.3" "@hapi/accept@^5.0.1": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.1.tgz#068553e867f0f63225a506ed74e899441af53e10" - integrity sha512-fMr4d7zLzsAXo28PRRQPXR1o2Wmu+6z+VY1UzDp0iFo13Twj8WePakwXBiqn3E1aAlTpSNzCXdnnQXFhst8h8Q== + version "5.0.2" + resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.2.tgz#ab7043b037e68b722f93f376afb05e85c0699523" + integrity sha512-CmzBx/bXUR8451fnZRuZAJRlzgm0Jgu5dltTX/bszmR2lheb9BpyN47Q1RbaGTsvFzn0PXAEs+lXDKfshccYZw== dependencies: "@hapi/boom" "9.x.x" "@hapi/hoek" "9.x.x" @@ -1987,6 +1987,18 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" +"@motrix/nat-api@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@motrix/nat-api/-/nat-api-0.3.1.tgz#de18e7101cc6ed82e9e1e7b5720cb2b40f490246" + integrity sha512-mUsW8BlSK4bE5kjC5H4oQPjnXXuiRtE2V26tzW/AOroXl5CuhMEr9EDrr+wUFvDHlDwK4B0uSOBa8yILr6AfbQ== + dependencies: + async "^3.2.0" + debug "^4.1.1" + default-gateway "^6.0.1" + request "^2.88.2" + unordered-array-remove "^1.0.2" + xml2js "^0.4.23" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -2005,10 +2017,10 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== -"@openzeppelin/contracts@~3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.2.0.tgz#3e6b3a7662d8ed64271ade96ef42655db983fd9d" - integrity sha512-bUOmkSoPkjnUyMiKo6RYnb0VHBk5D9KKDAgNLzF41aqAM3TeE0yGdFF5dVRcV60pZdJLlyFT/jjXIZCWyyEzAQ== +"@openzeppelin/contracts@~3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.3.0.tgz#ffdb693c5c349fc33bba420248dd3ac0a2d7c408" + integrity sha512-AemZEsQYtUp1WRkcmZm1div5ORfTpLquLaziCIrSagjxyKdmObxuaY1yjQ5SHFMctR8rLwp706NXTbiIRJg7pw== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" @@ -2152,6 +2164,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow== +"@sindresorhus/is@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.0.tgz#2ff674e9611b45b528896d820d3d7a812de2f0e4" + integrity sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ== + "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.2" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz#858f5c4b48d80778fde4b9d541f27edc0d56488b" @@ -2295,6 +2312,13 @@ dependencies: defer-to-connect "^1.0.1" +"@szmarczak/http-timer@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" + integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ== + dependencies: + defer-to-connect "^2.0.0" + "@tokenizer/token@^0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.1.1.tgz#f0d92c12f87079ddfd1b29f614758b9696bc29e3" @@ -2347,6 +2371,16 @@ dependencies: "@types/node" "*" +"@types/cacheable-request@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" + integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + "@types/debug@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" @@ -2365,6 +2399,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/http-cache-semantics@*": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" + integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" @@ -2395,6 +2434,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/keyv@*": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" + integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== + dependencies: + "@types/node" "*" + "@types/long@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" @@ -2413,19 +2459,19 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "14.14.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" - integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== + version "14.14.25" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93" + integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ== "@types/node@^12.12.6": - version "12.19.15" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.15.tgz#0de7e978fb43db62da369db18ea088a63673c182" - integrity sha512-lowukE3GUI+VSYSu6VcBXl14d61Rp5hA1D+61r16qnwC0lYNSqdxcvRh0pswejorHfS+HgwBasM8jLXz0/aOsw== + version "12.19.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.16.tgz#15753af35cbef636182d8d8ca55b37c8583cecb3" + integrity sha512-7xHmXm/QJ7cbK2laF+YYD7gb5MggHIIQwqyjin3bpEGiSuvScMQ5JZZXPvRipi1MwckTQbJZROMns/JxdnIL1Q== "@types/node@^13.7.0": - version "13.13.40" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.40.tgz#f655ef327362cc83912f2e69336ddc62a24a9f88" - integrity sha512-eKaRo87lu1yAXrzEJl0zcJxfUMDT5/mZalFyOkT44rnQps41eS2pfWzbaulSPpQLFNy29bFqn+Y5lOTL8ATlEQ== + version "13.13.41" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.41.tgz#045a4981318d31a581650ce70f340a32c3461198" + integrity sha512-qLT9IvHiXJfdrje9VmsLzun7cQ65obsBTmtU3EOnCSLFOoSHx1hpiRHoBnpdbyFqnzqdUUIv81JcEJQCB8un9g== "@types/parse-json@^4.0.0": version "4.0.0" @@ -2452,6 +2498,18 @@ "@types/node" "*" safe-buffer "*" +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + +"@types/retry@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" + integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== + "@types/secp256k1@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.1.tgz#fb3aa61a1848ad97d7425ff9dcba784549fca5a4" @@ -2822,7 +2880,7 @@ after@0.8.2: resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= -aggregate-error@^3.0.0, aggregate-error@^3.0.1: +aggregate-error@^3.0.0, aggregate-error@^3.0.1, aggregate-error@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== @@ -3148,6 +3206,11 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= +arrify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" + integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== + asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -3240,6 +3303,11 @@ async@^2.6.1, async@^2.6.2: dependencies: lodash "^4.17.14" +async@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" + integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -3570,9 +3638,9 @@ bip66@^1.1.5: safe-buffer "^5.0.1" bl@^4.0.0, bl@^4.0.1, bl@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.3.tgz#12d6287adc29080e22a705e5764b2a9522cdc489" - integrity sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg== + version "4.0.4" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.4.tgz#f4fda39f81a811d0df6368c1ed91dae499d1c900" + integrity sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ== dependencies: buffer "^5.5.0" inherits "^2.0.4" @@ -4005,6 +4073,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -4018,6 +4091,19 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" +cacheable-request@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.1.tgz#062031c2856232782ed694a257fa35da93942a58" + integrity sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^2.0.0" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -4089,9 +4175,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001181: - version "1.0.30001183" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001183.tgz#7a57ba9d6584119bb5f2bc76d3cc47ba9356b3e2" - integrity sha512-7JkwTEE1hlRKETbCFd8HDZeLiQIUcl8rC6JgNjvHCNaxOeNmQ9V4LvQXRUsKIV2CC73qKxljwVhToaA3kLRqTw== + version "1.0.30001185" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001185.tgz#3482a407d261da04393e2f0d61eefbc53be43b95" + integrity sha512-Fpi4kVNtNvJ15H0F6vwmXtb3tukv3Zg3qhKkOGUq7KJ1J6b9kf4dnNgtEAFXhRsJo0gNj9W60+wBvn0JcTvdTg== capture-exit@^2.0.0: version "2.0.0" @@ -4132,9 +4218,9 @@ chai-checkmark@^1.0.1: integrity sha1-n7s8mtkQHwl+8ogyjTD0In10//s= chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== + version "4.3.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.0.tgz#5523a5faf7f819c8a92480d70a8cccbadacfc25f" + integrity sha512-/BFd2J30EcOwmdOgXvVsmM48l0Br0nmZPlO0uOW4XKh6kpsUumRXBgPV+IlaqFaqr9cYbeoZAM1Npx0i4A+aiA== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" @@ -5215,6 +5301,13 @@ decompress-response@^3.2.0, decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + deep-eql@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" @@ -5257,11 +5350,23 @@ default-gateway@^4.2.0: execa "^1.0.0" ip-regex "^2.1.0" +default-gateway@^6.0.1: + version "6.0.3" + resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71" + integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== + dependencies: + execa "^5.0.0" + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +defer-to-connect@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1" + integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== + deferred-leveldown@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.1.0.tgz#c21e40641a8e48530255a4ad31371cc7fe76b332" @@ -5657,9 +5762,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= ejs@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.5.tgz#aed723844dc20acb4b170cd9ab1017e476a0d93b" - integrity sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.6.tgz#5bfd0a0689743bb5268b3550cceeebbc1702822a" + integrity sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw== dependencies: jake "^10.6.1" @@ -5671,9 +5776,9 @@ electron-fetch@^1.7.2: encoding "^0.1.13" electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.649: - version "1.3.652" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.652.tgz#9465d884d609acffd131ba71096de7bfabd63670" - integrity sha512-85J5D0Ksxjq2MIHfgwOURRej72UMlexbaa7t+oKTJan3Pa/RBE8vJ4/JzwaQjLCElPvd0XeLWi7+xYTVrq96aA== + version "1.3.657" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.657.tgz#a9c307f2612681245738bb8d36d997cbb568d481" + integrity sha512-/9ROOyvEflEbaZFUeGofD+Tqs/WynbSTbNgNF+/TJJxH1ePD/e6VjZlDJpW3FFFd3nj5l3Hd8ki2vRwy+gyRFw== elliptic@6.5.3: version "6.5.3" @@ -5826,10 +5931,10 @@ err-code@^2.0.0, err-code@^2.0.1, err-code@^2.0.3: resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== -err-code@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-3.0.0.tgz#8d5af04379f18eeb31e9dce0ca82be8386039c23" - integrity sha512-+oiZkhFGx8PLWbQM/Noi9arR8MAs4ZLEJlzhjSsqsb5lgiSlByIt3aL8TSp/AZ8g95lIDcJeBErlERg9Q9a4ow== +err-code@^3.0.0, err-code@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-3.0.1.tgz#a444c7b992705f2b120ee320b09972eef331c920" + integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== errno@^0.1.3, errno@~0.1.1, errno@~0.1.7: version "0.1.8" @@ -6357,9 +6462,9 @@ esprima@^4.0.0, esprima@^4.0.1: integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1, esquery@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" - integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== dependencies: estraverse "^5.1.0" @@ -6474,11 +6579,11 @@ ethereumjs-util@^6.0.0: rlp "^2.2.3" ethers@^5.0.8: - version "5.0.28" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.28.tgz#3c2a3d41b3639a427a822814870990cfcdd5e0a8" - integrity sha512-prYYCmZMGbrhP2PEXA2re5BpNPjaCP2y5gO1dh1i+fPxdkldQOk+0c0l8KlnxwUztKq4E40xpB0gyURdcAOaAg== + version "5.0.29" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.0.29.tgz#37034758b31e6545926e400ffbe7222a39e39e7b" + integrity sha512-uNMOIbr9dXzBrHwcdelYlkvkPuL8chlPE8i++aNPCCAgI4agl0e9l/FRdToqu/cCQG8uNwmJlJp2eq4wU0oAMA== dependencies: - "@ethersproject/abi" "5.0.11" + "@ethersproject/abi" "5.0.12" "@ethersproject/abstract-provider" "5.0.9" "@ethersproject/abstract-signer" "5.0.12" "@ethersproject/address" "5.0.10" @@ -6545,7 +6650,7 @@ eventemitter3@^4.0.0, eventemitter3@^4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.0.0, events@^3.1.0: +events@^3.0.0, events@^3.1.0, events@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== @@ -6869,9 +6974,9 @@ file-uri-to-path@1.0.0: integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== filelist@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.1.tgz#f10d1a3ae86c1694808e8f20906f43d4c9132dbb" - integrity sha512-8zSK6Nu0DQIC08mUC46sWGXi+q3GGpKydAG36k+JDba6VRpkevvOWUW5a/PhShij4+vHT9M+ghgG7eM+a9JDUQ== + version "1.0.2" + resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.2.tgz#80202f21462d4d1c2e214119b1807c1bc0380e5b" + integrity sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ== dependencies: minimatch "^3.0.4" @@ -7235,9 +7340,9 @@ fsevents@~2.1.2: integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== fsevents@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" - integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" @@ -7434,7 +7539,7 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" -globalthis@^1.0.0, globalthis@^1.0.1: +globalthis@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.1.tgz#40116f5d9c071f9e8fb0037654df1ab3a83b7ef9" integrity sha512-mJPRTc/P39NH/iNG4mXa9aIhNymaQikTrnspeCa2ZuJ+mH2QN/rXwtX3XwKrHqWgUQFbNZKtHM105aHzJalElw== @@ -7482,6 +7587,23 @@ got@9.6.0, got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" +got@^11.7.0: + version "11.8.1" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.1.tgz#df04adfaf2e782babb3daabc79139feec2f7e85d" + integrity sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.1" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" @@ -7503,9 +7625,9 @@ got@^7.1.0: url-to-options "^1.0.1" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + version "4.2.5" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.5.tgz#bc18864a6c9fc7b303f2e2abdb9155ad178fbe29" + integrity sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw== growl@1.10.5: version "1.10.5" @@ -7956,6 +8078,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.0-beta.5.2" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3" + integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -8249,11 +8379,11 @@ interface-datastore@^2.0.0: nanoid "^3.0.2" interface-datastore@^3.0.1, interface-datastore@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-3.0.3.tgz#a994f22b5a74e91dc4575d20f32b71dcecf282ff" - integrity sha512-T7CFAoJptmFgBuVYjDAHiSlFjZRlabLBL1n/zp8bG7Xq7K3uicbHIRvKaWE2bR74IqtECdjWovdeKtZccCmV6w== + version "3.0.4" + resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-3.0.4.tgz#7c02d393fb0372bc86c03de1095e15ae70912771" + integrity sha512-WEO09j/VRF866je3UXfk64GTWi0ag5mH+jbTbOYX7rkhcNnvAvYvvtysOu2vzUXaM1nBmtI9SjMpp4dqXOE+LA== dependencies: - err-code "^2.0.1" + err-code "^3.0.1" ipfs-utils "^6.0.0" iso-random-stream "^1.1.1" it-all "^1.0.2" @@ -8912,7 +9042,7 @@ ipfs-utils@^6.0.0: stream-to-it "^0.2.2" web-encoding "^1.0.6" -ipfs@~0.52.0: +ipfs@~0.52.0, ipfs@~0.52.1: version "0.52.3" resolved "https://registry.yarnpkg.com/ipfs/-/ipfs-0.52.3.tgz#4a1e1651da197fb8dfdcd01abd20308198059b66" integrity sha512-zCd2Ziq1GYDJizXdoAj5nof325i3mx2kzOhG6E+xdEK6FcK6kQwKendaBlQHwTbzHLqLI7ITxsepQzFWNopI2g== @@ -9385,11 +9515,30 @@ is-plain-object@~5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-port-reachable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-3.0.0.tgz#edf721e7d354e6e00cbeb0fc174ad89bdf6056b3" + integrity sha512-056IzLiWHdgVd6Eq1F9HtJl+cIkvi5X2MJ/A1fjQtByHkzQE1wGardnPhqrarOGDF88BOW+297X7PDvZ2vcyVg== + is-promise@~1, is-promise@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-1.0.1.tgz#31573761c057e33c2e91aab9e96da08cefbe76e5" integrity sha1-MVc3YcBX4zwukaq56W2gjO++duU= +is-reachable@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-reachable/-/is-reachable-5.0.0.tgz#caa3a4d1c6368fdafb85cdb7d1e219e5b8fded6b" + integrity sha512-frRPbdrQWEqbnF1il9Dyrf52Q40exkHdo4/grWMjHrBn4G1DKC9sbuQihgANkJPNi2eosU4AXBsrITdXmc3IQg== + dependencies: + arrify "^2.0.1" + got "^11.7.0" + is-port-reachable "^3.0.0" + p-any "^3.0.0" + p-timeout "^3.2.0" + prepend-http "^3.0.1" + router-ips "^1.0.0" + url-parse "^1.4.7" + is-regex@^1.0.4, is-regex@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" @@ -9638,6 +9787,11 @@ it-drain@^1.0.1, it-drain@^1.0.3: resolved "https://registry.yarnpkg.com/it-drain/-/it-drain-1.0.3.tgz#2a3e6e667f65f5711faedb40ffb5358927609e93" integrity sha512-KxwHBEpWW+0/EkGCOPR2MaHanvBW2A76tOC5CiitoJGLd8J56FxM6jJX3uow20v5qMidX5lnKgwH5oCIyYDszQ== +it-filter@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/it-filter/-/it-filter-1.0.1.tgz#073517f0bf7dd23afadbdbe90d97e5247cc3b9c9" + integrity sha512-emxG4SEhhk9O2TCCTBd23NDjd5641e2hAwaGBQ5jZrUAtBTjkqit5FW423fSc1H+OOQk2wBiKU4y/JrEpkxFiA== + it-first@^1.0.1, it-first@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/it-first/-/it-first-1.0.4.tgz#359f2bf216686ec7498827991dc7fd503283b32b" @@ -9700,6 +9854,13 @@ it-map@^1.0.2, it-map@^1.0.4: resolved "https://registry.yarnpkg.com/it-map/-/it-map-1.0.4.tgz#d413d2b0c3d8d9703df9e8a915ad96cb74a837ac" integrity sha512-LZgYdb89XMo8cFUp6jF0cn5j3gF7wcZnKRVFS3qHHn0bPB2rpToh2vIkTBKduZLZxRRjWx1VW/udd98x+j2ulg== +it-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/it-merge/-/it-merge-1.0.0.tgz#b12310933ee79381eca2288245572a4f8d252030" + integrity sha512-bs40LMjG/9JMOcJ7pgyGLoOeWBpw28ZoMmZIk/1NCa5SUxd4elXCuadAr2qSjPiHz2GxrqoWGFAP7SePGddatw== + dependencies: + it-pushable "^1.4.0" + it-multipart@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/it-multipart/-/it-multipart-1.0.6.tgz#afe6722932e11e87108edc26f10d703410207948" @@ -9769,6 +9930,11 @@ it-reader@^2.0.0, it-reader@^2.1.0: dependencies: bl "^4.0.0" +it-take@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/it-take/-/it-take-1.0.0.tgz#2319a39d91463b4bf6151289126aa44889eda903" + integrity sha512-zfr2iAtekTGhHVWzCqqqgDnHhmzdzfCW92L0GvbaSFlvc3n2Ep/sponzmlNl2Kg39N5Py+02v+Aypc+i2c+9og== + it-tar@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/it-tar/-/it-tar-1.2.2.tgz#8d79863dad27726c781a4bcc491f53c20f2866cf" @@ -10378,6 +10544,11 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -10527,11 +10698,11 @@ just-safe-set@^2.1.0: integrity sha512-wSTg/2bQpzyivBYbWPqQgafdfxW0tr3hX9qYGDRS2ws+AXwc7tvn8ABqkp8iPQHChjj4F5JvL3t0FQLbcNuKig== k-bucket@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/k-bucket/-/k-bucket-5.0.0.tgz#ef7a401fcd4c37cd31dceaa6ae4440ca91055e01" - integrity sha512-r/q+wV/Kde62/tk+rqyttEJn6h0jR7x+incdMVSYTqK73zVxVrzJa70kJL49cIKen8XjIgUZKSvk8ktnrQbK4w== + version "5.1.0" + resolved "https://registry.yarnpkg.com/k-bucket/-/k-bucket-5.1.0.tgz#db2c9e72bd168b432e3f3e8fc092e2ccb61bff89" + integrity sha512-Fac7iINEovXIWU20GPnOMLUbjctiS+cnmyjC4zAUgvs3XPf1vo9akfCHkigftSic/jiKqKl+KA3a/vFcJbHyCg== dependencies: - randombytes "^2.0.3" + randombytes "^2.1.0" keccak@^3.0.0: version "3.0.1" @@ -10558,6 +10729,13 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +keyv@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" + integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== + dependencies: + json-buffer "3.0.1" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -10803,7 +10981,7 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -libp2p-bootstrap@^0.12.1: +libp2p-bootstrap@^0.12.1, libp2p-bootstrap@~0.12.1: version "0.12.1" resolved "https://registry.yarnpkg.com/libp2p-bootstrap/-/libp2p-bootstrap-0.12.1.tgz#216322e2d682935c8ee1c7b672acf69241178c3c" integrity sha512-atHXxfxE8isHb+XKHsJ5UgFMteqfi0Xal94h+2EAJmobXcIq1mBMUeIgmkHMsaZZNwJwQxq6MKFthJngWJ8vEw== @@ -10933,6 +11111,22 @@ libp2p-gossipsub@^0.6.1: time-cache "^0.3.0" uint8arrays "^1.1.0" +libp2p-gossipsub@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/libp2p-gossipsub/-/libp2p-gossipsub-0.8.0.tgz#b9c961560dc02afa079790f44882854a19a94abf" + integrity sha512-nR5XGN6E5n2ukPR9aa/rtegwluxiK+vT9j5Oulp+P1h6T9vEqDvFAEe9cqA3FiT7apI5gk44SE0aZFTMpxz6EA== + dependencies: + "@types/debug" "^4.1.5" + debug "^4.1.1" + denque "^1.4.1" + err-code "^2.0.0" + it-pipe "^1.0.1" + libp2p-interfaces "^0.8.0" + peer-id "^0.14.0" + protons "^2.0.0" + time-cache "^0.3.0" + uint8arrays "^1.1.0" + libp2p-interfaces@^0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/libp2p-interfaces/-/libp2p-interfaces-0.5.2.tgz#8794f0753b26c98270d03d63d753f456c5d0a766" @@ -10999,7 +11193,7 @@ libp2p-interfaces@^0.6.0: streaming-iterables "^5.0.2" uint8arrays "^1.1.0" -libp2p-interfaces@^0.8.2, libp2p-interfaces@^0.8.3: +libp2p-interfaces@^0.8.0, libp2p-interfaces@^0.8.1, libp2p-interfaces@^0.8.2, libp2p-interfaces@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/libp2p-interfaces/-/libp2p-interfaces-0.8.3.tgz#6f8ec391f9f5129be4d470a58bb88e556890d2ba" integrity sha512-Q8YM2oS4gvlPOuespYRp3jZryxYF5RyuyF+SLUhwjFh3yT6HbiKcxTtMmhOEnyyRgawj0NIDdARJ7h5aUcsA5w== @@ -11033,7 +11227,7 @@ libp2p-interfaces@^0.8.2, libp2p-interfaces@^0.8.3: streaming-iterables "^5.0.4" uint8arrays "^2.0.5" -libp2p-kad-dht@^0.20.1: +libp2p-kad-dht@^0.20.1, libp2p-kad-dht@~0.20.1: version "0.20.6" resolved "https://registry.yarnpkg.com/libp2p-kad-dht/-/libp2p-kad-dht-0.20.6.tgz#18bcc903f614d3397f523a2ab8d122ef5ba3d5e0" integrity sha512-hRClzJP+NK3zBU0/pYkoDUhZcviqmPu4czFaftcl3cCGasjxSaWNEZNKsf65QwoINZD9jFrYkQuXW9/gWQwuOA== @@ -11068,7 +11262,7 @@ libp2p-kad-dht@^0.20.1: varint "^5.0.0" xor-distance "^2.0.0" -libp2p-mdns@^0.15.0: +libp2p-mdns@^0.15.0, libp2p-mdns@~0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/libp2p-mdns/-/libp2p-mdns-0.15.0.tgz#c4e71e162ef2ea817d9d745376a1acac1271fe51" integrity sha512-wuILE+mwC6ww/0TMkR3k2h53D5Ma9TXpz0siacbsACcGukkS+mIpsvruaf9U1Uxe0F1aC8+Y+Vi5lP8C3YR9Lg== @@ -11078,7 +11272,7 @@ libp2p-mdns@^0.15.0: multicast-dns "^7.2.0" peer-id "^0.14.0" -libp2p-mplex@^0.10.0: +libp2p-mplex@^0.10.0, libp2p-mplex@~0.10.0: version "0.10.2" resolved "https://registry.yarnpkg.com/libp2p-mplex/-/libp2p-mplex-0.10.2.tgz#99f1381b43258269bab2425ff5ebd500512cacb4" integrity sha512-fNdlPTts2MmGalPTYdQtzeGeuM73je9mP+2OvB6Gdn5vP9LeutUzUV4wvD9ISDVi8Gru5BzCsIBiS3WjxQqjdw== @@ -11092,7 +11286,7 @@ libp2p-mplex@^0.10.0: it-pushable "^1.4.1" varint "^6.0.0" -libp2p-noise@^2.0.1: +libp2p-noise@^2.0.1, libp2p-noise@~2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/libp2p-noise/-/libp2p-noise-2.0.4.tgz#dc915dd80a5158848ababdc6ad650a86537dd887" integrity sha512-BE+bf4cXii1kcJQ50ZcoVSmqt2ab76p5EyL3praDGkQznjQ6+VKUMR8yNPCbxkQ7CxM1wpUA3Jj5m6FKM9nPZA== @@ -11121,7 +11315,7 @@ libp2p-record@^0.9.0: protons "^2.0.0" uint8arrays "^1.1.0" -libp2p-tcp@^0.15.0, libp2p-tcp@^0.15.1: +libp2p-tcp@^0.15.0, libp2p-tcp@^0.15.1, libp2p-tcp@~0.15.1: version "0.15.3" resolved "https://registry.yarnpkg.com/libp2p-tcp/-/libp2p-tcp-0.15.3.tgz#dbcca2be5ff22ef5f7ebd1a403081d0360834c8c" integrity sha512-j9efQ0aAbcCmVnnF0UqWH1r+qjNc0TpC3bV+QJDxBIe6v92a8l3kZ04G/QkP3vmzDT5Z4ayzMGjrOAas8hJIBA== @@ -11135,7 +11329,7 @@ libp2p-tcp@^0.15.0, libp2p-tcp@^0.15.1: multiaddr "^8.0.0" stream-to-it "^0.2.2" -libp2p-utils@^0.2.0, libp2p-utils@^0.2.1: +libp2p-utils@^0.2.0, libp2p-utils@^0.2.1, libp2p-utils@^0.2.2: version "0.2.3" resolved "https://registry.yarnpkg.com/libp2p-utils/-/libp2p-utils-0.2.3.tgz#4eb2a59a9eda342bed73cb94553c87a63c95848a" integrity sha512-9BoMCgvJF7LJ+JVMaHtqfCqhZN4i/sx0DrY6lf9U0Rq9uUgQ9qTai2O9LXcfr1LOS3OMMeRLsKk25MMgsf7W3w== @@ -11160,7 +11354,7 @@ libp2p-webrtc-peer@^10.0.1: randombytes "^2.0.3" readable-stream "^3.4.0" -libp2p-webrtc-star@^0.20.1, libp2p-webrtc-star@~0.20.5: +libp2p-webrtc-star@^0.20.1, libp2p-webrtc-star@~0.20.2, libp2p-webrtc-star@~0.20.5: version "0.20.8" resolved "https://registry.yarnpkg.com/libp2p-webrtc-star/-/libp2p-webrtc-star-0.20.8.tgz#57a599e236704177b709580dcc429ae8f6055c54" integrity sha512-SvcPu4be/EfMXPbR3I+SemIuGNWmQiAAtUsire5M5Bomb2aSp7yeO1DKvl8+rZbhjn3YsSr8GlB+Wk9vRDm7tA== @@ -11248,6 +11442,64 @@ libp2p@^0.29.3: varint "^5.0.0" xsalsa20 "^1.0.2" +libp2p@~0.30.0: + version "0.30.7" + resolved "https://registry.yarnpkg.com/libp2p/-/libp2p-0.30.7.tgz#965fe05a9045b7614d268c4050918182d8ca81f3" + integrity sha512-W+uaMY7K9KJh9L9LFw/D2NjH63TS6skjlNRqzhG99b//IJqdNQoVWeGNGsjgMPqKu+BMngtMn+iH3+Jjz2Bk2w== + dependencies: + "@motrix/nat-api" "^0.3.1" + abort-controller "^3.0.0" + aggregate-error "^3.1.0" + any-signal "^2.1.1" + bignumber.js "^9.0.1" + cids "^1.1.5" + class-is "^1.1.0" + debug "^4.3.1" + err-code "^2.0.0" + events "^3.2.0" + hashlru "^2.3.0" + interface-datastore "^3.0.3" + ipfs-utils "^6.0.0" + it-all "^1.0.4" + it-buffer "^0.1.2" + it-drain "^1.0.3" + it-filter "^1.0.1" + it-first "^1.0.4" + it-handshake "^1.0.2" + it-length-prefixed "^3.1.0" + it-map "^1.0.4" + it-merge "1.0.0" + it-pipe "^1.1.0" + it-protocol-buffers "^0.2.0" + it-take "1.0.0" + libp2p-crypto "^0.19.0" + libp2p-interfaces "^0.8.1" + libp2p-utils "^0.2.2" + mafmt "^8.0.0" + merge-options "^3.0.4" + moving-average "^1.0.0" + multiaddr "^8.1.0" + multicodec "^2.1.0" + multihashing-async "^2.0.1" + multistream-select "^1.0.0" + mutable-proxy "^1.0.0" + node-forge "^0.10.0" + p-any "^3.0.0" + p-fifo "^1.0.0" + p-retry "^4.2.0" + p-settle "^4.0.1" + peer-id "^0.14.2" + private-ip "^2.0.0" + promisify-es6 "^1.0.3" + protons "^2.0.0" + retimer "^2.0.0" + sanitize-filename "^1.6.3" + set-delayed-interval "^1.0.0" + streaming-iterables "^5.0.2" + timeout-abort-controller "^1.1.1" + varint "^6.0.0" + xsalsa20 "^1.0.2" + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -11683,9 +11935,9 @@ microevent.ts@~0.1.1: integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== micromark@~2.11.0: - version "2.11.3" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.3.tgz#648e1e7970ea66a946cc2cbc678093ed814f29ed" - integrity sha512-oph5YYkVqR2U9OtWBcXYysZMtrdIvi8dfSeyEdr1wFr3Bk6YwI6THosX2AzKnhdps7mVUbXiqhmosu9DcA+xlQ== + version "2.11.4" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" + integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== dependencies: debug "^4.0.0" parse-entities "^2.0.0" @@ -11766,6 +12018,11 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" @@ -11944,15 +12201,14 @@ mock-fs@^4.1.0: integrity sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA== mortice@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mortice/-/mortice-2.0.0.tgz#7be171409c2115561ba3fc035e4527f9082eefde" - integrity sha512-rXcjRgv2MRhpwGHErxKcDcp5IoA9CPvPFLXmmseQYIuQ2fSVu8tsMKi/eYUXzp/HH1s6y3IID/GwRqlSglDdRA== + version "2.0.1" + resolved "https://registry.yarnpkg.com/mortice/-/mortice-2.0.1.tgz#047b83c8c57d49e90e586f1f9e7d63e1f80d4a2b" + integrity sha512-9gsXmjq+5LZmXDIoyC/crf2i/7CUwDGSBEwSEsr1i/WfKmJ6DVt38B5kg6BE/WF/1/yfGJYiB1Wyiu423iI3nQ== dependencies: - globalthis "^1.0.0" + nanoid "^3.1.20" observable-webworkers "^1.0.0" p-queue "^6.0.0" promise-timeout "^1.3.0" - shortid "^2.2.8" move-concurrently@^1.0.1: version "1.0.1" @@ -12219,11 +12475,6 @@ nano-json-stream-parser@^0.1.2: resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= -nanoid@^2.1.0: - version "2.1.11" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" - integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== - nanoid@^3.0.2, nanoid@^3.1.12, nanoid@^3.1.20, nanoid@^3.1.3: version "3.1.20" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" @@ -13149,6 +13400,14 @@ p-retry@^3.0.1: dependencies: retry "^0.12.0" +p-retry@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.3.0.tgz#a31679a66b0261a51fa6c43b19b6f4471a54021e" + integrity sha512-Pow4yaHpOiJou1QcpGcBJhGHiS4782LdDa6GhU91hlaNh3ExOOupjSJcxPQZYmUSZk3Pl2ARz/LRvW8Qu0+3mQ== + dependencies: + "@types/retry" "^0.12.0" + retry "^0.12.0" + p-series@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-series/-/p-series-1.1.0.tgz#f2d8522cdfd58b464eb9685651d465037ee3c957" @@ -14339,6 +14598,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prepend-http@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-3.0.1.tgz#3e724d58fd5867465b300bb9615009fa2f8ee3b6" + integrity sha512-BLxfZh+m6UiAiCPZFJ4+vYoL7NrRs5XgCTRrjseATAggXhdZKKxn+JUNmuVYWY23bDHgaEHodxw8mnmtVEDtHw== + prettier@^1.14.3: version "1.19.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" @@ -14367,7 +14631,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -private-ip@^2.1.1: +private-ip@^2.0.0, private-ip@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/private-ip/-/private-ip-2.1.1.tgz#cd4ac7481099991e211706f411aede9725c1712f" integrity sha512-csxTtREJ7254nnUF14hjOrnd/vZH78vTS5opec6IDVZRwY3omKDcNL/r+vfxFZnCRsrBWVA8B0Q95lgMGrFuZQ== @@ -14463,6 +14727,11 @@ promise@~1.3.0: dependencies: is-promise "~1" +promisify-es6@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/promisify-es6/-/promisify-es6-1.0.3.tgz#b012668c4df3c965ce13daac2b3a4d1726a96346" + integrity sha512-N9iVG+CGJsI4b4ZGazjwLnxErD2d9Pe4DPvvXSxYA9tFNu8ymXME4Qs5HIQ0LMJpNM7zj+m0NlNnNeqFpKzqnA== + prompts@^2.0.1: version "2.4.0" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.0.tgz#4aa5de0723a231d1ee9121c40fdf663df73f61d7" @@ -14672,6 +14941,11 @@ quick-format-unescaped@^4.0.1: resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.1.tgz#437a5ea1a0b61deb7605f8ab6a8fd3858dbeb701" integrity sha512-RyYpQ6Q5/drsJyOhrWHYMWTedvjTIat+FTwv0K4yoUxzvekw2aRHMQJLlnvt8UantkZg2++bEzD9EdxXqkWf4A== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + rabin-wasm@^0.1.1: version "0.1.4" resolved "https://registry.yarnpkg.com/rabin-wasm/-/rabin-wasm-0.1.4.tgz#062310686acfc9e05c13c7156a2339af148c78f2" @@ -14794,9 +15068,9 @@ react-dom@~16.13.1: scheduler "^0.19.1" react-error-overlay@^6.0.7: - version "6.0.8" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.8.tgz#474ed11d04fc6bda3af643447d85e9127ed6b5de" - integrity sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw== + version "6.0.9" + resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" + integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== react-i18next@^11.7.3: version "11.8.5" @@ -15257,7 +15531,7 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.79.0, request@^2.87.0, request@^2.88.0: +request@^2.79.0, request@^2.87.0, request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -15313,6 +15587,11 @@ reset@^0.1.0: resolved "https://registry.yarnpkg.com/reset/-/reset-0.1.0.tgz#9fc7314171995ae6cb0b7e58b06ce7522af4bafb" integrity sha1-n8cxQXGZWubLC35YsGznUir0uvs= +resolve-alpn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" + integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA== + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -15383,6 +15662,13 @@ responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +responselike@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" + integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== + dependencies: + lowercase-keys "^2.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -15451,7 +15737,7 @@ rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3, rimraf@^2.7.1: dependencies: glob "^7.1.3" -rimraf@^3.0.2: +rimraf@^3.0.2, rimraf@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -15473,6 +15759,11 @@ rlp@^2.2.3: dependencies: bn.js "^4.11.1" +router-ips@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/router-ips/-/router-ips-1.0.0.tgz#44e00858ebebc0133d58e40b2cd8a1fbb04203f5" + integrity sha1-ROAIWOvrwBM9WOQLLNih+7BCA/U= + rsa-pem-to-jwk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/rsa-pem-to-jwk/-/rsa-pem-to-jwk-1.1.3.tgz#245e76bdb7e7234cfee7ca032d31b54c38fab98e" @@ -15579,7 +15870,7 @@ sass-loader@8.0.2: schema-utils "^2.6.1" semver "^6.3.0" -sax@^1.2.4, sax@~1.2.4: +sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -15775,6 +16066,11 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-delayed-interval@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/set-delayed-interval/-/set-delayed-interval-1.0.0.tgz#1f7c065780a365f10250f8a80e2be10175ea0388" + integrity sha512-29fhAwuZlLcuBnW/EwxvLcg2D3ELX+VBDNhnavs3YYkab72qmrcSeQNVdzl8EcPPahGQXhBM6MKdPLCQGMDakw== + set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" @@ -15874,13 +16170,6 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -shortid@^2.2.8: - version "2.2.16" - resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608" - integrity sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g== - dependencies: - nanoid "^2.1.0" - side-channel@^1.0.3, side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -16099,9 +16388,9 @@ solhint@~3.3.2: prettier "^1.14.3" sonic-boom@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.3.0.tgz#5c77c846ce6c395dddf2eb8e8e65f9cc576f2e76" - integrity sha512-4nX6OYvOYr6R76xfQKi6cZpTO3YSWe/vd+QdIfoH0lBy0MnPkeAbb2rRWgmgADkXUeCKPwO1FZAKlAVWAadELw== + version "1.3.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.3.1.tgz#6b990fa01f2d7c42e9a3efc90014d6e4337faccb" + integrity sha512-h214kmhZulOKwYQCC9ABv5DQBfOT5oXQ7UdIKMQXcx/F2FLBw1QchiAQJVdPV8MC80toQLd5VLdIQedf7RTEYA== dependencies: atomic-sleep "^1.0.0" flatstr "^1.0.12" @@ -16949,10 +17238,10 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== -truffle@~5.1.55: - version "5.1.64" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.1.64.tgz#f89dcd3711a8c872c8c5dfd5527e49dcded4c175" - integrity sha512-qobAgDRRK8rUr6SjH8gmacp1a50XJFD2zX1tCtxdk3RXl3yCSEBxHP1srW+jPoPzL6Ua6C0vbbbjVbemrTrtAQ== +truffle@~5.1.58: + version "5.1.65" + resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.1.65.tgz#2f31dc9481c74d04c4d72cfb3085f6ee9752d0d2" + integrity sha512-MT7kTrMP1tleqwEzGWj/4wKU3pIOR63cVGsrP0MgEDrXOrpM5XNHnCAp9YBrYsDXqiVPZiEK38385qoJdTk6yA== dependencies: app-module-path "^2.2.0" mocha "8.1.2" @@ -16996,9 +17285,9 @@ tslib@^2.0.3: integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== tsparticles@^1.18.10: - version "1.18.11" - resolved "https://registry.yarnpkg.com/tsparticles/-/tsparticles-1.18.11.tgz#924d74cf40656727f5df047b53c4761463a4f6e7" - integrity sha512-F5czk8foRoywWHDYDT0eZhQwCXOHz7OGhJCsoybThTUIT+nwc1Eclltm/TMrnnxZZghF3Fo0VL8nN4inf+pQbA== + version "1.18.12" + resolved "https://registry.yarnpkg.com/tsparticles/-/tsparticles-1.18.12.tgz#b6fb441c90b99ab1177c7db2ac9b09e9c24d9ca1" + integrity sha512-7WY31HckCzzaiuudQlIeCE3Y5C4AslnJsuM/aeSDMErx7p7GjXzfUIO5qpzwyoJ7KRNURxIhADTXSDEtqkJFxw== optionalDependencies: pathseg "^1.2.0" @@ -17140,9 +17429,9 @@ uint8arrays@1.1.0, uint8arrays@^1.0.0, uint8arrays@^1.1.0: web-encoding "^1.0.2" uint8arrays@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-2.0.5.tgz#763d0c3dd8e1d05b656d2e60c8a9a53096a47d9e" - integrity sha512-1HSktgwqtYIwVn1mg3GcnqKhHH9oC4kVgdD/43cxMWwhP8rihKcFPmToDzS1XtbvVvlR8XxTk/DUBf0C83qNIg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-2.1.2.tgz#7b4ff064e0d033bae3ecbf15860dd60458d6aebd" + integrity sha512-/VcLZbPMs/dk23u22IZlPWycfBxntpwrvISHQs93/OdRlUTnQw9Uzmzaoq7DgJAZl1SlP/kw+NhbjFAEED42rQ== dependencies: multibase "^3.0.0" web-encoding "^1.0.5" @@ -17286,6 +17575,11 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== +unordered-array-remove@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unordered-array-remove/-/unordered-array-remove-1.0.2.tgz#c546e8f88e317a0cf2644c97ecb57dba66d250ef" + integrity sha1-xUbo+I4xegzyZEyX7LV9umbSUO8= + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -17372,7 +17666,7 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url-parse@^1.4.3: +url-parse@^1.4.3, url-parse@^1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== @@ -17748,7 +18042,7 @@ web3-eth-accounts@1.3.4: web3-core-method "1.3.4" web3-utils "1.3.4" -web3-eth-contract@1.3.4: +web3-eth-contract@1.3.4, web3-eth-contract@^1.3.1: version "1.3.4" resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.4.tgz#1ea2dd71be0c4a9cf4772d4f75dbb2fa99751472" integrity sha512-Fvy8ZxUksQY2ePt+XynFfOiSqxgQtMn4m2NJs6VXRl2Inl17qyRi/nIJJVKTcENLocm+GmZ/mxq2eOE5u02nPg== @@ -18336,6 +18630,15 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" +wrtc@~0.4.6: + version "0.4.7" + resolved "https://registry.yarnpkg.com/wrtc/-/wrtc-0.4.7.tgz#c61530cd662713e50bffe64b7a78673ce070426c" + integrity sha512-P6Hn7VT4lfSH49HxLHcHhDq+aFf/jd9dPY7lDHeFhZ22N3858EKuwm2jmnlPzpsRGEPaoF6XwkcxY5SYnt4f/g== + dependencies: + node-pre-gyp "^0.13.0" + optionalDependencies: + domexception "^1.0.1" + ws@7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46" @@ -18416,6 +18719,19 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml2js@^0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66" + integrity sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug== + dependencies: + sax ">=0.6.0" + xmlbuilder "~11.0.0" + +xmlbuilder@~11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" + integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== + xmlchars@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"