Skip to content

Commit

Permalink
Merge branch 'main' into combine-prs-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
asutula authored Sep 6, 2022
2 parents 2f5aade + ea4e464 commit 4286f92
Show file tree
Hide file tree
Showing 11 changed files with 287 additions and 112 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ images.zip
sql
sql.zip
renders
local.db
tableland.db

# Binaries for programs and plugins
*.exe
Expand Down
271 changes: 265 additions & 6 deletions README.md

Large diffs are not rendered by default.

Binary file added artifacts/viewer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions cmd/rigs/cmd/local_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func init() {
localCmd.AddCommand(viewCmd)

viewCmd.Flags().Bool(
"no-client",
"no-viewer",
false,
"specifies that the web server shouldn't host the client web app because it is being started separately",
"specifies that the web server shouldn't host the viewer web app because it is being started separately",
)
viewCmd.Flags().Int("port", 5000, "port for the http server to listen on")
viewCmd.Flags().String("images-path", "./renders", "path to the rendered rig images")
Expand All @@ -38,11 +38,11 @@ var viewCmd = &cobra.Command{
addr := fmt.Sprintf("localhost:%d", port)
api := fmt.Sprintf("http://%s", addr)

if !viper.GetBool("no-client") {
r.PathPrefix("/").Handler(http.FileServer(http.Dir("client/dist")))
if !viper.GetBool("no-viewer") {
r.PathPrefix("/").Handler(http.FileServer(http.Dir("viewer/dist")))
checkErr(os.Setenv("API", api))
npmCmd := exec.Command("npm", "run", "generate")
npmCmd.Dir = "client"
npmCmd.Dir = "viewer"
stdout, err := npmCmd.Output()
checkErr(err)
fmt.Println(string(stdout))
Expand Down
6 changes: 3 additions & 3 deletions cmd/rigs/cmd/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var (
dirPublisher *dirpublisher.DirPublisher
store storage.Store
tblClient *client.Client
chain client.Chain
)

func init() {
Expand Down Expand Up @@ -54,7 +55,7 @@ func init() {
"chain",
"polygon-mumbai",
`the tableland/evm to use, spported values are:
etherum
ethereum
optimism
polygon
ethereum-goerli
Expand Down Expand Up @@ -98,7 +99,6 @@ var publishCmd = &cobra.Command{
wallet, err := wallet.NewWallet(viper.GetString("private-key"))
checkErr(err)

var chain client.Chain
if viper.GetString("tbl-api-url") != "" {
chain = client.Chain{
Endpoint: viper.GetString("tbl-api-url"),
Expand Down Expand Up @@ -165,7 +165,7 @@ var publishCmd = &cobra.Command{
func getChain() (client.Chain, error) {
chain := viper.GetString("chain")
switch chain {
case "etherum":
case "ethereum":
return client.Chains.Ethereum, nil
case "optimism":
return client.Chains.Optimism, nil
Expand Down
6 changes: 2 additions & 4 deletions cmd/rigs/cmd/publish_list-tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"text/tabwriter"

"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func init() {
Expand All @@ -17,10 +16,9 @@ var listTablesCmd = &cobra.Command{
Use: "list-tables",
Short: "List most recently created tableland tables",
Run: func(cmd *cobra.Command, args []string) {
chainID := viper.GetInt64("chain-id")
res, err := localStore.TableNames(cmd.Context(), chainID)
res, err := localStore.TableNames(cmd.Context(), int64(chain.ID))
checkErr(err)
fmt.Printf("Tracked tables for chain id %d:\n", chainID)
fmt.Printf("Tracked tables for chain id %d:\n", chain.ID)
tw := tabwriter.NewWriter(os.Stdout, 0, 8, 2, '\t', tabwriter.AlignRight)
for _, t := range res {
fmt.Fprintf(
Expand Down
2 changes: 1 addition & 1 deletion cmd/rigs/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
func init() {
cobra.OnInitialize(initConfig)

rootCmd.PersistentFlags().String("local-db-path", "", "path the the sqlite local db file")
rootCmd.PersistentFlags().String("local-db-path", "./local.db", "path the the sqlite local db file")
rootCmd.PersistentFlags().String("ipfs-api-url", "http://127.0.0.1:5001", "address of the local ipfs api")
}

Expand Down
84 changes: 0 additions & 84 deletions ethereum/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions ethereum/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function main() {
if (rigsDeployment.contractTable === "") {
const createRes = await tbl!.create(
"name text, description text, image text, external_link text, seller_fee_basis_points int, fee_recipient text",
"rigs_contract"
{ prefix: "rigs_contract" }
);
contractTable = createRes.name!;
console.log("Contract table created as:", contractTable);
Expand Down Expand Up @@ -130,7 +130,7 @@ async function main() {
if (rigsDeployment.allowlistTable === "") {
const createRes = await tbl!.create(
`address text, freeAllowance int, paidAllowance int, waitlist int`,
"rigs_allowlist"
{ prefix: "rigs_allowlist" }
);
allowlistTable = createRes.name!;
console.log("Allowlist table created as:", allowlistTable);
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/local/impl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (s *Store) Cid(ctx context.Context, label string) (string, error) {
return "", fmt.Errorf("scanning cid result: %v", err)
}
if !found {
return "", errors.New("not found")
return "", errors.New("layers cid not found")
}
return res, nil
}
Expand All @@ -392,7 +392,7 @@ func (s *Store) TableName(ctx context.Context, label string, chainID int64) (str
return "", fmt.Errorf("scanning name result: %v", err)
}
if !found {
return "", errors.New("not found")
return "", errors.New("table name not found")
}
return res, nil
}
Expand Down
10 changes: 5 additions & 5 deletions viewer/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
env: {
api: process.env.API || 'http://localhost:5000',
api: process.env.API || 'http://localhost:5000'
},
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
Expand All @@ -10,14 +10,14 @@ export default {

// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'NFT Layer Renderer',
title: 'Local Rigs Viewer',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Google Sheets and Drive based NFT layer renderer' },
{ hid: 'description', name: 'description', content: 'Local Rigs viewer' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [
Expand Down Expand Up @@ -53,12 +53,12 @@ export default {

// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
extend(config, { isDev, isClient }) {
extend: function (config, { isDev, isClient }) {
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
})
});
}
}
};

0 comments on commit 4286f92

Please sign in to comment.