Skip to content
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

99 implement deploy chunk upload fct #112

Merged
merged 47 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
bbca24a
Add chunk functions and tests for devideIntoChunks function
thomas-senechal Sep 6, 2024
380f407
Add jest
Ben-Rey Sep 6, 2024
a75e4c5
Add storage cost variables
Ben-Rey Sep 6, 2024
6b19002
Update massa-web3
Ben-Rey Sep 13, 2024
a9d7ad6
Fix entry cost in lib/utils/storage
thomas-senechal Sep 14, 2024
ae2d83b
Add ChunkPost class and toChunkPosts function to convert list of chun…
thomas-senechal Sep 14, 2024
39af0db
Add batcher function to divide list of chunks into batches smaller th…
thomas-senechal Sep 14, 2024
3425a82
Replace deploy and edit commands with a single upload command, and ad…
thomas-senechal Sep 14, 2024
fcba3c8
Add tests for ChunkPost and toChunkPosts functions
thomas-senechal Sep 14, 2024
6d9d3d1
Add built sc files in .gitignore
thomas-senechal Sep 14, 2024
96ca159
Fix lint errors and error with subdirectories handling in prepareChunks
thomas-senechal Sep 14, 2024
d45a690
Fix a bug with base path in prepareChunks and add await for speculati…
thomas-senechal Sep 17, 2024
c911574
Add ls command
thomas-senechal Sep 18, 2024
233d010
Update eslint to v9
thomas-senechal Sep 18, 2024
67ce94e
Fix missnamed option in delete command
thomas-senechal Sep 18, 2024
04ed22b
Add a function to calculate deployment cost
thomas-senechal Sep 18, 2024
33abad2
Add a basic uploadManager
thomas-senechal Sep 18, 2024
27269ea
Use listr2 to show upload progress
thomas-senechal Sep 18, 2024
13d8fd3
Remove useless logger from tasks ctx
thomas-senechal Sep 19, 2024
252b5dd
Show batch and chunk information in prepareBatchesTask
thomas-senechal Sep 19, 2024
154395c
Fix typo in deploySC task prompt
thomas-senechal Sep 19, 2024
4b38c4b
Add check for available funds before deploying the website
thomas-senechal Sep 19, 2024
e0061a3
Add yaml keystore handling
thomas-senechal Sep 19, 2024
3ee3763
Add functional test for CLI deployment with wallet handling
thomas-senechal Sep 19, 2024
e53cbee
Fix upload command in cli functional test CI
thomas-senechal Sep 19, 2024
12b1cbd
Commented functional test cli for later
thomas-senechal Sep 19, 2024
a44def2
Remove useless totalChunks from ChunkPost
thomas-senechal Sep 19, 2024
889acfa
Fix lint errors
thomas-senechal Sep 19, 2024
e85934d
Add wallet files to gitignore
thomas-senechal Sep 19, 2024
9d1fa0f
Fix build:sc script
thomas-senechal Sep 20, 2024
c000e20
Fix getChunkKey
thomas-senechal Sep 20, 2024
6ad5c48
Fix entry storage cost calculation
thomas-senechal Sep 20, 2024
444d689
Update CLI to match new SC
thomas-senechal Sep 20, 2024
64c0b42
Add getTotalChunkKey function
thomas-senechal Sep 23, 2024
2004a32
Add getFileFromAddress function
thomas-senechal Sep 23, 2024
bc046a3
Remove unnecessary file listing from upload command
thomas-senechal Sep 23, 2024
eaf16f4
Add showFileCommand to CLI
thomas-senechal Sep 23, 2024
79ddf28
Improve chunks and prestore handling
thomas-senechal Sep 23, 2024
562151b
Update runs-on value in tests.yml to use ubuntu-22.04 for test-server…
thomas-senechal Sep 23, 2024
7eada71
Add sc build in cli functionnal test
thomas-senechal Sep 23, 2024
74fac02
Add .gitkeep in cli/src/lib/website/sc
thomas-senechal Sep 23, 2024
2a93791
Fix go cache path
thomas-senechal Sep 23, 2024
a71163e
Update massa web3 to fix crypto lib
thomas-senechal Sep 24, 2024
d46387f
Fix chunkPost tests
thomas-senechal Sep 24, 2024
5855a38
Add missing doc in tasks/prepareChunk.ts
thomas-senechal Sep 24, 2024
87003e7
Add test-cli workflow for CLI unit tests
thomas-senechal Sep 24, 2024
28398d1
Use massa-web3 PublicApiUrl instead of raw url for buildnet url
thomas-senechal Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ runs:
with:
go-version: 1.22
cache: true
cache-dependency-path: server/go.sum

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
54 changes: 53 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test-server:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

defaults:
run:
Expand All @@ -24,3 +24,55 @@ jobs:

- name: Run unit tests
run: go test ./...

test-cli:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./cli

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./server/pages/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test

functional-test-cli:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./cli

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./server/pages/package-lock.json
- name: Install dependencies
run: npm ci
- name: Setup wallet
run: |
echo "$WALLET_TEST_WALLET" > ./wallet_fullpower.yaml
env:
WALLET_TEST_WALLET: ${{ secrets.WALLET_TEST_WALLET }}
- name: Build Smart Contract
run: |
npm run build:sc
- name: Run functional tests
run: |
npm run build
npm run start -- upload -y --wallet ./wallet_fullpower.yaml --password $WALLET_TEST_PASSWORD ../smart-contract/src/e2e/test-project/dist
env:
WALLET_TEST_PASSWORD: ${{ secrets.WALLET_TEST_PASSWORD }}
3 changes: 0 additions & 3 deletions cli/.eslintignore

This file was deleted.

11 changes: 0 additions & 11 deletions cli/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ node_modules/
# build folder
dist/
bin/

# Jest
coverage/

# built sc
*.wasm

thomas-senechal marked this conversation as resolved.
Show resolved Hide resolved
# wallets
wallet*.yaml
34 changes: 34 additions & 0 deletions cli/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import tsParser from '@typescript-eslint/parser'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default [
{
ignores: ['**/bin', '**/node_modules', '**/scripts', 'jest.config.ts'],
},
...compat.extends('@massalabs', 'prettier'),
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
},
rules: {
'tsdoc/syntax': 'warn',
'max-len': ['error', 200],
camelcase: 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-console': 'off',
'comma-dangle': 'off',
},
},
]
24 changes: 24 additions & 0 deletions cli/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { Config } from 'jest'

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.(ts|js|tsx)$': [
'ts-jest',
{
useESM: true,
},
],
},
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
}

export default config
Loading
Loading