forked from maticnetwork/terraform-polygon-supernets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bridge set up with geth (maticnetwork#3)
* bridge to geth * typo
- Loading branch information
Showing
29 changed files
with
581 additions
and
134 deletions.
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
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 +1,2 @@ | ||
password.txt | ||
local-extra-vars.yml |
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
--- | ||
clean_deploy_title: devnet01 | ||
# ansible uses _ instead of -, so this is intentional | ||
current_deploy_inventory: devnet01_edge_polygon_private | ||
block_gas_limit: 50_000_000 | ||
block_time: 2 | ||
chain_id: 2001 | ||
|
||
# cat ~/cert/2022-07-05-devnets-generic.key | ansible-vault encrypt_string --stdin-name devnet_default_ssh_key --vault-password password.txt | ||
# This value should only be needed for manually created devnets. | ||
|
||
ansible_ssh_private_key_file: ~/cert/devnet_private.key | ||
|
||
# you shouldn't need to change below | ||
polycli_tag: 0.1.18 | ||
ansible_ssh_common_args: > | ||
-o IdentitiesOnly=yes | ||
-o StrictHostKeyChecking=no | ||
-o ProxyCommand="sh -c \"aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'\"" | ||
ansible_user: ubuntu | ||
ansible_become: true | ||
ansible_ssh_retries: 5 | ||
clean_deploy_name: "{{ clean_deploy_title }}" | ||
git_pat_token: "{{ git_token }}" | ||
polycli_version_tag: "{{ polycli_tag }}" | ||
|
||
edge_tag: HEAD | ||
go_tag: 1.19.5.linux-amd64 | ||
|
||
geth_tag: v1.11.2 | ||
|
||
geth_miner_mnemonic: code code code code code code code code code code code quality | ||
geth_chain_id: 1001 | ||
geth_http_port: 8545 | ||
geth_p2p_port: 30303 |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Web3 from 'web3'; | ||
import fs from 'fs/promises'; | ||
|
||
const data = JSON.parse(await fs.readFile('/var/lib/bootstrap/core-contracts/artifacts/contracts/mocks/MockERC20.sol/MockERC20.json', { encoding: 'utf8' })); | ||
|
||
const web3 = new Web3('{{ rootchain_json_rpc }}') | ||
|
||
|
||
const loadtestAccount = web3.eth.accounts.privateKeyToAccount('0x' + process.env.PRIVATE_KEY) | ||
console.log(loadtestAccount) | ||
|
||
const addedAccount = web3.eth.accounts.wallet.add(loadtestAccount); | ||
console.log('addedAccount', addedAccount); | ||
|
||
var contract = new web3.eth.Contract(data.abi); | ||
console.log('contract', contract); | ||
|
||
const deployed = await contract.deploy({ | ||
data: data.bytecode, | ||
arguments: ['hello', 'bye'] | ||
}).send({ | ||
gas: 10000000, | ||
from: loadtestAccount.address | ||
}) | ||
console.log('deployed', deployed); | ||
|
||
|
||
const mint = await deployed.methods.mint(loadtestAccount.address, web3.utils.toWei('1000000000000000000000', 'ether')).send({ | ||
gas: 10000000, | ||
from: loadtestAccount.address | ||
}) | ||
console.log('mint', mint) |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "", | ||
"type": "module", | ||
"description": "", | ||
"version": "0.1.0", | ||
"dependencies": { | ||
"web3": "^1.8.1" | ||
} | ||
} |
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,30 @@ | ||
--- | ||
# Install go | ||
|
||
- name: "Download go{{ go_tag }}" | ||
ansible.builtin.get_url: | ||
url: "https://go.dev/dl/go{{ go_tag }}.tar.gz" | ||
dest: "/opt/go{{ go_tag }}.tar.gz" | ||
mode: 0755 | ||
force: false | ||
|
||
- name: Extract go binary | ||
ansible.builtin.unarchive: | ||
src: "/opt/go{{ go_tag }}.tar.gz" | ||
dest: /usr/local/ | ||
remote_src: true | ||
|
||
- name: Create a symlink for go | ||
ansible.builtin.file: | ||
src: /usr/local/go/bin/go | ||
dest: /usr/local/bin/go | ||
state: link | ||
|
||
- name: Get go version | ||
ansible.builtin.command: go version | ||
register: go_version_result | ||
changed_when: false | ||
|
||
- name: Display go version | ||
ansible.builtin.debug: | ||
msg: "{{ go_version_result.stdout }}" |
Oops, something went wrong.