Skip to content

Commit aa31d4b

Browse files
authored
Merge pull request #3 from vsc-eco/feature/rework
Feature/rework
2 parents 292ec8c + a5c8484 commit aa31d4b

28 files changed

+2814
-828
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,28 @@ This command starts a local development server and opens up a browser window. Mo
1414
execute `./publish.sh` or just push to main (github actions workflow will take care of the rest)
1515

1616
The repository needs to have its workflow permissions set to `read and write`, instead of the default vaule. Change that under the repositories settings -> Workflow permissions
17+
18+
### TODO
19+
20+
- [X] [Introduction.md](./docs/Introduction.md)
21+
- [ ] [core-philosophy.md](./docs/discussions/core-philosophy.md)
22+
- [ ] [dex.md](./docs/discussions/dex.md)
23+
- [X] [FAQ.md](./docs/discussions/FAQ.md)
24+
- [ ] [wrapping.md](./docs/discussions/wrapping.md)
25+
- [X] [generate-wallet.md](./docs/how-to/generate-wallet.md)
26+
- [X] [host-node.mdx](./docs/how-to/host-node.mdx)
27+
- [X] [api.md](./docs/references/api.md)
28+
- [X] [block-explorers.md](./docs/references/block-explorers.md)
29+
- [X] [client.md](./docs/references/client.md)
30+
- [ ] [contract-template.md](./docs/references/contract-template.md)
31+
- [X] [account-types.md](./docs/references/account-types.md)
32+
- [X] [examples.md](./docs/references/examples.md)
33+
- [X] [sdk.md](./docs/references/sdk.md)
34+
- [X] [first-contract.md](./docs/tutorials/first-contract.md)
35+
- [X] [invoke-contract.md](./docs/tutorials/invoke-contract.md)
36+
37+
38+
### Reminders
39+
40+
- when contract deployment supports lite accounts, add to the documentation
41+
- move api documentation to the code a la js/ typedoc and just link to it, only manually add documentation to the doc here that describes how those components might be used (examples) or in conjunction

docs/Introduction.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,92 @@
22
sidebar_position: 1
33
---
44

5-
VSC (virtual smart chain) is a next generation smart contract L2 built on the Hive blockchain. VSC not only aims to bring smart contracts to Hive, but completely change the onboarding experience by introducing native lite accounts and cross chain login functionality, support decentralized and secure wrapping technology, and power the future of DAPPs on Hive. VSC operates as sidechain to Hive, this gives us a significant amount of flexibility to advance and build new features, along with the ability to scale the L2 network in the future. Using Hive as a clearing and synchronization method, VSC can push huge amounts of data with little to no overhead on the Hive L1. This approach allows VSC to inherit a lot of Hive's lower level functions such as feeless transactions and 3s block time. VSC uses Webassembly for smart contracts, which us to support any language that comiles down to native webassembly. The flexibility this gives to developers is emmense, where as EVM chains Solidity is the only option. Currently we support AssemblyScript (JavaScript like) with more languages to be added in the future as we vet and build out development tools for each programming language.
5+
# Introduction
66

7-
Already, VSC will power fully decentralized and trustless Bitcoin wrapping, along with many others. The time is now to start building on VSC.
7+
## What is VSC?
88

9-
What do you think?
9+
VSC (virtual smart chain) is a next generation smart contract L2 built on the Hive blockchain. VSC not only aims to bring smart contracts to Hive, but completely change the onboarding experience by introducing native lite accounts and cross chain login functionality, support decentralized and secure wrapping technology, and power the future of DAPPs on Hive.
10+
11+
VSC operates as a sidechain to Hive, this gives us a significant amount of flexibility to advance and build new features, along with the ability to scale the L2 network in the future. Using Hive as a clearing and synchronization method, VSC can push huge amounts of data with little to no overhead on the Hive L1. This approach allows VSC to inherit a lot of Hive's lower level functions such as feeless transactions and 3s block time.
12+
13+
VSC uses Webassembly for smart contracts, which us to support any language that compiles down to native webassembly. The flexibility this gives to developers is emmense, where as EVM chains Solidity is the only option. Currently we support AssemblyScript (JavaScript like) with more languages to be added in the future as we vet and build out development tools for each programming language.
14+
15+
We want to make programming on HIVE easy, cheap and most importantly _available to everyone_.
16+
17+
## Getting started
18+
19+
We are in the early roots of the project. Nevertheless, we want to give you a pleasant onboarding experience to our ecosystem. Here you will find various guides that help you through your journey of discovering and experiencing the capabilities of the VSC ecosystem.
20+
21+
### Create an account
22+
23+
To get started create an _ed25519_ compatible private/ public key pair that will represent your wallet. Checkout [this](./how-to/generate-wallet.md) guide for how to do so.
24+
25+
### Write your first smart contract
26+
27+
Writing your first contract is easy! Dive into the rabbit hole [here](./tutorials/first-contract.md).
28+
29+
## The ecosystem
30+
31+
The VSC ecosystem continuously grows. Inform yourself about the components that are important for _you_ to build on top of VSC!
32+
33+
### Block explorer
34+
35+
Navigating a decentralized network without a block explorer would result in a highly negative user experience. Thereby we have [this section](./references/block-explorers.md) on block explorers, which gives you various information regarding this topic.
36+
37+
### VSC client
38+
39+
To make it easy for developers to build applications that integrate the VSC network we have developed the VSC client. It bridges the gap between the end user facing web2 code and the web3 aspects of the VSC network. [Inform yourself here](./references/client.md).
40+
41+
### Contract template
42+
43+
The contract template is the development environment for your contracts. It contains various tools for testing and validating your contracts capabilities up to scripts for easy deployment to the VSC network. Read more [here](./references/contract-template.md).
44+
45+
### VSC sdks
46+
47+
One of the goals of VSC is to provide language-agnostic smart contract writing capabilities. For that reason we are using webassembly. Plain webassembly without any helper functions is just a little too primitive. Thereby we create VSC sdk's that expose and abstract basic functionalities like persistance or encryption in a library so that the developer doesn't need to care about those basic premises. [Read more about the implementations here](./references/sdk.md).
48+
49+
## Topics of interest
50+
51+
Here you can find a list of different points of interest.
52+
53+
### Host your own node
54+
55+
We need YOU. A decentralized network without node operators is like a democracy with one leader. That just doesn't feel right.
56+
57+
You help us to scale and make the network more secure.
58+
59+
By participating in the VSC network you will receive reimbursements for your node operation.
60+
61+
Interested? [Checkout how to host a node here](./how-to/host-node.mdx).
62+
63+
### Bitcoin wrapping
64+
65+
VSC's mission extends beyond its innovative smart contract capabilities. It aspires to become the driving force behind the integration of various cryptocurrencies, starting with Bitcoin, into the HIVE ecosystem through a process known as wrapping. This approach paves the way for the seamless transfer and utilization of Bitcoin and potentially other cryptocurrencies within the HIVE network. [Read more here](./discussions/wrapping.md)
66+
67+
### Dex
68+
69+
We are building a decentralized exchange that allows users to exchange various currencies on top of your network. This is a crucial part of the VSC ecosystem as it allows users to exchange their assets in a decentralized manner. [Inform yourself about the current state here](./references/dex.md).
70+
71+
### Account types
72+
73+
One of our main goals is to improve the accessibility of smart contract creation and invocation. This is supported by the integration of various account types in the VSC network. Learn about [our supported authentication methods here](./references/account-types.md).
74+
75+
### Contract example
76+
77+
We have various example contracts/ applications that can be used as inspiration for your development journey. [You can see the full list here](./references/examples.md).
78+
79+
### FAQ
80+
81+
The most frequently asked questions get a spot in our FAQ document. This should be your entrypoint in case you are stuck. [Checkout the document here](./discussions/FAQ.md)
82+
83+
## The architecture
84+
85+
Here we give you an overview of the VSC architecture. This is important to understand the underlying principles of the VSC network.
86+
87+
### API documentation
88+
89+
The API of the VSC node can be queried for various information regarding the network. To get an overview of the available data checkout [this document](./references/api.md).
90+
91+
### The VSC node
92+
93+
The core principles of the VSC network, how they complement each other, and why we have chosen certain technologies is explained in detail [here](./discussions/core-philosophy.md).

docs/Resources/block-explorer.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/discussions/FAQ.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# FAQ
2+
3+
## Do we supply node snapshots for node operators?
4+
5+
No, you're node should sync up in ~1 day. If it takes significantly longer than that, contact us.
6+
7+
## Are there any node rewards?
8+
9+
Not yet. We have plans of doing a proof of burn model were node operators essentially buy credits to produce blocks. Then, when you produce blocks, you'd get a small reward on top of your initial investment.
10+
Note: We are not guaranteeing any specifics at the moment. This is subject to change as we do addition research.
11+
12+
## When will I be able to deploy my token on VSC?
13+
14+
We do not have a specific timeline for this.
15+
However, we are currently working on token and wrapping technology internally with HIVE, HBD, and BTC. Once all the kinks are ironed out with that, we will define public token standard(s) and create a reference implementation for each of those standard(s).
16+
17+
## How do I run a node?
18+
19+
Checkout [this repository](https://github.com/vsc-eco/vsc-deployment).
20+
21+
## Why do I see Error: No withdrawals to process?
22+
23+
This is typically normal, especially when your node is re-indexing. Most blocks don't generate withdrawals from the multisig, at the moment. In fact, at the time of writing, there should only be 1 withdrawal from vaultec, so you should see this message many times in your logs.
24+
25+
## How do to update a node?
26+
27+
Firstly, be sure to use the deployment from #4 ⁠faqs⁠ and then run sudo docker-compose up -d. This will pull the latest VSC node docker image automatically.
28+
29+
## How to check if a node is up to date?
30+
31+
`sudo docker-compose exec vsc-node cat .git/refs/heads/main`
32+
33+
This will show you the commit you are on.
34+
35+
Then you can compare it the latest commit in the vsc-node [GitHub repo](https://github.com/vsc-eco/vsc-node/commits/main/).
36+
37+
## How do I migrate from the vsc-node repo to the vsc-deployment repo?
38+
39+
1) cd ~/vsc-node (or where ever your vsc-node repo is)
40+
2) sudo docker-compose down
41+
3) sudo ./migrate.sh
42+
4) cd ../vsc-deployment (or where ever you set the new repo to be)
43+
5) sudo docker-compose up -d
44+
45+
## How do I start writing a smart contract on VSC?
46+
47+
This is our contract template. It should be enough to get started. There is usage and suggestions in [this repo](https://github.com/vsc-eco/contract-template) README.
48+
49+
Also, [here is a DEX](https://github.com/vsc-eco/dex) that we are working on that tries to use/showcase best practices for writing VSC contracts.
50+
51+
As for a formal docs site, we don't have that at the moment.
52+
53+
However, you can checkout the AssemblyScript docs for usage of the smart contract language. It is very similar to TypeScript. Then, everything you need to interface with the VSC chain state is available in the @vsc.eco/sdk npm package.
54+
55+
If you have any concrete suggestions about what we should include in a formal documentation site, please let us know.
56+
57+
## Why is the documentation structured in this way?
58+
59+
The documentation approach is based on the _Diátaxis_ principle. You can watch a summary about it [here](https://www.youtube.com/watch?v=t4vKPhjcMZg).

docs/discussions/core-philosophy.md

Whitespace-only changes.

docs/discussions/dex.md

Whitespace-only changes.

docs/discussions/wrapping.md

Whitespace-only changes.

docs/getting-started/first-smart-contract.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/how-to/generate-wallet.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generate wallet
2+
3+
VSC on its layer 2 supports _ed25519_ compatible wallets. Those are called lite accounts in the context of VSC. They can be generated in various ways. Below you have the current recommended options.
4+
5+
## Official wallet generator
6+
7+
The offical recommended way to generate a lite account is via the wallet generator repository.
8+
9+
It is based on NodeJS and is fairly lightweight.
10+
11+
Clone the repository, install the node modules and run the generator.
12+
13+
Take a look at [the repository here](https://github.com/vsc-eco/wallet-generator).
Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
1-
---
2-
slug: running-a-node
3-
sidebar_position: 2
4-
5-
---
6-
7-
<iframe src="https://3speak.tv/embed?v=vsc.network/vqtkycsg" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>
8-
9-
# Running a node
10-
11-
This tutorial will guide you through the process of setting up a VSC node .
12-
13-
Requirements:
14-
- Hive account (50HP, will rise in the future)
15-
- Technical knowledge of using a command line interface
16-
- Docker and docker-compose installed. Please see [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/) for installation guide for docker.
17-
18-
System requirements are very low, in the future requirements will rise as network usage incrases.
19-
20-
System requirements:
21-
- Raspberry pi 4 or better
22-
- 4 cores, 2GB ram or better
23-
24-
25-
The setup:
26-
27-
1 ) `git clone https://github.com/vsc-eco/vsc-node`
28-
29-
2 ) `cd vsc-node`
30-
31-
3 ) < Fill in .env file here >
32-
33-
You'll need to create a .env file with the following values from the .env.example file.
34-
35-
```
36-
# Fill these in with your hive account details
37-
HIVE_ACCOUNT=Insert hive account username
38-
HIVE_ACCOUNT_POSTING=Insert hive account posting key
39-
HIVE_ACCOUNT_ACTIVE=Insert hive account active key
40-
```
41-
42-
We generally recommend you use a different Hive account from your main account.
43-
44-
45-
4 ) `docker-compose up -d`
46-
47-
You should be off to the races at this point! We can verify that your node is operating correctly on our discord server. Please actively monitor our Hive blog and discord server for incoming updates regarding VSC. You will need to consistent update your node as we release new versions of the software. Staying up to date with the rest of the network is critical in ensuring reliable operation of the network.
1+
# Running a node
2+
3+
This document will guide you through the process of setting up a VSC node .
4+
5+
## Prerequisites
6+
7+
Requirements:
8+
- Hive account (50HP, will rise in the future)
9+
- Technical knowledge of using a command line interface
10+
- Docker and docker-compose installed. Please see [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/) for installation guide for docker.
11+
12+
System requirements are very low, in the future requirements will rise as network usage incrases.
13+
14+
System requirements:
15+
- Raspberry pi 4 or better
16+
- 4 cores, 2GB ram or better
17+
18+
## Video guide
19+
20+
<iframe src="https://3speak.tv/watch?v=vsc.network/uthosijv" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen"></iframe>
21+
22+
## Setup
23+
24+
The setup:
25+
26+
1 ) `git clone https://github.com/vsc-eco/vsc-node`
27+
28+
2 ) `cd vsc-node`
29+
30+
3 ) < Fill in .env file here >
31+
32+
You'll need to create a .env file with the following values from the .env.example file.
33+
34+
```
35+
# Fill these in with your hive account details
36+
HIVE_ACCOUNT=Insert hive account username
37+
HIVE_ACCOUNT_POSTING=Insert hive account posting key
38+
HIVE_ACCOUNT_ACTIVE=Insert hive account active key
39+
```
40+
41+
We generally recommend you use a different Hive account from your main account.
42+
43+
44+
4 ) `docker-compose up -d`
45+
46+
You should be off to the races at this point! We can verify that your node is operating correctly on our discord server. Please actively monitor our Hive blog and discord server for incoming updates regarding VSC. You will need to consistent update your node as we release new versions of the software. Staying up to date with the rest of the network is critical in ensuring reliable operation of the network.
47+
48+
You can disable automatic updates by setting the environment variable AUTO_UPDATE to false. However, we recommend to keep this feature enabled to ensure the node is always up-to-date. In our rapidly evolving ecosystem, it's crucial to keep the node updated for optimal network health.
49+

0 commit comments

Comments
 (0)