This (and related gists) captures how i created my docker swarm architecture. This is intended mostly for my own notes incase i need to re-creeate anything later!
Each major task has its own gist, this is to help with maitainability long term.
package pocketbase | |
import ( | |
"errors" | |
"fmt" | |
"time" | |
"github.com/duke-git/lancet/v2/convertor" | |
"github.com/go-resty/resty/v2" | |
"golang.org/x/sync/singleflight" |
package main | |
import ( | |
"flag" | |
"io" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
) |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net" | |
"os" | |
) | |
const ( |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" |
This (and related gists) captures how i created my docker swarm architecture. This is intended mostly for my own notes incase i need to re-creeate anything later!
Each major task has its own gist, this is to help with maitainability long term.
var App = { | |
getPolyJuiceAddr: async () => { | |
const addressTranslator = new AddressTranslator() | |
const polyjuiceAddress = addressTranslator.ethAddressToGodwokenShortAddress(App.account) | |
$('#poly-address').text(polyjuiceAddress) | |
} | |
} |
loadWeb3: async () => { | |
const providerConfig = { | |
rollupTypeHash: process.env.ROLLUP_TYPE_HASH, | |
ethAccountLockCodeHash: process.env.ETH_ACCOUNT_LOCK_CODE_HASH, | |
web3Url: process.env.WEB3_PROVIDER_URL | |
} | |
const provider = new PolyjuiceHttpProvider(process.env.WEB3_PROVIDER_URL, providerConfig) | |
App.web3Provider = provider | |
web3 = new Web3(provider) | |
} |
# use the eth wallet where you have your funds deposited. For more info check | |
DEPLOYER_PRIVATE_KEY=<YOUR_LAYER_2_ETHEREUM_PVT_KEY> | |
WEB3_PROVIDER_URL=https://godwoken-testnet-web3-rpc.ckbapp.dev | |
ROLLUP_TYPE_HASH=0x4cc2e6526204ae6a2e8fcf12f7ad472f41a1606d5b9624beebd215d780809f6a | |
ETH_ACCOUNT_LOCK_CODE_HASH=0xdeec13a7b8e100579541384ccaf4b5223733e4a5483c3aec95ddc4c1d5ea5b22 |
const path = require('path') | |
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') | |
const Dotenv = require('dotenv-webpack') | |
module.exports = { | |
entry: './src/app.js', // we need to import this to index.html file | |
output: { | |
filename: 'app.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
plugins: [ |
DEPLOYER_PRIVATE_KEY=<YOUR_GANACHE_PVT_KEY> | |
GANACHE_URL=http://localhost:8545 | |
# ingore the below for now | |
WEB3_PROVIDER_URL= | |
ROLLUP_TYPE_HASH= | |
ETH_ACCOUNT_LOCK_CODE_HASH= |