-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyperspace #17
Draft
lalexgap
wants to merge
38
commits into
master
Choose a base branch
from
hyperspace
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Hyperspace #17
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
c040888
add hyperspace config
lalexgap 25e0bd7
update simple hub
lalexgap e193ded
update start script to handle hyperspace
lalexgap c73a67f
update bignumberify to work with latest ethers
lalexgap 25d92a9
update ethers and our local state channel packages
lalexgap 6b7896f
disable chain id check for now
lalexgap e5a5239
initialize hub comms after our wallet is enabled
lalexgap 3735171
remove preinstall
lalexgap c04d838
fix weird import error
lalexgap 225fc92
check in lockfile
geoknee c71b6d9
use BigNumber.from() instead of utils.Bignumberify
geoknee 9df989d
use "0x00" instead ofutils.zeroPad('0x0', 20)
geoknee b390c4f
Merge pull request #18 from statechannels/hyperspace-george-fixes
lalexgap 10e0c1e
remove extra init
lalexgap a9c8f6f
add prod env vars
lalexgap 7b3edb8
update to hyperspace provider
lalexgap ab6ac9b
get simple-hub deploying
lalexgap d2ad248
use heroku url for tracker
lalexgap 54d68d5
update to TFIL denoms
lalexgap 4900f2b
remove <p> tag
geoknee 18903ac
networkChanged => chainChanged
geoknee f12b52d
patch @statechannels/iframe-channel-provider
geoknee 24dd17b
Merge pull request #20 from statechannels/quirks
geoknee f175f87
Merge pull request #21 from statechannels/patch-iframe-provider
geoknee dc157ff
remove chatlio
lalexgap db33d67
update persistent seeder for hyperspace
lalexgap ec10b66
yarn.lock update
lalexgap 49636dd
try longer yarn timeout for persistent seeder
lalexgap 5831974
update FAQ link
geoknee cde6e74
Merge pull request #22 from statechannels/faq-link
geoknee 198f6c3
Ethererum -> Hyperspace
30118cb
channels -> channel
ae88126
ETH -> tFIL
0010d4a
add link to chainlist hyperspace wallet connection
6ecb0eb
update to new firebase
lalexgap a52d905
Merge pull request #24 from statechannels/cmk.ethereum-to-hyperspace
NiloCK 2df122b
make prettier happy
geoknee 8d91103
Merge pull request #25 from statechannels/prettier
geoknee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## all | ||
NODE_ENV = 'production' | ||
LOG_DESTINATION = 'console' | ||
LOG_LEVEL = 'info' | ||
# e2e-tests | ||
BROWSER_LOG_DESTINATION = 'browser.log' | ||
HEADLESS = 'false' | ||
USE_DAPPETEER = 'true' | ||
WEB3TORRENT_URL = 'http://localhost:3000' | ||
CLOSE_BROWSERS = 'true' | ||
|
||
## web3torrent, xstate-wallet, rps, simple-hub | ||
CHAIN_NETWORK_ID = '3141' | ||
|
||
## simple-hub, e2e | ||
INFURA_API_KEY = '' | ||
RPC_ENDPOINT = https://api.hyperspace.node.glif.io/rpc/v1 | ||
|
||
## simple-hub, rps | ||
FIREBASE_API_KEY = 'AIzaSyAOvhDzJir_El3O6SJ2xQlrpOisnObq6zw' | ||
FIREBASE_PREFIX = 'netlify-hyperspace' | ||
FIREBASE_PROJECT = 'web3torrent-default-rtdb' | ||
|
||
## rps, xstate-wallet, ttt | ||
TARGET_NETWORK = 'hyperspace' | ||
|
||
## web3torrent, rps, ttt | ||
WALLET_URL = 'http://localhost:3055' | ||
|
||
## simple-hub, xstate-wallet | ||
CONSENSUS_APP_ADDRESS = '0xeB1170bf49fac482fA296C98Ac04024e8a2d6519' | ||
|
||
NITRO_ADJUDICATOR_ADDRESS = '0xaA512d99EC808FBf49b1e6491A251f2E75f913Ad' | ||
ETH_ASSET_HOLDER_ADDRESS = '0x6abaBB7e642C794264DAa2a1477B48521AaE1553' | ||
|
||
TRIVIAL_APP_ADDRESS = '0x95900b17Bd2CE12431C99A886FfDC5a451C14344' | ||
|
||
## simple-hub | ||
FIREBASE_URL = https://${FIREBASE_PROJECT}.firebaseio.com/ | ||
# This is a funded address on goerli for the hub. This is NOT the production address/key | ||
HUB_CHAIN_PK = '0xBB72BD0824663E0B52FA3523ACED0F866550BBC1FD600D7F2DA9C45CAC509AE7' | ||
HUB_PARTICIPANT_ID = 'firebase:simple-hub' | ||
|
||
## xstate-wallet | ||
# This is a funded address on goerli for the hub. This is NOT the production address/key | ||
HUB_DESTINATION = '0x000000000000000000000000c4FB59b7fb0D8001Bda6DEA539117664573006c9' | ||
USE_INDEXED_DB = 'true' | ||
|
||
## web3torrent | ||
FUNDING_STRATEGY = 'Virtual' | ||
SINGLE_ASSET_PAYMENT_CONTRACT_ADDRESS = '0x4964f1aE3Ca9Ea0a1e7EF873a379768dBc74F034' | ||
SKIP_PREFLIGHT_CHECK = 'true' | ||
TRACKER_URL = 'localhost:8000' | ||
TRACKER_URL_HTTP_PROTOCOL = 'http' | ||
GENERATE_SOURCEMAP = 'true' | ||
|
||
## rps | ||
RPS_CONTRACT_ADDRESS = '0x' | ||
|
||
## web3torrent-tracker | ||
TRACKER_PORT = 80 | ||
|
||
## ttt | ||
TTT_CONTRACT_ADDRESS = '0x' | ||
FIREBASE_PROJECT_TTT = 'tic-tac-toe-production' | ||
|
||
|
||
ADD_LOGS = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## all | ||
NODE_ENV = 'production' | ||
LOG_DESTINATION = 'console' | ||
LOG_LEVEL = 'info' | ||
# e2e-tests | ||
BROWSER_LOG_DESTINATION = 'browser.log' | ||
HEADLESS = 'false' | ||
USE_DAPPETEER = 'true' | ||
WEB3TORRENT_URL = 'https://hyperspace-torrent.statechannels.org' | ||
CLOSE_BROWSERS = 'true' | ||
|
||
## web3torrent, xstate-wallet, rps, simple-hub | ||
CHAIN_NETWORK_ID = '3141' | ||
|
||
## simple-hub, e2e | ||
INFURA_API_KEY = '' | ||
RPC_ENDPOINT = https://api.hyperspace.node.glif.io/rpc/v1 | ||
|
||
## simple-hub, rps | ||
FIREBASE_API_KEY = 'AIzaSyAOvhDzJir_El3O6SJ2xQlrpOisnObq6zw' | ||
FIREBASE_PREFIX = 'netlify-hyperspace' | ||
FIREBASE_PROJECT = 'web3torrent-default-rtdb' | ||
|
||
## rps, xstate-wallet, ttt | ||
TARGET_NETWORK = 'hyperspace' | ||
|
||
## web3torrent, rps, ttt | ||
WALLET_URL = 'https://hyperspace-wallet.statechannels.org/' | ||
|
||
## simple-hub, xstate-wallet | ||
CONSENSUS_APP_ADDRESS = '0xeB1170bf49fac482fA296C98Ac04024e8a2d6519' | ||
|
||
NITRO_ADJUDICATOR_ADDRESS = '0xaA512d99EC808FBf49b1e6491A251f2E75f913Ad' | ||
ETH_ASSET_HOLDER_ADDRESS = '0x6abaBB7e642C794264DAa2a1477B48521AaE1553' | ||
|
||
TRIVIAL_APP_ADDRESS = '0x95900b17Bd2CE12431C99A886FfDC5a451C14344' | ||
|
||
## simple-hub | ||
FIREBASE_URL = https://${FIREBASE_PROJECT}.firebaseio.com/ | ||
# This is a funded address on goerli for the hub. This is NOT the production address/key | ||
HUB_CHAIN_PK = '0xBB72BD0824663E0B52FA3523ACED0F866550BBC1FD600D7F2DA9C45CAC509AE7' | ||
HUB_PARTICIPANT_ID = 'firebase:simple-hub' | ||
|
||
## xstate-wallet | ||
# This is a funded address on goerli for the hub. This is NOT the production address/key | ||
HUB_DESTINATION = '0x000000000000000000000000c4FB59b7fb0D8001Bda6DEA539117664573006c9' | ||
USE_INDEXED_DB = 'true' | ||
|
||
## web3torrent | ||
FUNDING_STRATEGY = 'Virtual' | ||
SINGLE_ASSET_PAYMENT_CONTRACT_ADDRESS = '0x4964f1aE3Ca9Ea0a1e7EF873a379768dBc74F034' | ||
SKIP_PREFLIGHT_CHECK = 'true' | ||
TRACKER_URL = 'web3torrent-tracker-hyperspace.herokuapp.com' | ||
TRACKER_URL_HTTP_PROTOCOL = 'https' | ||
GENERATE_SOURCEMAP = 'true' | ||
|
||
## rps | ||
RPS_CONTRACT_ADDRESS = '0x' | ||
|
||
## web3torrent-tracker | ||
TRACKER_PORT = 80 | ||
|
||
## ttt | ||
TTT_CONTRACT_ADDRESS = '0x' | ||
FIREBASE_PROJECT_TTT = 'tic-tac-toe-production' | ||
|
||
|
||
ADD_LOGS = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import AsyncLock from 'async-lock'; | ||
import {Contract, ContractFactory, ethers, providers, BigNumber, utils} from 'ethers'; | ||
import {Contract, ContractFactory, ethers, providers, BigNumber} from 'ethers'; | ||
import {ContractArtifacts} from '@statechannels/nitro-protocol'; | ||
import {cHubChainPK, cHubChainDestination} from '../constants'; | ||
import {log} from '../logger'; | ||
import {NonceManager} from '@ethersproject/experimental'; | ||
import {TransactionResponse} from '@ethersproject/providers'; | ||
import * as Sentry from '@sentry/node'; | ||
|
||
const rpcEndpoint = process.env.RPC_ENDPOINT; | ||
const provider = new providers.JsonRpcProvider(rpcEndpoint); | ||
const walletWithProvider = new ethers.Wallet(cHubChainPK, provider); | ||
const nonceManager = new NonceManager(walletWithProvider); | ||
|
||
let ethAssetHolder: Contract = null; | ||
|
||
const lock = new AsyncLock(); | ||
|
@@ -41,6 +40,7 @@ async function fund(channelID: string, value: BigNumber): Promise<void> { | |
} | ||
|
||
await lock.acquire(channelID, async () => { | ||
console.log('SANITYTYUASDAS'); | ||
const expectedHeld: BigNumber = await ethAssetHolder.holdings(channelID); | ||
if (expectedHeld.gte(value)) { | ||
return; | ||
|
@@ -58,7 +58,6 @@ async function fund(channelID: string, value: BigNumber): Promise<void> { | |
expectedHeld.toHexString(), | ||
value, | ||
{ | ||
gasPrice: utils.parseUnits('15', 'gwei'), | ||
value: value.sub(expectedHeld) | ||
} | ||
); | ||
|
@@ -78,7 +77,7 @@ async function createEthAssetHolder() { | |
try { | ||
ethAssetHolderFactory = await ContractFactory.fromSolidity( | ||
ContractArtifacts.EthAssetHolderArtifact, | ||
nonceManager | ||
walletWithProvider | ||
); | ||
} catch (err) { | ||
if (err.message.match('bytecode must be a valid hex string')) { | ||
|
@@ -94,7 +93,7 @@ async function createEthAssetHolder() { | |
{ETH_ASSET_HOLDER_ADDRESS: process.env.ETH_ASSET_HOLDER_ADDRESS}, | ||
'Connected to eth asset holder' | ||
); | ||
|
||
console.log(contract); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✂️ |
||
return contract; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️